Type Assisted Synthesis of Recursive Transformers on Algebraic Data Types

In this paper, we show how synthesis can help implement interesting functions involving pattern matching and algebraic data types. One of the novel aspects of this work is the combination of type inference and counterexample-guided inductive synthesis (CEGIS) in order to support very high-level notations for describing the space of possible implementations that the synthesizer should consider. The paper also describes a set of optimizations that significantly improve the performance and scalability of the system. The approach is evaluated on a set of case studies which most notably include synthesizing desugaring functions for lambda calculus that force the synthesizer to discover Church encodings for pairs and boolean operations, as well as a procedure to generate constraints for type inference.

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

[2]  Daniel Jackson,et al.  Finding bugs with a constraint solver , 2000, ISSTA '00.

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

[4]  L. D. Moura,et al.  The YICES SMT Solver , 2006 .

[5]  Viktor Kuncak,et al.  Decision procedures for algebraic data types with abstractions , 2010, POPL '10.

[6]  Ulf Norell,et al.  Dependently typed programming in Agda , 2009, TLDI '09.

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

[8]  David Walker,et al.  Types and full abstraction for polyadic pi-calculus , 2005, Inf. Comput..

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

[10]  Derek C. Oppen,et al.  Reasoning about recursively defined data structures , 1978, POPL.

[11]  Daniel Jackson,et al.  Checking Properties of Heap-Manipulating Procedures with a Constraint Solver , 2003, TACAS.

[12]  Niklas Sörensson,et al.  An Extensible SAT-solver , 2003, SAT.

[13]  Sumit Gulwani,et al.  Synthesis of loop-free programs , 2011, PLDI '11.

[14]  Peter-Michael Osera,et al.  Type-and-example-directed program synthesis , 2015, PLDI.

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

[16]  Akash Lal,et al.  DAG inlining: a decision procedure for reachability-modulo-theories in hierarchical programs , 2015, PLDI.

[17]  Emina Torlak,et al.  Growing solver-aided languages with rosette , 2013, Onward!.

[18]  Viktor Kuncak,et al.  Verifying and Synthesizing Software with Recursive Functions - (Invited Contribution) , 2014, ICALP.

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

[20]  Sanjit A. Seshia,et al.  Combinatorial sketching for finite programs , 2006, ASPLOS XII.

[21]  Henny B. Sipma,et al.  Verifying Balanced Trees , 2007, LFCS.

[22]  Armando Solar-Lezama,et al.  Adaptive Concretization for Parallel Program Synthesis , 2015, CAV.

[23]  Henny B. Sipma,et al.  Decision procedures for term algebras with integer constraints , 2006, Inf. Comput..

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

[25]  Frank Tip,et al.  Finding bugs efficiently with a SAT solver , 2007, ESEC-FSE '07.

[26]  Sumit Gulwani,et al.  Path-based inductive synthesis for program inversion , 2011, PLDI '11.

[27]  Sumit Gulwani,et al.  From program verification to program synthesis , 2010, POPL '10.

[28]  Viktor Kuncak,et al.  An overview of the Leon verification system: verification by translation to recursive functions , 2013, SCALA@ECOOP.

[29]  Ruzica Piskac,et al.  Complete functional synthesis , 2010, PLDI '10.

[30]  Isil Dillig,et al.  Synthesizing data structure transformations from input-output examples , 2015, PLDI.

[31]  Cesare Tinelli,et al.  An Abstract Decision Procedure for Satisfiability in the Theory of Recursive Data Types , 2007, PDPAR/PaUL@FLoC.

[32]  Srinivas Devadas,et al.  Lynx: A Programmatic SAT Solver for the RNA-Folding Problem , 2012, SAT.

[33]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.