skip to main content
research-article
Open access

Semantics-guided synthesis

Published: 04 January 2021 Publication History

Abstract

This paper develops a new framework for program synthesis, called semantics-guided synthesis (SemGuS), that allows a user to provide both the syntax and the semantics for the constructs in the language. SemGuS accepts a recursively defined big-step semantics, which allows it, for example, to be used to specify and solve synthesis problems over an imperative programming language that may contain loops with unbounded behavior. The customizable nature of SemGuS also allows synthesis problems to be defined over a non-standard semantics, such as an abstract semantics. In addition to the SemGuS framework, we develop an algorithm for solving SemGuS problems that is capable of both synthesizing programs and proving unrealizability, by encoding a SemGuS problem as a proof search over Constrained Horn Clauses: in particular, our approach is the first that we are aware of that can prove unrealizabilty for synthesis problems that involve imperative programs with unbounded loops, over an infinite syntactic search space. We implemented the technique in a tool called MESSY, and applied it to SyGuS problems (i.e., over expressions), synthesis problems over an imperative programming language, and synthesis problems over regular expressions.

References

[1]
Rajeev Alur, Rastislav Bodik, Garvit Juniwal, Milo MK Martin, Mukund Raghothaman, Sanjit A Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. 2013. Syntax-guided synthesis. In Formal Methods in Computer-Aided Design (FMCAD), 2013. IEEE, 1-8.
[2]
Rajeev Alur, Dana Fisman, Rishabh Singh, and Armando Solar-Lezama. 2017a. Sygus-comp 2017 : Results and analysis. arXiv preprint arXiv:1711.11438 ( 2017 ).
[3]
Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. 2017b. Scaling enumerative program synthesis via divide and conquer. In International Conference on Tools and Algorithms for the Construction and Analysis of Systems. Springer, 319-336.
[4]
Clark Barrett, Christopher L Conway, Morgan Deters, Liana Hadarean, Dejan Jovanović, Tim King, Andrew Reynolds, and Cesare Tinelli. 2011. Cvc4. In International Conference on Computer Aided Verification. Springer, 171-177.
[5]
Régis Blanc, Ashutosh Gupta, Laura Kovács, and Bernhard Kragl. 2013. Tree interpolation in vampire. In International Conference on Logic for Programming Artificial Intelligence and Reasoning. Springer, 173-181.
[6]
Edmund Clarke, Daniel Kroening, and Karen Yorav. 2003. Behavioral consistency of C and Verilog programs using bounded model checking. In Proceedings 2003. Design Automation Conference (IEEE Cat. No. 03CH37451). IEEE, 368-371.
[7]
Patrick Cousot and Radhia Cousot. 1992. Abstract interpretation frameworks. Journal of logic and computation 2, 4 ( 1992 ), 511-547.
[8]
Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An Eficient SMT Solver. In Proceedings of the Theory and Practice of Software, 14th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (Budapest, Hungary) ( TACAS'08/ETAPS'08). Springer-Verlag, Berlin, Heidelberg, 337-340. http://dl.acm.org/citation.cfm?id= 1792734. 1792766
[9]
John K Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing data structure transformations from input-output examples. ACM SIGPLAN Notices 50, 6 ( 2015 ), 229-239.
[10]
Sumit Gulwani. 2011. Automating string processing in spreadsheets using input-output examples. ACM Sigplan Notices 46, 1 ( 2011 ), 317-330.
[11]
Qinheping Hu, Jason Breck, John Cyphert, Loris D'Antoni, and Thomas Reps. 2019. Proving unrealizability for syntax-guided synthesis. In International Conference on Computer Aided Verification. Springer, 335-352.
[12]
Qinheping Hu, John Cyphert, Loris D'Antoni, and Thomas Reps. 2020. Exact and approximate methods for proving unrealizability of syntax-guided synthesis problems. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation. 1128-1142.
[13]
Qinheping Hu and Loris D'Antoni. 2018. Syntax-guided synthesis with quantitative syntactic objectives. In International Conference on Computer Aided Verification. Springer, 386-403.
[14]
S.C. Johnson. 1975. YACC: Yet Another Compiler-Compiler. Technical Report Comp. Sci. Tech. Rep. 32. Bell Laboratories.
[15]
Jinwoo Kim, Qinheping Hu, Loris D'Antoni, and Thomas Reps. 2020. Semantics-Guided Synthesis. arXiv preprint arXiv: 2008. 09836 ( 2020 ).
[16]
Anvesh Komuravelli, Arie Gurfinkel, and Sagar Chaki. 2016. SMT-based model checking for recursive programs. Formal Methods in System Design 48, 3 ( 2016 ), 175-205.
[17]
N. Lavrač and S. Džeroski. 1994. Inductive Logic Programming: Techniques and Applications. Ellis Horwood.
[18]
Mina Lee, Sunbeom So, and Hakjoo Oh. 2016. Synthesizing regular expressions from examples for introductory automata assignments. In Proceedings of the 2016 ACM SIGPLAN International Conference on Generative Programming: Concepts and Experiences. 70-80.
[19]
Kenneth L McMillan and Andrey Rybalchenko. 2013. Solving constrained Horn clauses using interpolation. Tech. Rep. MSR-TR-2013-6 ( 2013 ).
[20]
S. Muggleton. 1991. Inductive logic programming. New Generation Comp. 8, 4 ( 1991 ), 295-317.
[21]
Rong Pan, Qinheping Hu, Gaowei Xu, and Loris D'Antoni. 2019. Automatic repair of regular expressions. Proceedings of the ACM on Programming Languages 3, OOPSLA ( 2019 ), 1-29.
[22]
Phitchaya Mangpo Phothilimthana, Archibald Samuel Elliott, An Wang, Abhinav Jangda, Bastian Hagedorn, Henrik Barthels, Samuel J Kaufman, Vinod Grover, Emina Torlak, and Rastislav Bodik. 2019. Swizzle inventor: data movement synthesis for GPU kernels. In Proceedings of the Twenty-Fourth International Conference on Architectural Support for Programming Languages and Operating Systems. 65-78.
[23]
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. 107-126.
[24]
J.R. Quinlan. 1990. Learning logical definitions from Relations. Mach. Learn. 5 ( 1990 ), 239-266.
[25]
Andrew Reynolds, Haniel Barbosa, Andres Nötzli, Clark Barrett, and Cesare Tinelli. 2019. CVC4SY for SyGuS-COMP 2019. arXiv preprint arXiv: 1907. 10175 ( 2019 ).
[26]
Andrew Reynolds, Morgan Deters, Viktor Kuncak, Cesare Tinelli, and Clark Barrett. 2015. Counterexample-guided quantifier instantiation for synthesis in SMT. In International Conference on Computer Aided Verification. Springer, 198-216.
[27]
Sunbeom So and Hakjoo Oh. 2017. Synthesizing Imperative Programs from Examples Guided by Static Analysis. In Static Analysis-24th International Symposium, SAS 2017, New York, NY, USA, August 30-September 1, 2017, Proceedings. 364-381. https://doi.org/10.1007/978-3-319-66706-5_18
[28]
Armando Solar-Lezama. 2013. Program sketching. STTT 15, 5-6 ( 2013 ), 475-495. https://doi.org/10.1007/s10009-012-0249-7 Saurabh Srivastava, Sumit Gulwani, and Jefrey S. Foster. 2010. From program verification to program synthesis. In Proceedings of the 37th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2010, Madrid, Spain, January 17-23, 2010. 313-326. https://doi.org/10.1145/1706299.1706337
[29]
Emina Torlak and Rastislav Bodík. 2014. A lightweight symbolic virtual machine for solver-aided host languages. In ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI '14, Edinburgh, United Kingdom-June 09-11, 2014. 530-541. https://doi.org/10.1145/2594291.2594340
[30]
Xinyu Wang, Greg Anderson, Isil Dillig, and Kenneth L McMillan. 2018a. Learning Abstractions for Program Synthesis. In International Conference on Computer Aided Verification. Springer, 407-426.
[31]
Xinyu Wang, Isil Dillig, and Rishabh Singh. 2017. Program synthesis using abstraction refinement. Proceedings of the ACM on Programming Languages 2, POPL ( 2017 ), 1-30.
[32]
Xinyu Wang, Isil Dillig, and Rishabh Singh. 2018b. Program Synthesis Using Abstraction Refinement. PACMPL 2, POPL ( 2018 ), 63 : 1-63 : 30.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 5, Issue POPL
January 2021
1789 pages
EISSN:2475-1421
DOI:10.1145/3445980
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: 04 January 2021
Published in PACMPL Volume 5, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Program Synthesis
  2. Semantics-Guided Synthesis (SemGuS)
  3. Unrealizability

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)246
  • Downloads (Last 6 weeks)28
Reflects downloads up to 20 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media