Abstract
We present a method for example-guided synthesis of functional programs over recursive data structures. Given a set of input-output examples, our method synthesizes a program in a functional language with higher-order combinators like map and fold. The synthesized program is guaranteed to be the simplest program in the language to fit the examples. Our approach combines three technical ideas: inductive generalization, deduction, and enumerative search. First, we generalize the input-output examples into hypotheses about the structure of the target program. For each hypothesis, we use deduction to infer new input/output examples for the missing subexpressions. This leads to a new subproblem where the goal is to synthesize expressions within each hypothesis. Since not every hypothesis can be realized into a program that fits the examples, we use a combination of best-first enumeration and deduction to search for a hypothesis that meets our needs. We have implemented our method in a tool called λ2, and we evaluate this tool on a large set of synthesis problems involving lists, trees, and nested data structures. The experiments demonstrate the scalability and broad scope of λ2. A highlight is the synthesis of a program believed to be the world's earliest functional pearl.
- A. Albarghouthi, S. Gulwani, and Z. Kincaid. Recursive program synthesis. In CAV, pages 934–950, 2013. Google Scholar
Digital Library
- R. Alur, R. Bod´ık, G. Juniwal, M. M. K. Martin, M. Raghothaman, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-guided synthesis. In FMCAD, 2013.Google Scholar
Cross Ref
- D. W. Barron and C. Strachey. Programming. Advances in Programming and Non-Numerical Computation, pages 49–82, 1966.Google Scholar
Cross Ref
- T. A. Beyene, S. Chaudhuri, C. Popeea, and A. Rybalchenko. A constraint-based approach to solving games on infinite graphs. In POPL, pages 221–234, 2014. Google Scholar
Digital Library
- R. Bloem, K. Chatterjee, T. A. Henzinger, and B. Jobstmann. Better quality in synthesis through quantitative objectives. In Computer Aided Verification, pages 140–156, 2009. Google Scholar
Digital Library
- S. Chaudhuri, M. Clochard, and A. Solar-Lezama. Bridging boolean and quantitative synthesis using smoothed proof search. In POPL, pages 207–220, 2014. Google Scholar
Digital Library
- O. Danvy and M. Spivey. On Barron and Strachey’s cartesian product function. In ICFP, pages 41–46, 2007. Google Scholar
Digital Library
- T. Dillig, I. Dillig, and S. Chaudhuri. Optimal guard synthesis for memory safety. 2014.Google Scholar
Digital Library
- P. Garg, C. Löding, P. Madhusudan, and D. Neider. ICE: A robust framework for learning invariants. In CAV, pages 69–87, 2014. Google Scholar
Digital Library
- S. Gulwani. Dimensions in program synthesis. In FMCAD, 2010. Google Scholar
Digital Library
- S. Gulwani. Automating string processing in spreadsheets using inputoutput examples. In POPL, pages 317–330. ACM, 2011. Google Scholar
Digital Library
- T. Gvero, V. Kuncak, I. Kuraj, and R. Piskac. Complete completion using types and weights. In PLDI, volume 48, pages 27–38. ACM, 2013. Google Scholar
Digital Library
- W. R. Harris and S. Gulwani. Spreadsheet table transformations from examples. In PLDI, pages 317–328. ACM, 2011. Google Scholar
Digital Library
- S. Katayama. Efficient exhaustive generation of functional programs using monte-carlo search with iterative deepening. In Trends in Artificial Intelligence, 10th Pacific Rim International Conference on Artificial Intelligence., pages 199–210, 2008. Google Scholar
Digital Library
- E. Kitzelmann. Inductive programming: A survey of program synthesis techniques. In Approaches and Applications of Inductive Programming, Third International Workshop, pages 50–73, 2009.Google Scholar
- E. Kitzelmann. Analytical inductive functional programming. In Logic-Based Program Synthesis and Transformation, pages 87–102. Springer, 2009. Google Scholar
Digital Library
- E. Kitzelmann. A combined analytical and search-based approach for the inductive synthesis of functional programs. KI-Künstliche Intelligenz, 25(2):179–182, 2011.Google Scholar
Cross Ref
- E. Kitzelmann and U. Schmid. Inductive synthesis of functional programs: An explanation based generalization approach. Journal of Machine Learning Research, 7:429–454, 2006. Google Scholar
Digital Library
- V. Kuncak, M. Mayer, R. Piskac, and P. Suter. Complete functional synthesis. In PLDI, pages 316–329, 2010. Google Scholar
Digital Library
- N. Lavrac and S. Dzeroski. Inductive logic programming. In WLP, pages 146–160. Springer, 1994.Google Scholar
- V. Le and S. Gulwani. Flashextract: A framework for data extraction by examples. In PLDI, pages 542–553, 2014. Google Scholar
Digital Library
- H. Lieberman. Your wish is my command: Programming by example. Morgan Kaufmann, 2001.Google Scholar
Digital Library
- D. Mandelin, L. Xu, R. Bod´ık, and D. Kimelman. Jungloid mining: helping to navigate the API jungle. In PLDI, pages 48–61, 2005. Google Scholar
Digital Library
- A. Menon, O. Tamuz, S. Gulwani, B. Lampson, and A. Kalai. A machine learning framework for programming by example. In ICML, pages 187–195, 2013.Google Scholar
- R. Olsson. Inductive functional programming using incremental program transformation. Artif. Intell., 74(1):55–8, 1995. Google Scholar
Digital Library
- D. Perelman, S. Gulwani, T. Ball, and D. Grossman. Type-directed completion of partial expressions. In PLDI, volume 47, pages 275– 286. ACM, 2012. Google Scholar
Digital Library
- D. Perelman, S. Gulwani, D. Grossman, and P. Provost. Test-driven synthesis. In PLDI, page 43, 2014. Google Scholar
Digital Library
- R. Sharma, S. Gupta, B. Hariharan, A. Aiken, P. Liang, and A. V. Nori. A data driven approach for algebraic loop invariants. In ESOP, pages 574–592, 2013. Google Scholar
Digital Library
- R. Singh and S. Gulwani. Synthesizing number transformations from input-output examples. In Computer Aided Verification, pages 634– 651. Springer, 2012. Google Scholar
Digital Library
- A. Solar-Lezama, L. Tancau, R. Bod´ık, S. A. Seshia, and V. A. Saraswat. Combinatorial sketching for finite programs. In ASPLOS, pages 404–415, 2006. Google Scholar
Digital Library
- S. Srivastava, S. Gulwani, and J. S. Foster. Template-based program verification and program synthesis. STTT, 15(5-6):497–518, 2013.Google Scholar
Digital Library
- M. T. Vechev, E. Yahav, and G. Yorsh. Abstraction-guided synthesis of synchronization. STTT, 15(5-6):413–431, 2013.Google Scholar
Digital Library
Index Terms
Synthesizing data structure transformations from input-output examples
Recommendations
FlashMeta: a framework for inductive program synthesis
OOPSLA 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and ApplicationsInductive synthesis, or programming-by-examples (PBE) is gaining prominence with disruptive applications for automating repetitive tasks in end-user programming. However, designing, developing, and maintaining an effective industrial-quality inductive ...
Synthesizing data structure transformations from input-output examples
PLDI '15: Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present a method for example-guided synthesis of functional programs over recursive data structures. Given a set of input-output examples, our method synthesizes a program in a functional language with higher-order combinators like map and fold. The ...
Synthesizing transformations on hierarchically structured data
PLDI '16This paper presents a new approach for synthesizing transformations on tree-structured data, such as Unix directories and XML documents. We consider a general abstraction for such data, called hierarchical data trees (HDTs) and present a novel example-...






Comments