skip to main content
article

Combinatorial sketching for finite programs

Published: 20 October 2006 Publication History

Abstract

Sketching is a software synthesis approach where the programmer develops a partial implementation - a sketch - and a separate specification of the desired functionality. The synthesizer then completes the sketch to behave like the specification. The correctness of the synthesized implementation is guaranteed by the compiler, which allows, among other benefits, rapid development of highly tuned implementations without the fear of introducing bugs.We develop SKETCH, a language for finite programs with linguistic support for sketching. Finite programs include many highperformance kernels, including cryptocodes. In contrast to prior synthesizers, which had to be equipped with domain-specific rules, SKETCH completes sketches by means of a combinatorial search based on generalized boolean satisfiability. Consequently, our combinatorial synthesizer is complete for the class of finite programs: it is guaranteed to complete any sketch in theory, and in practice has scaled to realistic programming problems.Freed from domain rules, we can now write sketches as simpleto-understand partial programs, which are regular programs in which difficult code fragments are replaced with holes to be filled by the synthesizer. Holes may stand for index expressions, lookup tables, or bitmasks, but the programmer can easily define new kinds of holes using a single versatile synthesis operator.We have used SKETCH to synthesize an efficient implementation of the AES cipher standard. The synthesizer produces the most complex part of the implementation and runs in about an hour.

References

[1]
D. Andre and S. Russell. Programmable reinforcement learning agents. Advances in Neural Information Processing Systems, 13, 2001. MIT Press.
[2]
R.M. Burstall and J. Darlington. A transformation system for developing recursive programs. Journal of the ACM, 24(1):44--67, 1977.
[3]
E. Clarke, D. Kroening, and K. Yorav. Behavioral consistency of C and Verilog programs using bounded model checking. In DAC, pages 368--371, May 2003.
[4]
N. Eézn and N. Sörensson. An extensible SAT-solver. In E. Giunchiglia and A. Tacchella, editors, SAT, volume 2919 of Lecture Notes in Computer Science, pages 502--518. Springer, 2003.
[5]
Advanced encryption standard (AES). U.S. DEPARTMENT OF COMMERCE/National Institute of Standards and Technology, November 2001. http://csrc.nist.gov/publications/fips/fips197/fips-197.pdf.
[6]
B. Fischer and J. Schumann. Autobayes: a system for generating data analysis programs from statistical models. Journal of Functional Programming, 13(3):483--508, May 2003.
[7]
P.V. Hentenryck and V. Saraswat. Strategic directions in constraint programming. ACM Comput. Surv., 28(4):701--726, 1996.
[8]
R. Joshi, G. Nelson, and K.H. Randall. Denali: A goal-directed superoptimizer. In PLDI, pages 304--314, 2002.
[9]
Z. Manna and R.J. Waldinger. Toward automatic program synthesis. Commun. ACM, 14(3):151--165, 1971.
[10]
A. Mishchenko, S. Chatterjee, and R. Brayton. Dag-aware AIG rewriting: A fresh look at combinational logic synthesis. In DAC '06: Proceedings of the 43rd annual conference on Design automation, pages 532--535, New York, NY, USA, 2006. ACM Press.
[11]
D.P. Ranjan, D. Tang, and S. Malik. A comparative study of 2qbf algorithms. In The Seventh International Conference on Theory and Applications of Satisfiability Testing (SAT 2004), May 2004.
[12]
E.M. Reingold, J. Nievergelt, and N. Deo. Combinatorial Algorithms - Theory and Practice. Prentice-Hall, 1977.
[13]
A. Solar-Lezama, R. Rabbah, R. Bodik, and K. Ebcioglu. Programming by sketching for bit-streaming programs. In PLDI '05: Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation, pages 281--294, New York, NY, USA, 2005. ACM Press.
[14]
W. Thies, M. Karczmarek, and S. Amarasinghe. Streamit: A language for streaming applications. In International Conference on Compiler Construction, Grenoble, France, Apr. 2002.
[15]
H.S. Warren. Hacker's Delight. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA, 2002.
[16]
P. Wegner. A technique for counting ones in a binary computer. Commun. ACM, 3(5):322, 1960.
[17]
Y. Xie and A. Aiken. Scalable error detection using boolean satisfiability. In Proceedings of the 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL), pages 351--363, 2005.

Cited By

View all
  • (2024)SYNTHBX: An Example-guided Synthesizer for Bidirectional Programs on RelationsJournal of Information Processing10.2197/ipsjjip.32.47132(471-486)Online publication date: 2024
  • (2024)Polynomial Neural Barrier Certificate Synthesis of Hybrid Systems via Counterexample GuidanceIEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems10.1109/TCAD.2024.344722643:11(3756-3767)Online publication date: Nov-2024
  • (2024)Model Checking and Strategy Synthesis with Abstractions and CertificatesPrinciples of Verification: Cycling the Probabilistic Landscape10.1007/978-3-031-75775-4_16(360-391)Online publication date: 13-Nov-2024
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 41, Issue 11
Proceedings of the 2006 ASPLOS Conference
November 2006
425 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1168918
Issue’s Table of Contents
  • cover image ACM Conferences
    ASPLOS XII: Proceedings of the 12th international conference on Architectural support for programming languages and operating systems
    October 2006
    440 pages
    ISBN:1595934510
    DOI:10.1145/1168857
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 October 2006
Published in SIGPLAN Volume 41, Issue 11

Check for updates

Author Tags

  1. SAT
  2. sketching

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)157
  • Downloads (Last 6 weeks)11
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2024)SYNTHBX: An Example-guided Synthesizer for Bidirectional Programs on RelationsJournal of Information Processing10.2197/ipsjjip.32.47132(471-486)Online publication date: 2024
  • (2024)Polynomial Neural Barrier Certificate Synthesis of Hybrid Systems via Counterexample GuidanceIEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems10.1109/TCAD.2024.344722643:11(3756-3767)Online publication date: Nov-2024
  • (2024)Model Checking and Strategy Synthesis with Abstractions and CertificatesPrinciples of Verification: Cycling the Probabilistic Landscape10.1007/978-3-031-75775-4_16(360-391)Online publication date: 13-Nov-2024
  • (2024)Bisimulation LearningComputer Aided Verification10.1007/978-3-031-65633-0_8(161-183)Online publication date: 26-Jul-2024
  • (2023)Optimal CHC Solving via Termination ProofsProceedings of the ACM on Programming Languages10.1145/35712147:POPL(604-631)Online publication date: 11-Jan-2023
  • (2023)Comparative Synthesis: Learning Near-Optimal Network Designs by QueryProceedings of the ACM on Programming Languages10.1145/35711977:POPL(91-120)Online publication date: 11-Jan-2023
  • (2023)Counterexample Guided Inductive Synthesis Using Large Language Models and Satisfiability SolvingMILCOM 2023 - 2023 IEEE Military Communications Conference (MILCOM)10.1109/MILCOM58377.2023.10356332(944-949)Online publication date: 30-Oct-2023
  • (2023)Counter-Example Guided Inductive Synthesis of Control Lyapunov Functions for Uncertain SystemsIEEE Control Systems Letters10.1109/LCSYS.2023.32851027(2047-2052)Online publication date: 2023
  • (2023)Synthesising Programs with Non-trivial ConstantsJournal of Automated Reasoning10.1007/s10817-023-09664-467:2Online publication date: 13-May-2023
  • (2023)Condition Synthesis Realizability via Constrained Horn ClausesNASA Formal Methods10.1007/978-3-031-33170-1_23(380-396)Online publication date: 3-Jun-2023
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media