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.
- R. Alur, L. D’Antoni, S. Gulwani, D. Kini, and M. Viswanathan. Automated grading of DFA constructions. In IJCAI, 2011. Google Scholar
Digital Library
- 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.Google Scholar
Cross Ref
- 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.Google Scholar
- 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.Google Scholar
- M. Carbin, S. Misailovic, and M. C. Rinard. Verifying quantitative reliability for programs that execute on unreliable hardware. In OOPSLA, 2013. Google Scholar
Digital Library
- S. Chaudhuri, M. Clochard, and A. Solar-Lezama. Bridging boolean and quantitative synthesis using smoothed proof search. In POPL, 2014. Google Scholar
Digital Library
- A. Cimatti, A. Franzén, A. Griggio, R. Sebastiani, and C. Stenico. Satisfiability modulo the theory of costs: Foundations and applications. In TACAS, 2010. Google Scholar
Digital Library
- L. De Moura and N. Bjørner. Z3: An efficient SMT solver. In TACAS, 2008. Google Scholar
Digital Library
- H. Esmaeilzadeh, A. Sampson, L. Ceze, and D. Burger. Neural acceleration for general-purpose approximate programs. In MICRO, 2012. Google Scholar
Digital Library
- J. K. Feser, S. Chaudhuri, and I. Dillig. Synthesizing data structure transformations from input-output examples. In PLDI, 2015. Google Scholar
Digital Library
- S. Gulwani. Automating string processing in spreadsheets using inputoutput examples. In POPL, 2011. Google Scholar
Digital Library
- S. Gulwani, S. Jha, A. Tiwari, and R. Venkatesan. Synthesis of loop-free programs. In PLDI, 2011. Google Scholar
Digital Library
- S. Gulwani, W. R. Harris, and R. Singh. Spreadsheet data manipulation using examples. Commun. ACM, 55(8), Aug. 2012. Google Scholar
Digital Library
- J. Jeon, X. Qiu, A. Solar-Lezama, and J. S. Foster. Adaptive concretization for parallel program synthesis. In CAV, 2015.Google Scholar
- S. Jha, S. Gulwani, S. A. Seshia, and A. Tiwari. Oracle-guided component-based program synthesis. In ICSE, 2010. Google Scholar
Digital Library
- R. Joshi, G. Nelson, and K. Randall. Denali: a goal-directed superoptimizer. In PLDI, 2002. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.Google Scholar
- I. Kuraj, V. Kuncak, and D. Jackson. Programming with enumerable sets of structures. In OOPSLA, 2015. Google Scholar
Digital Library
- Y. Li, A. Albarghouthi, Z. Kincaid, A. Gurfinkel, and M. Chechik. Symbolic optimization with SMT solvers. In POPL, 2014. Google Scholar
Digital Library
- A. Massalin. Superoptimizer: A look at the smallest program. In ASPLOS, 1987. Google Scholar
Digital Library
- A. K. Menon, O. Tamuz, S. Gulwani, and A. T. Kalai. A machine learning framework for programming by example. In ICML, 2013.Google Scholar
- L. A. Meyerovich. Parallel Layout Engines: Synthesis and Optimization of Tree Traversals. PhD thesis, University of California, Berkeley, 2013.Google Scholar
- L. A. Meyerovich, M. E. Torok, E. Atkinson, and R. Bodik. Parallel schedule synthesis for attribute grammars. In PPoPP, 2013. Google Scholar
Digital Library
- 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.Google Scholar
Cross Ref
- V. Nair and G. E. Hinton. Rectified linear units improve restricted Boltzmann machines. In ICML, 2010.Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- O. Polozov and S. Gulwani. FlashMeta: A framework for inductive program synthesis. In OOPSLA, 2015. Google Scholar
Digital Library
- J. D. Ramsdell. An operational semantics for Scheme. SIGPLAN Lisp Pointers, V(2):6–10, 1992. Google Scholar
Digital Library
- A. Reynolds, M. Deters, V. Kuncak, C. Tinelli, and C. Barrett. Counterexample-guided quantifier instantiation for synthesis in SMT. In CAV, 2015.Google Scholar
- E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, 2013. Google Scholar
Digital Library
- R. Sebastiani and S. Tomasi. Optimization in SMT with LA(Q) cost functions. In IJCAR, 2012. Google Scholar
Digital Library
- J. E. Smith. Characterizing computer performance with a single number. Commun. ACM, 31(10), Oct. 1988. Google Scholar
Digital Library
- A. Solar-Lezama. Program synthesis by sketching. PhD thesis, University of California, Berkeley, 2008. Google Scholar
Digital Library
- A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Combinatorial sketching for finite programs. In ASPLOS, 2006. Google Scholar
Digital Library
- A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Sketching stencils. In PLDI, 2007. Google Scholar
Digital Library
- V. Srinivasan and T. Reps. Synthesis of machine code from semantics. In PLDI, 2015. Google Scholar
Digital Library
- M. Szudzik. An elegant pairing function. In NKS, 2006.Google Scholar
- E. Torlak and R. Bodik. Growing solver-aided languages with Rosette. In Onward!, 2013. Google Scholar
Digital Library
- E. Torlak and R. Bodik. A lightweight symbolic virtual machine for solver-aided host languages. In PLDI, 2014. Google Scholar
Digital Library
- E. Torlak and D. Jackson. Kodkod: A relational model finder. In TACAS, 2007. Google Scholar
Digital Library
- 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. Google Scholar
Digital Library
- 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 ConclusionGoogle Scholar
Recommendations
Optimizing synthesis with metasketches
POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming LanguagesMany 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 ...
Can reactive synthesis and syntax-guided synthesis be friends?
PLDI 2022: Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and ImplementationWhile reactive synthesis and syntax-guided synthesis (SyGuS) have seen enormous progress in recent years, combining the two approaches has remained a challenge. In this work, we present the synthesis of reactive programs from Temporal Stream Logic ...
Can reactive synthesis and syntax-guided synthesis be friends?
SPLASH Companion 2021: Companion Proceedings of the 2021 ACM SIGPLAN International Conference on Systems, Programming, Languages, and Applications: Software for HumanityWhile reactive synthesis and syntax-guided synthesis (SyGuS) have seen enormous progress in recent years, combining the two approaches has remained a challenge. In this work, we present the synthesis of reactive programs from Temporal Stream Logic ...






Comments