updated on 2024-07-17: I implemented a mini sygus solver using Java
1. Intro to SyGuS
Syntax-guided Synthesis (SyGuS) is a recent effort towards formalizing program synthesis where the logical specification is supplemented with a user-provided syntactic template to constrain the hypothesis space of possible programs.
The input $\mathcal I$ of SyGuS can be formalized as
where:
- $T$ is the vocabulary and interpretation of function and relation symbols,
- $\mathcal G$ is the syntactic set of candidate implementations
- $\phi$ is a semantic correctness specification for the desired program
Observe that
- $\mathcal G$ is used to constrain the program space
- and $\phi$ is to clarify user’s intent
The idea is very natural
An clear example is as follows.
1 | ; set the background theory to LIA |
2. Classification
The SyGuS community usually categorizes synthesis techniques into two classes:
- Enumerative Synthesis: which systematically enumerates possible implementations of the function to be synthesized and checks if it satisfies the desired specification;
- Deductive Synthesis: which tries to reduce the specification to a desired program, purely symbolically by applying a series of deductive rules.
2.1. Enumerative Synthesis
- From smaller-sized to larger sized candidates
The simplest strategy begins the search from smaller-sized candidates and moves toward larger-sized candidates. This naive strategy guarantees to produce the smallest possible program, and is proven efficient for a wide spectrum of syntax-guided synthesis tasks.
-
Abstraction-based Enumeration
-
Stochastic Enumeration
-
Constraint-based Enumeration
-
Learning-based Enumeration
2.2. Deductive Synthesis
3. Syntax of SyGuS
Intuitively the syntax seems very similar to Lisp
. In fact the syntax of SyGuS is a superset of the syntax of the SMT-LIB standard. Here is the standard syntax of SyGuS.