Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article
Open access

FrAngel: component-based synthesis with control structures

Published: 02 January 2019 Publication History

Abstract

In component-based program synthesis, the synthesizer generates a program given a library of components (functions). Existing component-based synthesizers have difficulty synthesizing loops and other control structures, and they often require formal specifications of the components, which can be expensive to generate. We present FrAngel, a new approach to component-based synthesis that can synthesize short Java functions with control structures when given a desired signature, a set of input-output examples, and a collection of libraries (without formal specifications). FrAngel aims to discover programs with many distinct behaviors by combining two main ideas. First, it mines code fragments from partially-successful programs that only pass some of the examples. These extracted fragments are often useful for synthesis due to a property that we call special-case similarity. Second, FrAngel uses angelic conditions as placeholders for control structure conditions and optimistically evaluates the resulting program sketches. Angelic conditions decompose the synthesis process: FrAngel first finds promising partial programs and later fills in their missing conditions. We demonstrate that FrAngel can synthesize a variety of interesting programs with combinations of control structures within seconds, significantly outperforming prior state-of-the-art.

Supplementary Material

WEBM File (a73-shi.webm)

References

[1]
Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. 2017. Scaling Enumerative Program Synthesis via Divide and Conquer. In Tools and Algorithms for the Construction and Analysis of Systems (TACAS).
[2]
Matej Balog, Alexander L Gaunt, Marc Brockschmidt, Sebastian Nowozin, and Daniel Tarlow. 2017. DeepCoder: Learning to Write Programs. In International Conference on Learning Representations (ICLR).
[3]
Yoah Bar-David and Gadi Taubenfeld. 2003. Automatic Discovery of Mutual Exclusion Algorithms. In International Symposium on Distributed Computing (DISC) .
[4]
Gilles Barthe, Juan Manuel Crespo, Sumit Gulwani, Cesar Kunz, and Mark Marron. 2013. From Relational Verification to SIMDLoop Synthesis. In Principles and Practice of Parallel Programming (PPoPP).
[5]
Rastislav Bodík, Satish Chandra, Joel Galenson, Doug Kimelman, Nicholas Tung, Shaon Barman, and Casey Rodarmor. 2010. Programming with Angelic Nondeterminism. In Principles of Programming Languages (POPL).
[6]
Jacob Devlin, Jonathan Uesato, Surya Bhupatiraju, Rishabh Singh, Abdel-rahman Mohamed, and Pushmeet Kohli. 2017. RobustFill: Neural Program Learning under Noisy I/O. In International Conference on Machine Learning (ICML).
[7]
Yu Feng, Ruben Martins, Jacob Van Geffen, Isil Dillig, and Swarat Chaudhuri. 2017a. Component-Based Synthesis of Table Consolidation and Transformation Tasks from Examples. In Programming Language Design and Implementation (PLDI).
[8]
Yu Feng, Ruben Martins, Yuepeng Wang, Isil Dillig, and Thomas W. Reps. 2017b. Component-Based Synthesis for Complex APIs. In Principles of Programming Languages (POPL).
[9]
John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing Data Structure Transformations from Input-Output Examples. In Programming Language Design and Implementation (PLDI).
[10]
Joel Galenson, Philip Reames, Rastislav Bodík, Björn Hartmann, and Koushik Sen. 2014. Codehint: Dynamic and Interactive Synthesis of Code Snippets. In International Conference on Software Engineering (ICSE).
[11]
Sumit Gulwani. 2011. Automating String Processing in Spreadsheets Using Input-Output Examples. In Principles of Programming Languages (POPL) .
[12]
Sumit Gulwani, Susmit Jha, Ashish Tiwari, and Ramarathnam Venkatesan. 2011a. Synthesis of Loop-Free Programs. In Programming Language Design and Implementation (PLDI) .
[13]
Sumit Gulwani, Vijay Anand Korthikanti, and Ashish Tiwari. 2011b. Synthesizing Geometry Constructions. In Programming Language Design and Implementation (PLDI) .
[14]
Tihomir Gvero, Viktor Kuncak, Ivan Kuraj, and Ruzica Piskac. 2013. Complete Completion Using Types and Weights. In Programming Language Design and Implementation (PLDI) .
[15]
Tihomir Gvero, Viktor Kuncak, and Ruzica Piskac. 2011. Interactive Synthesis of Code Snippets. In Computer Aided Verification (CAV) .
[16]
Theodore E Harris. 2002. The Theory of Branching Processes. Courier Corporation.
[17]
William R. Harris and Sumit Gulwani. 2011. Spreadsheet Table Transformations from Examples. In Programming Language Design and Implementation (PLDI) .
[18]
Stefan Heule, Eric Schkufza, Rahul Sharma, and Alex Aiken. 2016. Stratified Synthesis: Automatically Learning the x86-64 Instruction Set. In Programming Language Design and Implementation (PLDI).
[19]
Stefan Heule, Manu Sridharan, and Satish Chandra. 2015. Mimic: Computing Models for Opaque Code. In Foundations of Software Engineering (FSE) .
[20]
Susmit Jha, Sumit Gulwani, Sanjit A Seshia, and Ashish Tiwari. 2010. Oracle-Guided Component-Based Program Synthesis. In International Conference on Software Engineering (ICSE).
[21]
Susumu Katayama. 2005. Systematic Search for Lambda Expressions. Trends in Functional Programming 6 (2005), 111–126.
[22]
Tessa A Lau, Pedro M Domingos, and Daniel S Weld. 2000. Version Space Algebra and its Application to Programming by Demonstration. In International Conference on Machine Learning (ICML).
[23]
Chris Maddison and Daniel Tarlow. 2014. Structured Generative Models of Natural Source Code. In International Conference on Machine Learning (ICML) .
[24]
David Mandelin, Lin Xu, Rastislav Bodík, and Doug Kimelman. 2005. Jungloid Mining: Helping to Navigate the APIJungle. In Programming Language Design and Implementation (PLDI).
[25]
Aditya Krishna Menon, Omer Tamuz, Sumit Gulwani, Butler Lampson, and Adam Tauman Kalai. 2013. A Machine Learning Framework for Programming by Example. In International Conference on Machine Learning (ICML).
[26]
Peter-Michael Osera and Steve Zdancewic. 2015. Type-and-Example-Directed Program Synthesis. In Programming Language Design and Implementation (PLDI) .
[27]
Daniel Perelman, Sumit Gulwani, Dan Grossman, and Peter Provost. 2014. Test-Driven Synthesis. In Programming Language Design and Implementation (PLDI) .
[28]
Dawei Qi, William N. Sumner, Feng Qin, Mai Zheng, Xiangyu Zhang, and Abhik Roychoudhury. 2012. Modeling Software Execution Environment. In Working Conference on Reverse Engineering (WCRE).
[29]
Veselin Raychev, Martin Vechev, and Eran Yahav. 2014. Code Completion with Statistical Language Models. In Programming Language Design and Implementation (PLDI) .
[30]
Eric Schkufza, Rahul Sharma, and Alex Aiken. 2016. Stochastic Program Optimization. Commun. ACM 59, 2 (2016), 114–122.
[31]
Kensen Shi, Jacob Steinhardt, and Percy Liang. 2018. FrAngel Source Code and Experimental Results. https://www.github. com/kensens/FrAngel .
[32]
Armando Solar-Lezama. 2008. Program Synthesis by Sketching. Ph.D. Dissertation. University of California, Berkeley.
[33]
Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. 2010. From Program Verification to Program Synthesis. In Principles of Programming Languages (POPL) .
[34]
Westley Weimer, ThanhVu Nguyen, Claire Le Goues, and Stephanie Forrest. 2009. Automatically Finding Patches Using Genetic Programming. In International Conference on Software Engineering (ICSE).
[35]
Navid Yaghmazadeh, Christian Klinger, Isil Dillig, and Swarat Chaudhuri. 2016. Synthesizing Transformations on Hierarchically Structured Data. In Programming Language Design and Implementation (PLDI).

Cited By

View all
  • (2024)JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language ModelsProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695470(870-882)Online publication date: 27-Oct-2024
  • (2024)Hydra: Generalizing Peephole Optimizations with Program SynthesisProceedings of the ACM on Programming Languages10.1145/36498378:OOPSLA1(725-753)Online publication date: 29-Apr-2024
  • (2024)Semantic Code Refactoring for Abstract Data TypesProceedings of the ACM on Programming Languages10.1145/36328708:POPL(816-847)Online publication date: 5-Jan-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 3, Issue POPL
January 2019
2275 pages
EISSN:2475-1421
DOI:10.1145/3302515
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 02 January 2019
Published in PACMPL Volume 3, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. angelic execution
  2. component-based synthesis
  3. control structures
  4. program synthesis

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)243
  • Downloads (Last 6 weeks)44
Reflects downloads up to 12 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2024)JavaBench: A Benchmark of Object-Oriented Code Generation for Evaluating Large Language ModelsProceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering10.1145/3691620.3695470(870-882)Online publication date: 27-Oct-2024
  • (2024)Hydra: Generalizing Peephole Optimizations with Program SynthesisProceedings of the ACM on Programming Languages10.1145/36498378:OOPSLA1(725-753)Online publication date: 29-Apr-2024
  • (2024)Semantic Code Refactoring for Abstract Data TypesProceedings of the ACM on Programming Languages10.1145/36328708:POPL(816-847)Online publication date: 5-Jan-2024
  • (2024)Programming-by-Demonstration for Long-Horizon Robot TasksProceedings of the ACM on Programming Languages10.1145/36328608:POPL(512-545)Online publication date: 5-Jan-2024
  • (2023)LAMBDABEAMProceedings of the 37th International Conference on Neural Information Processing Systems10.5555/3666122.3668356(51327-51346)Online publication date: 10-Dec-2023
  • (2023)Trace-Guided Inductive Synthesis of Recursive Functional ProgramsProceedings of the ACM on Programming Languages10.1145/35912557:PLDI(860-883)Online publication date: 6-Jun-2023
  • (2023)Survey of intelligent program synthesis techniquesInternational Conference on Algorithms, High Performance Computing, and Artificial Intelligence (AHPCAI 2023)10.1117/12.3011627(119)Online publication date: 7-Dec-2023
  • (2022)Specification-guided component-based synthesis from effectful librariesProceedings of the ACM on Programming Languages10.1145/35633106:OOPSLA2(616-645)Online publication date: 31-Oct-2022
  • (2022)WebRobot: web robotic process automation using interactive programming-by-demonstrationProceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation10.1145/3519939.3523711(152-167)Online publication date: 9-Jun-2022
  • (2022)TF-Coder: Program Synthesis for Tensor ManipulationsACM Transactions on Programming Languages and Systems10.1145/351703444:2(1-36)Online publication date: 27-May-2022
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media