Syntax-Guided Synthesis with Quantitative Syntactic Objectives

Automatic program synthesis promises to increase the productivity of programmers and end-users of computing devices by automating tedious and error-prone tasks. Despite the practical successes of program synthesis, we still do not have systematic frameworks to synthesize programs that are “good” according to certain metrics—e.g., produce programs of reasonable sizes or with good runtime—and to understand when synthesis can result in such good programs. In this paper, we propose QSyGuS, a unifying framework for describing syntax-guided synthesis problems with quantitative objectives over the syntax of the synthesized programs. QSyGuS builds on weighted (tree) grammars, a clean and foundational formalism that provides flexible support for different quantitative objectives, useful closure properties, and practical decision procedures. We then present an algorithm for solving QSyGuS. Our algorithm leverages closure properties of weighted grammars to generate intermediate problems that can be solved using non-quantitative SyGuS solvers. Finally, we implement our algorithm in a tool, QuaSi, and evaluate it on 26 quantitative extensions of existing SyGuS benchmarks. QuaSi can synthesize optimal solutions in 15/26 benchmarks with times comparable to those needed to find an arbitrary solution.

[1]  Matt Fredrikson,et al.  J an 2 01 8 Verifying and Synthesizing Constant-Resource Implementations with Types , 2018 .

[2]  Arjun Radhakrishna,et al.  Scaling Enumerative Program Synthesis via Divide and Conquer , 2017, TACAS.

[3]  Alexander Aiken,et al.  Stochastic program optimization , 2016, Commun. ACM.

[4]  Manfred Droste,et al.  Weighted tree automata and weighted logics , 2006, Theor. Comput. Sci..

[5]  Sumit Gulwani,et al.  Automating string processing in spreadsheets using input-output examples , 2011, POPL '11.

[6]  Loris D'Antoni,et al.  Automatic program inversion using symbolic transducers , 2017, PLDI.

[7]  M. Droste,et al.  Handbook of Weighted Automata , 2009 .

[8]  Sumit Gulwani,et al.  FlashMeta: a framework for inductive program synthesis , 2015, OOPSLA.

[9]  Viktor Kuncak,et al.  On Repair with Probabilistic Attribute Grammars , 2017, ArXiv.

[10]  Sumit Gulwani,et al.  Programming by examples: applications, algorithms, and ambiguity resolution , 2016, IJCAR.

[11]  Rajeev Alur,et al.  Results and Analysis of SyGuS-Comp'15 , 2015, SYNT.

[12]  Emina Torlak,et al.  Optimizing synthesis with metasketches , 2016, POPL.

[13]  Rajeev Alur,et al.  Syntax-guided synthesis , 2013, FMCAD 2013.

[14]  Rajeev Alur,et al.  SyGuS-Comp 2016: Results and Analysis , 2016, SYNT@CAV.

[15]  Rajeev Alur,et al.  Syntax-guided synthesis , 2013, 2013 Formal Methods in Computer-Aided Design.

[16]  Sanjit A. Seshia,et al.  What's Decidable about Syntax-Guided Synthesis? , 2015, ArXiv.

[17]  Sumit Gulwani,et al.  Predicting a Correct Program in Programming by Example , 2015, CAV.

[18]  Sumit Gulwani,et al.  Automated feedback generation for introductory programming assignments , 2012, PLDI.