skip to main content

Inductive Synthesis of Structurally Recursive Functional Programs from Non-recursive Expressions

Published:11 January 2023Publication History
Skip Abstract Section

Abstract

We present a novel approach to synthesizing recursive functional programs from input-output examples. Synthesizing a recursive function is challenging because recursive subexpressions should be constructed while the target function has not been fully defined yet. We address this challenge by using a new technique we call block-based pruning. A block refers to a recursion- and conditional-free expression (i.e., straight-line code) that yields an output from a particular input. We first synthesize as many blocks as possible for each input-output example, and then we explore the space of recursive programs, pruning candidates that are inconsistent with the blocks. Our method is based on an efficient version space learning, thereby effectively dealing with a possibly enormous number of blocks. In addition, we present a method that uses sampled input-output behaviors of library functions to enable a goal-directed search for a recursive program using the library. We have implemented our approach in a system called Trio and evaluated it on synthesis tasks from prior work and on new tasks. Our experiments show that Trio outperforms prior work by synthesizing a solution to 98% of the benchmarks in our benchmark suite.

Skip Supplemental Material Section

Supplemental Material

References

  1. Aws Albarghouthi, Sumit Gulwani, and Zachary Kincaid. 2013. Recursive Program Synthesis. In Proceedings of the 25th International Conference on Computer Aided Verification (CAV’13). isbn:978-3-642-39798-1 Google ScholarGoogle ScholarCross RefCross Ref
  2. Shingo Eguchi, Naoki Kobayashi, and Takeshi Tsukada. 2018. Automated Synthesis of Functional Programs with Auxiliary Functions. In Programming Languages and Systems - 16th Asian Symposium, APLAS 2018, Wellington, New Zealand, December 2-6, 2018, Proceedings, Sukyoung Ryu (Ed.) (Lecture Notes in Computer Science, Vol. 11275). Springer, 223–241. https://doi.org/10.1007/978-3-030-02768-1_13 Google ScholarGoogle ScholarCross RefCross Ref
  3. Kevin Ellis, Catherine Wong, Maxwell Nye, Mathias Sablé-Meyer, Lucas Morales, Luke Hewitt, Luc Cary, Armando Solar-Lezama, and Joshua B. Tenenbaum. 2021. DreamCoder: Bootstrapping Inductive Program Synthesis with Wake-Sleep Library Learning. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI 2021). Association for Computing Machinery, New York, NY, USA. 835–850. isbn:9781450383912 https://doi.org/10.1145/3453483.3454080 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Azadeh Farzan and Victor Nicolet. 2021. Counterexample-Guided Partial Bounding for Recursive Function Synthesis. In Computer Aided Verification - 33rd International Conference, CAV 2021, Virtual Event, July 20-23, 2021, Proceedings, Part I, Alexandra Silva and K. Rustan M. Leino (Eds.) (Lecture Notes in Computer Science, Vol. 12759). Springer, 832–855. https://doi.org/10.1007/978-3-030-81685-8_39 Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing Data Structure Transformations from Input-Output Examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI’15). Association for Computing Machinery, New York, NY, USA. 229–239. isbn:9781450334686 https://doi.org/10.1145/2737924.2737977 Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Jonathan Frankle, Peter-Michael Osera, David Walker, and Steve Zdancewic. 2016. Example-Directed Synthesis: A Type-Theoretic Interpretation. In Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’16). Association for Computing Machinery, New York, NY, USA. 802–815. isbn:9781450335492 https://doi.org/10.1145/2837614.2837629 Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Sumit Gulwani. 2011. Automating String Processing in Spreadsheets Using Input-output Examples. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’11). isbn:978-1-4503-0490-0 Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Sumit Gulwani, Alex Polozov, and Rishabh Singh. 2017. Program Synthesis. 4, NOW. https://www.microsoft.com/en-us/research/publication/program-synthesis/ Google ScholarGoogle Scholar
  9. Shachar Itzhaky, Hila Peleg, Nadia Polikarpova, Reuben N. S. Rowe, and Ilya Sergey. 2021. Cyclic Program Synthesis. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI 2021). Association for Computing Machinery, New York, NY, USA. 944–959. isbn:9781450383912 https://doi.org/10.1145/3453483.3454087 Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Dileep Kini and Sumit Gulwani. 2015. FlashNormalize: Programming by Examples for Text Normalization. In Proceedings of the 24th International Conference on Artificial Intelligence (IJCAI’15). AAAI Press, 776–783. isbn:9781577357384 Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Emanuel Kitzelmann and Ute Schmid. 2006. Inductive Synthesis of Functional Programs: An Explanation Based Generalization Approach. Journal of Machine Learning Research, 7, 15 (2006), 429–454. http://jmlr.org/papers/v7/kitzelmann06a.html Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Etienne Kneuss, Ivan Kuraj, Viktor Kuncak, and Philippe Suter. 2013. Synthesis modulo Recursive Functions. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA ’13). Association for Computing Machinery, New York, NY, USA. 407–426. isbn:9781450323741 https://doi.org/10.1145/2509136.2509555 Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Vu Le and Sumit Gulwani. 2014. FlashExtract: A Framework for Data Extraction by Examples. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). isbn:978-1-4503-2784-8 Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Woosuk Lee. 2021. Combining the top-down propagation and bottom-up enumeration for inductive program synthesis. Proceedings of the ACM on Programming Languages, 5, POPL (2021), 1–28. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Woosuk Lee and Hangyeol Cho. 2022. Artifact of Inductive Synthesis of Structurally Recursive Functional Programs from Non-Recursive Expressions. https://doi.org/10.5281/zenodo.7320806 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Justin Lubin, Nick Collins, Cyrus Omar, and Ravi Chugh. 2020. Program sketching with live bidirectional evaluation. Proceedings of the ACM on Programming Languages, 4, ICFP (2020), 1–29. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Anders Miltner, Adrian Trejo Nuñez, Ana Brendel, Swarat Chaudhuri, and Isil Dillig. 2022. Bottom-up Synthesis of Recursive Functional Programs Using Angelic Execution. Proc. ACM Program. Lang., 6, POPL (2022), Article 21, jan, 29 pages. https://doi.org/10.1145/3498682 Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Peter-Michael Osera. 2015. Program Synthesis With Types. 01. Google ScholarGoogle Scholar
  19. Peter-Michael Osera and Steve Zdancewic. 2015. Type-and-example-directed program synthesis. ACM SIGPLAN Notices, 50, 6 (2015), 619–630. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. 2016. Program Synthesis from Polymorphic Refinement Types. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’16). Association for Computing Machinery, New York, NY, USA. 522–538. isbn:9781450342612 https://doi.org/10.1145/2908080.2908093 Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Oleksandr Polozov and Sumit Gulwani. 2015. FlashMeta: A Framework for Inductive Program Synthesis. In Proceedings of the 2015 ACM SIGPLAN International Conference on Object-Oriented Programming, Systems, Languages, and Applications (OOPSLA 2015). Association for Computing Machinery, New York, NY, USA. 107–126. isbn:9781450336895 https://doi.org/10.1145/2814270.2814310 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Reudismam Rolim, Gustavo Soares, Loris D’Antoni, Oleksandr Polozov, Sumit Gulwani, Rohit Gheyi, Ryo Suzuki, and Björn Hartmann. 2017. Learning Syntactic Program Transformations from Examples. In Proceedings of the 39th International Conference on Software Engineering (ICSE’17). IEEE Press, 404–415. isbn:9781538638682 https://doi.org/10.1109/ICSE.2017.44 Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Phillip D. Summers. 1986. A Methodology for LISP Program Construction from Examples. In Readings in Artificial Intelligence and Software Engineering, Charles Rich and Richard C. Waters (Eds.). Morgan Kaufmann, 309–316. isbn:978-0-934613-12-5 https://doi.org/10.1016/B978-0-934613-12-5.50028-8 Google ScholarGoogle ScholarCross RefCross Ref
  24. Xinyu Wang, Isil Dillig, and Rishabh Singh. 2017. Program Synthesis Using Abstraction Refinement. Proc. ACM Program. Lang., 2, POPL (2017), Article 63, Dec., 30 pages. https://doi.org/10.1145/3158151 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Inductive Synthesis of Structurally Recursive Functional Programs from Non-recursive Expressions

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!