Advanced search
1 file | 921.37 KB Add to list

Algebro-geometric algorithms for template-based synthesis of polynomial programs

Author
Organization
Project
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.
Keywords
program synthesis, sketching, syntax-guided synthesis

Downloads

  • 3586052.pdf
    • full text (Published version)
    • |
    • open access
    • |
    • PDF
    • |
    • 921.37 KB

Citation

Please use this url to cite or link to this publication:

MLA
Goharshady, Amir Kafshdar, et al. “Algebro-Geometric Algorithms for Template-Based Synthesis of Polynomial Programs.” PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, vol. 7, no. OOPSLA1, 2023, pp. 727–56, doi:10.1145/3586052.
APA
Goharshady, A. K., Hitarth, S., Mohammadi, F., & Motwani, H. J. (2023). Algebro-geometric algorithms for template-based synthesis of polynomial programs. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 7(OOPSLA1), 727–756. https://doi.org/10.1145/3586052
Chicago author-date
Goharshady, Amir Kafshdar, S Hitarth, Fatemeh Mohammadi, and Harshit Jitendra Motwani. 2023. “Algebro-Geometric Algorithms for Template-Based Synthesis of Polynomial Programs.” PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL 7 (OOPSLA1): 727–56. https://doi.org/10.1145/3586052.
Chicago author-date (all authors)
Goharshady, Amir Kafshdar, S Hitarth, Fatemeh Mohammadi, and Harshit Jitendra Motwani. 2023. “Algebro-Geometric Algorithms for Template-Based Synthesis of Polynomial Programs.” PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL 7 (OOPSLA1): 727–756. doi:10.1145/3586052.
Vancouver
1.
Goharshady AK, Hitarth S, Mohammadi F, Motwani HJ. Algebro-geometric algorithms for template-based synthesis of polynomial programs. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL. 2023;7(OOPSLA1):727–56.
IEEE
[1]
A. K. Goharshady, S. Hitarth, F. Mohammadi, and H. J. Motwani, “Algebro-geometric algorithms for template-based synthesis of polynomial programs,” PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, vol. 7, no. OOPSLA1, pp. 727–756, 2023.
@article{01H1YJRNWC392WKE4EPAB5CN89,
  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.}},
  articleno    = {{100}},
  author       = {{Goharshady, Amir Kafshdar and Hitarth, S and Mohammadi, Fatemeh and Motwani, Harshit Jitendra}},
  issn         = {{2475-1421}},
  journal      = {{PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL}},
  keywords     = {{program synthesis,sketching,syntax-guided synthesis}},
  language     = {{eng}},
  number       = {{OOPSLA1}},
  pages        = {{100:727--100:756}},
  title        = {{Algebro-geometric algorithms for template-based synthesis of polynomial programs}},
  url          = {{http://doi.org/10.1145/3586052}},
  volume       = {{7}},
  year         = {{2023}},
}

Altmetric
View in Altmetric