Inductive Program Synthesis

Notes about inductive program synthesis
programming
inductive-synthesis
algorithm
Published

April 3, 2023

Inductive Synthesis

Explicit

Synthesis Through Unification (STUN)

By modularising the search, i.e. search for multiple programs that work for different inputs and find a way to combine them that will work for all inputs, the scalability can be improved. The first step is a best-effort synthesis (if it works on all then it is just returned), then it can try to either improve the current program by taking a selection of the currently failing inputs alongside the correctly mapped inputs, or STUN can be called recursively on the inputs where the synthesised program failed. Then the programs can be combined. #### Anti/Unification If there are no top-level branches to allow unification, antiunification can be used. Unification is finding a common structure for two different expressions by replacing variables with expressions. Antiunification is to process of finding the common structure by replacing expressions with variables. For example, if we find 2 expressions a \times c and b \times c cover all inputs, antiunification can produce a common expression v \times c where v stands for a code fragment that can be solved, being a much smaller synthesis problem. When a recursive call to STUN is made, additional constraints can also be passed that the expression must satisfy to avoid situations where, for example, anntiunification cannot be used e.g. b \times c would be chosen over -b as b \times c can be antiunified with a \times c. \bigoplus represents unification.

References

[^1] A. Solar-Lezama, MIT 6.S981 Introduction to Program Synthesis