Optimizing synthesis with metasketches
Authors:
Open Access
- 11 January 2016
- journal article
- research article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 51 (1) , 775-788
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.Keywords
Funding Information
- National Science Foundation (1064497)
- Defense Advanced Research Projects Agency (HR0011-15-1-0001)
This publication has 38 references indexed in Scilit:
- A lightweight symbolic virtual machine for solver-aided host languagesACM SIGPLAN Notices, 2014
- Spreadsheet data manipulation using examplesCommunications of the ACM, 2012
- Optimization in SMT with ${\mathcal LA}$ (ℚ) Cost Functions2012
- Satisfiability Modulo the Theory of Costs: Foundations and ApplicationsLecture Notes in Computer Science, 2010
- Z3: An Efficient SMT Solver2008
- Kodkod: A Relational Model Finder2007
- DenaliACM SIGPLAN Notices, 2002
- An operational semantics for SchemeACM SIGPLAN Lisp Pointers, 1992
- Characterizing computer performance with a single numberCommunications of the ACM, 1988
- Superoptimizer: a look at the smallest programACM SIGPLAN Notices, 1987