[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article
Open access

Automating Pruning in Top-Down Enumeration for Program Synthesis Problems with Monotonic Semantics

Published: 08 October 2024 Publication History

Abstract

In top-down enumeration for program synthesis, abstraction-based pruning uses an abstract domain to approximate the set of possible values that a partial program, when completed, can output on a given input. If the set does not contain the desired output, the partial program and all its possible completions can be pruned. In its general form, abstraction-based pruning requires manually designed, domain-specific abstract domains and semantics, and thus has only been used in domain-specific synthesizers. This paper provides sufficient conditions under which a form of abstraction-based pruning can be automated for arbitrary synthesis problems in the general-purpose Semantics-Guided Synthesis (SemGuS) framework without requiring manually-defined abstract domains. We show that if the semantics of the language for which we are synthesizing programs exhibits some monotonicity properties, one can obtain an abstract interval-based semantics for free from the concrete semantics of the programming language, and use such semantics to effectively prune the search space. We also identify a condition that ensures such abstract semantics can be used to compute a precise abstraction of the set of values that a program derivable from a given hole in a partial program can produce. These precise abstractions make abstraction-based pruning more effective. We implement our approach in a tool, Moito, which can tackle synthesis problems defined in the SemGuS framework. Moito can automate interval-based pruning without any a-priori knowledge of the problem domain, and solve synthesis problems that previously required domain-specific, abstraction-based synthesizers— e.g., synthesis of regular expressions, CSV file schema, and imperative programs from examples.

References

[1]
Rajeev Alur, Rastislav Bodik, Garvit Juniwal, Milo M. K. Martin, Mukund Raghothaman, Sanjit A. Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. 2013. Syntax-guided synthesis. In 2013 Formal Methods in Computer-Aided Design. 1–8. https://doi.org/10.1109/FMCAD.2013.6679385
[2]
Rajeev Alur, Dana Fisman, Rishabh Singh, and Armando Solar-Lezama. 2016. Results and Analysis of SyGuS-Comp’15. Electronic Proceedings in Theoretical Computer Science, 202 (2016), Feb., 3–26. issn:2075-2180 https://doi.org/10.4204/eptcs.202.3
[3]
Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. 2017. Scaling Enumerative Program Synthesis via Divide and Conquer. In International Conference on Tools and Algorithms for Construction and Analysis of Systems. https://api.semanticscholar.org/CorpusID:9465894
[4]
Haniel Barbosa, Clark W. Barrett, Martin Brain, Gereon Kremer, Hanna Lachnitt, Makai Mann, Abdalrhman Mohamed, Mudathir Mohamed, Aina Niemetz, Andres Nötzli, Alex Ozdemir, Mathias Preiner, Andrew Reynolds, Ying Sheng, Cesare Tinelli, and Yoni Zohar. 2022. cvc5: A Versatile and Industrial-Strength SMT Solver. In Tools and Algorithms for the Construction and Analysis of Systems - 28th International Conference, TACAS 2022, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2022, Munich, Germany, April 2-7, 2022, Proceedings, Part I, Dana Fisman and Grigore Rosu (Eds.) (Lecture Notes in Computer Science, Vol. 13243). Springer, 415–442. https://doi.org/10.1007/978-3-030-99524-9_24
[5]
Edd Barrett and Andy King. 2010. Range and Set Abstraction using SAT. In Proceeding of the Second International Workshop on Numerical and Symbolic Abstract Domains, NSAD@SAS 2010, Perpignan, France, September 13, 2010, Antoine Miné and Enric Rodríguez-Carbonell (Eds.) (Electronic Notes in Theoretical Computer Science, Vol. 267). Elsevier, 17–27. https://doi.org/10.1016/J.ENTCS.2010.09.003
[6]
Center for High Throughput Computing. 2006. Center for High Throughput Computing. https://doi.org/10.21231/GNT1-HW21
[7]
Leonardo De Moura and Nikolaj Bjørner. 2008. Z3: An Efficient 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 (TACAS’08/ETAPS’08). Springer-Verlag, Berlin, Heidelberg. 337–340. isbn:3540787992
[8]
Thomas Gawlitza, Jérôme Leroux, Jan Reineke, Helmut Seidl, Grégoire Sutre, and Reinhard Wilhelm. 2009. Polynomial Precise Interval Analysis Revisited. In Efficient Algorithms, Essays Dedicated to Kurt Mehlhorn on the Occasion of His 60th Birthday, Susanne Albers, Helmut Alt, and Stefan Näher (Eds.) (Lecture Notes in Computer Science, Vol. 5760). Springer, 422–437. https://doi.org/10.1007/978-3-642-03456-5_28
[9]
Sumit Gulwani, Susmit Jha, Ashish Tiwari, and Ramarathnam Venkatesan. 2011. Synthesis of Loop-Free Programs. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’11). Association for Computing Machinery, New York, NY, USA. 62–73. isbn:9781450306638 https://doi.org/10.1145/1993498.1993506
[10]
Sankha Narayan Guria, Jeffrey S. Foster, and David Van Horn. 2023. Absynthe: Abstract Interpretation-Guided Synthesis. Proc. ACM Program. Lang., 7, PLDI (2023), Article 171, jun, 24 pages. https://doi.org/10.1145/3591285
[11]
Keith J.C. Johnson, Rahul Krishnan, Thomas Reps, and Loris D’Antoni. 2024. Automating Pruning in Top-Down Enumeration for Program Synthesis Problems with Monotonic Semantics. arxiv:2408.15822. arxiv:2408.15822
[12]
Keith J.C. Johnson, Rahul Krishnan, Thomas Reps, and Loris D’Antoni. 2024. Automating Pruning in Top-Down Enumeration for Program Synthesis Problems with Monotonic Semantics. https://doi.org/10.5281/zenodo.12669773
[13]
Keith J.C. Johnson, Andrew Reynolds, Thomas Reps, and Loris D’Antoni. 2024. The SemGuS Toolkit. In Computer Aided Verification, Arie Gurfinkel and Vijay Ganesh (Eds.). Springer Nature Switzerland, Cham. 27–40. isbn:978-3-031-65633-0
[14]
Pankaj Kumar Kalita, Sujit Kumar Muduli, Loris D’Antoni, Thomas Reps, and Subhajit Roy. 2022. Synthesizing Abstract Transformers. arxiv:2105.00493.
[15]
Jinwoo Kim, Qinheping Hu, Loris D’Antoni, and Thomas Reps. 2021. Semantics-Guided Synthesis. Proceedings of the ACM on Programming Languages, 5, POPL (2021), 1–32.
[16]
Anvesh Komuravelli, Arie Gurfinkel, and Sagar Chaki. 2014. SMT-Based Model Checking for Recursive Programs. In Computer Aided Verification, Armin Biere and Roderick Bloem (Eds.). Springer International Publishing, Cham. 17–34. isbn:978-3-319-08867-9
[17]
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 (GPCE 2016). Association for Computing Machinery, New York, NY, USA. 70–80. isbn:9781450344463 https://doi.org/10.1145/2993236.2993244
[18]
Woosuk Lee. 2021. Combining the Top-down Propagation and Bottom-up Enumeration for Inductive Program Synthesis. Proc. ACM Program. Lang., 5, POPL (2021), Article 54, jan, 28 pages. https://doi.org/10.1145/3434335
[19]
Stephen Mell, Steve Zdancewic, and Osbert Bastani. 2024. Optimal Program Synthesis via Abstract Interpretation. Proc. ACM Program. Lang., 8, POPL (2024), Article 16, jan, 25 pages. https://doi.org/10.1145/3632858
[20]
Ulrich Möncke and Reinhard Wilhelm. 1991. Grammar flow analysis. In Attribute Grammars, Applications and Systems, Henk Alblas and Bořivoj Melichar (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 151–186. isbn:978-3-540-38490-8
[21]
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
[22]
Adam Retter, David Underdown, and Rob Walpole. 2016. CSV Schema Language 1.1. https://digital-preservation.github.io/csv-schema/csv-schema-1.1.html
[23]
Tushar Sharma and Thomas Reps. 2017. Sound Bit-Precise Numerical Domains. 500–520. isbn:978-3-319-52233-3 https://doi.org/10.1007/978-3-319-52234-0_27
[24]
Xujie Si, Woosuk Lee, Richard Zhang, Aws Albarghouthi, Paraschos Koutris, and Mayur Naik. 2018. Syntax-Guided Synthesis of Datalog Programs. In Proceedings of the 2018 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE 2018). Association for Computing Machinery, New York, NY, USA. 515–527. isbn:9781450355735 https://doi.org/10.1145/3236024.3236034
[25]
Sunbeom So and Hakjoo Oh. 2017. Synthesizing Imperative Programs from Examples Guided by Static Analysis. arxiv:1702.06334.
[26]
Armando Solar-Lezama. 2013. Program sketching. Int. J. Softw. Tools Technol. Transf., 15, 5-6 (2013), 475–495. https://doi.org/10.1007/s10009-012-0249-7
[27]
Zhendong Su and David A. Wagner. 2005. A class of polynomially solvable range constraints for interval analysis without widenings. Theor. Comput. Sci., 345, 1 (2005), 122–138. https://doi.org/10.1016/J.TCS.2005.07.035
[28]
Martin Vechev, Eran Yahav, and Greta Yorsh. 2010. Abstraction-Guided Synthesis of Synchronization. SIGPLAN Not., 45, 1 (2010), jan, 327–338. issn:0362-1340 https://doi.org/10.1145/1707801.1706338
[29]
Chenglong Wang, Alvin Cheung, and Rastislav Bodik. 2017. Synthesizing Highly Expressive SQL Queries from Input-Output Examples. In Proceedings of the 38th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2017). Association for Computing Machinery, New York, NY, USA. 452–466. isbn:9781450349888 https://doi.org/10.1145/3062341.3062365
[30]
Xinyu Wang, Greg Anderson, Isil Dillig, and Kenneth L McMillan. 2018. Learning Abstractions for Program Synthesis. In Computer Aided Verification: 30th International Conference, CAV 2018, Held as Part of the Federated Logic Conference, FloC 2018, Oxford, UK, July 14-17, 2018, Proceedings, Part I 30. 407–426.
[31]
Xinyu Wang, Isil Dillig, and Rishabh Singh. 2017. Program Synthesis using Abstraction Refinement. CoRR, abs/1710.07740 (2017), arXiv:1710.07740. arxiv:1710.07740
[32]
Yongho Yoon, Woosuk Lee, and Kwangkeun Yi. 2023. Inductive Program Synthesis via Iterative Forward-Backward Abstract Interpretation. Proc. ACM Program. Lang., 7, PLDI (2023), Article 174, jun, 25 pages. https://doi.org/10.1145/3591288

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 8, Issue OOPSLA2
October 2024
2691 pages
EISSN:2475-1421
DOI:10.1145/3554319
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: 08 October 2024
Published in PACMPL Volume 8, Issue OOPSLA2

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. abstract interpretation
  2. grammar flow analysis
  3. program synthesis

Qualifiers

  • Research-article

Funding Sources

  • A gift from Rajiv and Ritu Batra
  • Microsoft Research
  • National Science Foundation

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 111
    Total Downloads
  • Downloads (Last 12 months)111
  • Downloads (Last 6 weeks)46
Reflects downloads up to 13 Dec 2024

Other Metrics

Citations

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