Counterexample-Guided Partial Bounding for Recursive Function Synthesis

Quantifier bounding is a standard approach in inductive program synthesis in dealing with unbounded domains. In this paper, we propose one such bounding method for the synthesis of recursive functions over recursive input data types. The synthesis problem is specified by an input reference (recursive) function and a recursion skeleton. The goal is to synthesize a recursive function equivalent to the input function whose recursion strategy is specified by the recursion skeleton. In this context, we illustrate that it is possible to selectively bound a subset of the (recursively typed) parameters, each by a suitable bound. The choices are guided by counterexamples. The evaluation of our strategy on a broad set of benchmarks shows that it succeeds in efficiently synthesizing non-trivial recursive functions where standard across-the-board bounding would fail.

[1]  Sanjit A. Seshia,et al.  Sketching stencils , 2007, PLDI '07.

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

[3]  Ute Schmid,et al.  Inductive Synthesis of Functional Programs: An Explanation Based Generalization Approach , 2006, J. Mach. Learn. Res..

[4]  Naoki Kobayashi Types and higher-order recursion schemes for verification of higher-order programs , 2009, POPL '09.

[5]  Naoki Kobayashi,et al.  Predicate abstraction and CEGAR for higher-order model checking , 2011, PLDI '11.

[6]  Akimasa Morihata,et al.  Automatic Parallelization of Recursive Functions Using Quantifier Elimination , 2010, FLOPS.

[7]  Grigory Fedyukovich,et al.  Lemma Synthesis for Automating Induction over Algebraic Data Types , 2019, CP.

[8]  Armando Solar-Lezama,et al.  Sketching concurrent data structures , 2008, PLDI '08.

[9]  Armando Solar-Lezama,et al.  Deriving divide-and-conquer dynamic programming algorithms using solver-aided transformations , 2016, OOPSLA.

[10]  Magnus O. Myreen,et al.  Automatically Introducing Tail Recursion in CakeML , 2017, TFP.

[11]  Azadeh Farzan,et al.  Synthesis of divide and conquer parallelism for loops , 2017, PLDI.

[12]  Maaz Bin Safeer Ahmad,et al.  Automatically Leveraging MapReduce Frameworks for Data-Intensive Applications , 2018, SIGMOD Conference.

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

[14]  John Darlington,et al.  A Transformation System for Developing Recursive Programs , 1977, J. ACM.

[15]  Armando Solar-Lezama,et al.  Synthesis of Recursive ADT Transformations from Reusable Templates , 2015, TACAS.

[16]  Geoff W. Hamilton,et al.  Distillation with labelled transition systems , 2012, PEPM '12.

[17]  Maaz Bin Safeer Ahmad,et al.  Gradual synthesis for static parallelization of single-pass array-processing programs , 2017, PLDI.

[18]  C.-H. Luke Ong,et al.  Verifying higher-order functional programs with pattern-matching algebraic data types , 2011, POPL '11.

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

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

[21]  Naoki Kobayashi,et al.  Higher-order multi-parameter tree transducers and recursion schemes for program verification , 2010, POPL '10.

[22]  Christopher L. Conway,et al.  Cvc4 , 2011, CAV.

[23]  David Walker,et al.  Example-directed synthesis: a type-theoretic interpretation , 2016, POPL.

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

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

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

[27]  Viktor Kuncak,et al.  Counterexample-Guided Quantifier Instantiation for Synthesis in SMT , 2015, CAV.

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

[29]  Neil Immerman,et al.  Bounded Quantifier Instantiation for Checking Inductive Invariants , 2017, TACAS.

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

[31]  C.-H. Luke Ong,et al.  A type-directed abstraction refinement approach to higher-order model checking , 2014, POPL.

[32]  Akimasa Morihata,et al.  The third homomorphism theorem on trees: downward & upward lead to divide-and-conquer , 2009, POPL '09.

[33]  Armando Solar-Lezama,et al.  Program synthesis from polymorphic refinement types , 2015, PLDI.