Structuring the Synthesis of Heap-Manipulating Programs - Extended Version

07/18/2018
by   Nadia Polikarpova, et al.
0

This paper describes a deductive approach to synthesizing imperative programs with pointers from declarative specifications expressed in Separation Logic. Our synthesis algorithm takes as input a pair of assertions---a pre- and a postcondition---which describe two states of the symbolic heap, and derives a program that transforms one state into the other, guided by the shape of the heap. The program synthesis algorithm rests on the novel framework of Synthetic Separation Logic (SSL), which generalises the classical notion of heap entailment PQ to incorporate a possibility of transforming a heap satisfying an assertion P into a heap satisfying an assertion Q. A synthesized program represents a proof term for a transforming entailment statement PQ, and the synthesis procedure corresponds to a proof search. The derived programs are, thus, correct by construction, in the sense that they satisfy the ascribed pre/postconditions, and are accompanied by complete proof derivations, which can be checked independently. We have implemented a proof search engine for SSL in a form the program synthesizer called SuSLik. For efficiency, the engine exploits properties of SSL rules, such as invertibility and commutativity of rule applications on separate heaps, to prune the space of derivations it has to consider. We explain and showcase the use of SSL on characteristic examples, describe the design of SuSLik, and report on our experience of using it to synthesize a series of benchmark programs manipulating heap-based linked data structures.

READ FULL TEXT
research
07/18/2018

Structuring the Synthesis of Heap-Manipulating Programs

This paper describes a deductive approach to synthesizing imperative pro...
research
08/24/2017

Transforming Coroutining Logic Programs into Equivalent CHR Programs

We extend a technique called Compiling Control. The technique transforms...
research
01/29/2020

Concise Read-Only Specifications for Better Synthesis of Programs with Pointers – Extended Version

In program synthesis there is a well-known trade-off between concise and...
research
10/26/2017

Automated Lemma Synthesis in Symbolic-Heap Separation Logic

The symbolic-heap fragment of separation logic has been actively develop...
research
04/15/2019

Specifying Concurrent Programs in Separation Logic: Morphisms and Simulations

In addition to pre- and postconditions, program specifications in recent...
research
04/03/2018

Neural-Guided Deductive Search for Real-Time Program Synthesis from Examples

Synthesizing user-intended programs from a small number of input-output ...
research
05/25/2021

Comparative Synthesis: Learning Optimal Programs with Indeterminate Objectives

Quantitative program synthesis aims to generate a program that satisfies...

Please sign up or login with your details

Forgot password? Click here to reset