Template-based Program Synthesis using Stellensätze

09/08/2022
by   Amir Kafshdar Goharshady, et al.
0

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...

READ FULL TEXT
research
04/25/2016

Generalized Homogeneous Polynomials for Efficient Template-Based Nonlinear Invariant Synthesis

The template-based method is one of the most successful approaches to al...
research
06/04/2018

Program Synthesis from Visual Specification

Program synthesis is the process of automatically translating a specific...
research
11/22/2022

Genetic Algorithm for Program Synthesis

A deductive program synthesis tool takes a specification as input and de...
research
05/19/2021

Program Synthesis as Dependency Quantified Formula Modulo Theory

Given a specification φ(X,Y) over inputs X and output Y, defined over a ...
research
07/28/2021

Satisfiability and Synthesis Modulo Oracles

In classic program synthesis algorithms, such as counterexample-guided i...
research
06/21/2016

High Level Synthesis with a Dataflow Architectural Template

In this work, we present a new approach to high level synthesis (HLS), w...
research
05/27/2022

Learning to Find Proofs and Theorems by Learning to Refine Search Strategies

We propose a new approach to automated theorem proving and deductive pro...

Please sign up or login with your details

Forgot password? Click here to reset