skip to main content
article
Public Access

Optimizing synthesis with metasketches

Published: 11 January 2016 Publication History

Abstract

Many advanced programming tools---for both end-users and expert developers---rely on program synthesis to automatically generate implementations from high-level specifications. These tools often need to employ tricky, custom-built synthesis algorithms because they require synthesized programs to be not only correct, but also optimal with respect to a desired cost metric, such as program size. Finding these optimal solutions efficiently requires domain-specific search strategies, but existing synthesizers hard-code the strategy, making them difficult to reuse. This paper presents metasketches, a general framework for specifying and solving optimal synthesis problems. metasketches make the search strategy a part of the problem definition by specifying a fragmentation of the search space into an ordered set of classic sketches. We provide two cooperating search algorithms to effectively solve metasketches. A global optimizing search coordinates the activities of local searches, informing them of the costs of potentially-optimal solutions as they explore different regions of the candidate space in parallel. The local searches execute an incremental form of counterexample-guided inductive synthesis to incorporate information sent from the global search. We present Synapse, an implementation of these algorithms, and show that it effectively solves optimal synthesis problems with a variety of different cost functions. In addition, metasketches can be used to accelerate classic (non-optimal) synthesis by explicitly controlling the search strategy, and we show that Synapse solves classic synthesis problems that state-of-the-art tools cannot.

References

[1]
R. Alur, L. D’Antoni, S. Gulwani, D. Kini, and M. Viswanathan. Automated grading of DFA constructions. In IJCAI, 2011.
[2]
R. Alur, R. Bodik, G. Juniwal, M. M. K. Martin, M. Raghothaman, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-guided synthesis. In FMCAD, 2013.
[3]
R. Alur, R. Bodik, E. Dallal, D. Fisman, P. Garg, G. Juniwal, H. Kress-Gazit, P. Madhusudan, M. M. K. Martin, M. Raghothaman, S. Saha, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-guided synthesis. In Dependable Software Systems Engineering, volume 40. 2015.
[4]
R. Alur, D. Fisman, R. Singh, and A. Solar-Lezama. The second competition on syntax-guided synthesis. In SYNT, 2015. URL http: //formal.epfl.ch/synt/2015/slides/fisman-etal.pdf.
[5]
M. Carbin, S. Misailovic, and M. C. Rinard. Verifying quantitative reliability for programs that execute on unreliable hardware. In OOPSLA, 2013.
[6]
S. Chaudhuri, M. Clochard, and A. Solar-Lezama. Bridging boolean and quantitative synthesis using smoothed proof search. In POPL, 2014.
[7]
A. Cimatti, A. Franzén, A. Griggio, R. Sebastiani, and C. Stenico. Satisfiability modulo the theory of costs: Foundations and applications. In TACAS, 2010.
[8]
L. De Moura and N. Bjørner. Z3: An efficient SMT solver. In TACAS, 2008.
[9]
H. Esmaeilzadeh, A. Sampson, L. Ceze, and D. Burger. Neural acceleration for general-purpose approximate programs. In MICRO, 2012.
[10]
J. K. Feser, S. Chaudhuri, and I. Dillig. Synthesizing data structure transformations from input-output examples. In PLDI, 2015.
[11]
S. Gulwani. Automating string processing in spreadsheets using inputoutput examples. In POPL, 2011.
[12]
S. Gulwani, S. Jha, A. Tiwari, and R. Venkatesan. Synthesis of loop-free programs. In PLDI, 2011.
[13]
S. Gulwani, W. R. Harris, and R. Singh. Spreadsheet data manipulation using examples. Commun. ACM, 55(8), Aug. 2012.
[14]
J. Jeon, X. Qiu, A. Solar-Lezama, and J. S. Foster. Adaptive concretization for parallel program synthesis. In CAV, 2015.
[15]
S. Jha, S. Gulwani, S. A. Seshia, and A. Tiwari. Oracle-guided component-based program synthesis. In ICSE, 2010.
[16]
R. Joshi, G. Nelson, and K. Randall. Denali: a goal-directed superoptimizer. In PLDI, 2002.
[17]
A. S. Köksal, Y. Pu, S. Srivastava, R. Bodik, J. Fisher, and N. Piterman. Synthesis of biological models from mutation experiments. In POPL, 2013.
[18]
A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.
[19]
I. Kuraj, V. Kuncak, and D. Jackson. Programming with enumerable sets of structures. In OOPSLA, 2015.
[20]
Y. Li, A. Albarghouthi, Z. Kincaid, A. Gurfinkel, and M. Chechik. Symbolic optimization with SMT solvers. In POPL, 2014.
[21]
A. Massalin. Superoptimizer: A look at the smallest program. In ASPLOS, 1987.
[22]
A. K. Menon, O. Tamuz, S. Gulwani, and A. T. Kalai. A machine learning framework for programming by example. In ICML, 2013.
[23]
L. A. Meyerovich. Parallel Layout Engines: Synthesis and Optimization of Tree Traversals. PhD thesis, University of California, Berkeley, 2013.
[24]
L. A. Meyerovich, M. E. Torok, E. Atkinson, and R. Bodik. Parallel schedule synthesis for attribute grammars. In PPoPP, 2013.
[25]
T. Moreau, M. Wyse, J. Nelson, A. Sampson, H. Esmaeilzadeh, L. Ceze, and M. Oskin. SNNAP: Approximate computing on programmable SoCs via neural acceleration. In HPCA, 2015.
[26]
V. Nair and G. E. Hinton. Rectified linear units improve restricted Boltzmann machines. In ICML, 2010.
[27]
P. M. Phothilimthana, T. Jelvis, R. Shah, N. Totla, S. Chasins, and R. Bodik. Chlorophyll: Synthesis-aided compiler for low-power spatial architectures. In PLDI, 2014.
[28]
O. Polozov and S. Gulwani. FlashMeta: A framework for inductive program synthesis. In OOPSLA, 2015.
[29]
J. D. Ramsdell. An operational semantics for Scheme. SIGPLAN Lisp Pointers, V(2):6–10, 1992.
[30]
A. Reynolds, M. Deters, V. Kuncak, C. Tinelli, and C. Barrett. Counterexample-guided quantifier instantiation for synthesis in SMT. In CAV, 2015.
[31]
E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, 2013.
[32]
R. Sebastiani and S. Tomasi. Optimization in SMT with LA(Q) cost functions. In IJCAR, 2012.
[33]
J. E. Smith. Characterizing computer performance with a single number. Commun. ACM, 31(10), Oct. 1988.
[34]
A. Solar-Lezama. Program synthesis by sketching. PhD thesis, University of California, Berkeley, 2008.
[35]
A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Combinatorial sketching for finite programs. In ASPLOS, 2006.
[36]
A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Sketching stencils. In PLDI, 2007.
[37]
V. Srinivasan and T. Reps. Synthesis of machine code from semantics. In PLDI, 2015.
[38]
M. Szudzik. An elegant pairing function. In NKS, 2006.
[39]
E. Torlak and R. Bodik. Growing solver-aided languages with Rosette. In Onward!, 2013.
[40]
E. Torlak and R. Bodik. A lightweight symbolic virtual machine for solver-aided host languages. In PLDI, 2014.
[41]
E. Torlak and D. Jackson. Kodkod: A relational model finder. In TACAS, 2007.
[42]
A. Udupa, A. Raghavan, J. V. Deshmukh, S. Mador-Haim, M. M. K. Martin, and R. Alur. Transit: Specifying protocols with concolic snippets. In PLDI, 2013.
[43]
H. S. Warren, Jr. Hacker’s Delight. Addison-Wesley, 2007. Introduction Optimal Syntax-Guided Synthesis Metasketches The Metasketch Abstraction Properties of Metasketches Examples Optimal Synthesis Algorithm Global Search Local Searches Characterization Implementation Evaluation Benchmarks Is Synapse a practical approach to solving different kinds of synthesis problems? Does the fragmentation of the search space by a metasketch translate into parallel speedup? Is online completeness empirically useful? How beneficial are our metasketch and implementation optimizations? Can Synapse reason about dynamic cost functions? Related Work Conclusion

Cited By

View all
  • (2021)Web question answering with neurosymbolic program synthesisProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454047(328-343)Online publication date: 19-Jun-2021
  • (2021)Inductive Synthesis for Probabilistic Programs Reaches New HorizonsTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-030-72016-2_11(191-209)Online publication date: 20-Mar-2021
  • (2020)Synthesizing JIT Compilers for In-Kernel DSLsComputer Aided Verification10.1007/978-3-030-53291-8_29(564-586)Online publication date: 14-Jul-2020
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 51, Issue 1
POPL '16
January 2016
815 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/2914770
  • Editor:
  • Andy Gill
Issue’s Table of Contents
  • cover image ACM Conferences
    POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
    January 2016
    815 pages
    ISBN:9781450335492
    DOI:10.1145/2837614
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 the author(s) 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: 11 January 2016
Published in SIGPLAN Volume 51, Issue 1

Check for updates

Author Tag

  1. Program synthesis

Qualifiers

  • Article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)359
  • Downloads (Last 6 weeks)32
Reflects downloads up to 03 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2021)Web question answering with neurosymbolic program synthesisProceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3453483.3454047(328-343)Online publication date: 19-Jun-2021
  • (2021)Inductive Synthesis for Probabilistic Programs Reaches New HorizonsTools and Algorithms for the Construction and Analysis of Systems10.1007/978-3-030-72016-2_11(191-209)Online publication date: 20-Mar-2021
  • (2020)Synthesizing JIT Compilers for In-Kernel DSLsComputer Aided Verification10.1007/978-3-030-53291-8_29(564-586)Online publication date: 14-Jul-2020
  • (2019)Resource-guided program synthesisProceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3314221.3314602(253-268)Online publication date: 8-Jun-2019
  • (2019)Synthesizing Efficient Low-Precision KernelsAutomated Technology for Verification and Analysis10.1007/978-3-030-31784-3_17(294-313)Online publication date: 28-Oct-2019
  • (2019)Counterexample-Driven Synthesis for Probabilistic Program SketchesFormal Methods – The Next 30 Years10.1007/978-3-030-30942-8_8(101-120)Online publication date: 23-Sep-2019
  • (2018)Functional programming for compiling and decompiling computer-aided designProceedings of the ACM on Programming Languages10.1145/32367942:ICFP(1-31)Online publication date: 30-Jul-2018
  • (2017)Synthesis of data completion scripts using finite tree automataProceedings of the ACM on Programming Languages10.1145/31338861:OOPSLA(1-26)Online publication date: 12-Oct-2017
  • (2017)Syntax-Guided Optimal Synthesis for Chemical Reaction NetworksComputer Aided Verification10.1007/978-3-319-63390-9_20(375-395)Online publication date: 13-Jul-2017
  • (2024)Data-Driven Insight Synthesis for Multi-Dimensional DataProceedings of the VLDB Endowment10.14778/3641204.364121117:5(1007-1019)Online publication date: 1-Jan-2024
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media