Affiliation:
1. Hong Kong University of Science and Technology, Hong Kong
2. KU Leuven, Belgium
3. Ghent University, Belgium
Abstract
Template-based synthesis, also known as sketching, is a localized approach to program synthesis in which the programmer provides not only a specification, but also a high-level "sketch" of the program. The sketch is basically a partial program that models the general intuition of the programmer, while leaving the low-level details as unimplemented "holes". The role of the synthesis engine is then to fill in these holes such that the completed program satisfies the desired specification. In this work, we focus on template-based synthesis of polynomial imperative programs with real variables, i.e. imperative programs in which all expressions appearing in assignments, conditions and guards are polynomials over program variables. While this problem can be solved in a sound and complete manner by a reduction to the first-order theory of the reals, the resulting formulas will contain a quantifier alternation and are extremely hard for modern SMT solvers, even when considering toy programs with a handful of lines. Moreover, the classical algorithms for quantifier elimination are notoriously unscalable and not at all applicable to this use-case.In contrast, our main contribution is an algorithm, based on several well-known theorems in polyhedral and real algebraic geometry, namely Putinar's Positivstellensatz, the Real Nullstellensatz, Handelman's Theorem and Farkas' Lemma, which sidesteps the quantifier elimination difficulty and reduces the problem directly to Quadratic Programming (QP). Alternatively, one can view our algorithm as an efficient way of eliminating quantifiers in the particular formulas that appear in the synthesis problem. The resulting QP instances can then be handled quite easily by SMT solvers. Notably, our reduction to QP is sound and semi-complete, i.e. it is complete if polynomials of a sufficiently high degree are used in the templates. Thus, we provide the first method for sketching-based synthesis of polynomial programs that does not sacrifice completeness, while being scalable enough to handle meaningful programs. Finally, we provide experimental results over a variety of examples from the literature.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Reference70 articles.
1. Alessandro Abate Cristina David Pascal Kesseli Daniel Kroening and Elizabeth Polgreen. 2018. Counterexample guided inductive synthesis modulo theories. In CAV. 270–288. Alessandro Abate Cristina David Pascal Kesseli Daniel Kroening and Elizabeth Polgreen. 2018. Counterexample guided inductive synthesis modulo theories. In CAV. 270–288.
2. Sheshansh Agrawal Krishnendu Chatterjee and Petr Novotnỳ. 2017. Lexicographic ranking supermartingales: an efficient approach to termination of probabilistic programs. In POPL. Sheshansh Agrawal Krishnendu Chatterjee and Petr Novotnỳ. 2017. Lexicographic ranking supermartingales: an efficient approach to termination of probabilistic programs. In POPL.
3. 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. FMCAD. 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. FMCAD.
4. Rajeev Alur Dana Fisman Saswat Padhi Andrew Reynolds Rishabh Singh and Abhishek Udupa. 2019. SyGuS-Comp: Syntax-guided Synthesis Competition. https://sygus.org/ Rajeev Alur Dana Fisman Saswat Padhi Andrew Reynolds Rishabh Singh and Abhishek Udupa. 2019. SyGuS-Comp: Syntax-guided Synthesis Competition. https://sygus.org/
5. Search-based program synthesis
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献