Satisfiability-based Program Reasoning and Program Synthesis
Publication or External Link
Program reasoning consists of the tasks of automatically and statically verifying correctness and inferring properties of programs. Program synthesis is the task of automatically generating programs. Both program reasoning and synthesis are theoretically undecidable, but the results in this dissertation show that they are practically tractable. We show that there is enough structure in programs written by human developers to make program reasoning feasible, and additionally we can leverage program reasoning technology for automatic program synthesis.
This dissertation describes expressive and efficient techniques for program reasoning and program synthesis. Our techniques work by encoding the underlying inference tasks as solutions to satisfiability instances. A core ingredient in the reduction of these problems to finite satisfiability instances is the assumption of templates. Templates are user-provided hints about the structural form of the desired artifact, e.g., invariant, pre- and postcondition templates for reasoning; or program templates for synthesis. We propose novel algorithms, parameterized by suitable templates, that reduce the inference of these artifacts to satisfiability.
We show that fixed-point computation---the key technical challenge in program reasoning---is encodable as SAT instances. We also show that program synthesis can be viewed as generalized verification, facilitating the use of program reasoning tools as synthesizers. Lastly, we show that program reasoning tools augmented with symbolic testing can be used to build powerful synthesizers with approximate guarantees.
We implemented the techniques developed in this dissertation in the form of the VS3---Verification and Synthesis using SMT Solvers---suite of tools. Using the VS3 tools, we were able to verify and infer expressive properties of programs, and synthesize difficult benchmarks from specifications. These prototype tools demonstrate that we can exploit the engineering advances in current SAT/SMT solvers to do automatic program reasoning and synthesis. We propose building future automatic program reasoning and synthesis tools based on the ideas presented in this dissertation.