Type-and-example-directed program synthesis

This paper presents an algorithm for synthesizing recursive functions that process algebraic datatypes. It is founded on proof-theoretic techniques that exploit both type information and input–output examples to prune the search space. The algorithm uses refinement trees, a data structure that succinctly represents constraints on the shape of generated code. We evaluate the algorithm by using a prototype implementation to synthesize more than 40 benchmarks and several non-trivial larger examples. Our results demonstrate that the approach meets or outperforms the state-of-the-art for this domain, in terms of synthesis time or attainable size of the generated programs.

[1]  Sumit Gulwani,et al.  Test-driven synthesis , 2014, PLDI.

[2]  Emina Torlak,et al.  A lightweight symbolic virtual machine for solver-aided host languages , 2014, PLDI.

[3]  Adam Chlipala,et al.  Certified Programming with Dependent Types - A Pragmatic Introduction to the Coq Proof Assistant , 2013 .

[4]  Viktor Kuncak,et al.  Synthesis modulo recursive functions , 2013, OOPSLA.

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

[6]  Sumit Gulwani,et al.  Recursive Program Synthesis , 2013, CAV.

[7]  Ruzica Piskac,et al.  Complete completion using types and weights , 2013, PLDI.

[8]  Rajeev Alur,et al.  TRANSIT: specifying protocols with concolic snippets , 2013, PLDI.

[9]  Pierre Lescanne,et al.  Counting and generating lambda terms , 2012, Journal of Functional Programming.

[10]  Sumit Gulwani,et al.  Type-directed completion of partial expressions , 2012, PLDI.

[11]  Susumu Katayama An analytical inductive functional programming system that avoids unintended programs , 2012, PEPM '12.

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

[13]  Emanuel Kitzelmann,et al.  A Combined Analytical and Search-Based Approach for the Inductive Synthesis of Functional Programs , 2011, KI - Künstliche Intelligenz.

[14]  Cesare Tinelli,et al.  Satisfiability Modulo Theories , 2021, Handbook of Satisfiability.

[15]  Armando Solar-Lezama,et al.  Program synthesis by sketching , 2008 .

[16]  U. Norell,et al.  Towards a practical programming language based on dependent type theory , 2007 .

[17]  Rastislav Bodík,et al.  Jungloid mining: helping to navigate the API jungle , 2005, PLDI '05.

[18]  Christine Paulin-Mohring,et al.  The coq proof assistant reference manual , 2000 .

[19]  Benjamin C. Pierce,et al.  Local type inference , 1998, POPL '98.

[20]  Hugo Herbelin,et al.  The Coq proof assistant : reference manual, version 6.1 , 1997 .

[21]  Zohar Manna,et al.  A Deductive Approach to Program Synthesis , 1979, TOPL.

[22]  N. Belnap,et al.  Entailment. The Logic of Relevance and Necessity. Volume I , 1978 .

[23]  P. T. Geach,et al.  Entailment: The Logic of Relevance and Necessity , Vol. i By Alan Ross Anderson and Nuel D. Belnap Jr Princeton University Press, 1976, xxxii + 542 pp., £13.70 , 1977, Philosophy.

[24]  Phillip D. Summers,et al.  A Methodology for LISP Program Construction from Examples , 1977, J. ACM.

[25]  Nuel D. Belnap,et al.  Entailment : the logic of relevance and necessity , 1975 .

[26]  C. Cordell Green,et al.  Application of Theorem Proving to Problem Solving , 1969, IJCAI.

[27]  G. Gentzen Untersuchungen über das logische Schließen. I , 1935 .

[28]  G. Gentzen Untersuchungen über das logische Schließen. II , 1935 .