Affiliation:
1. University of California at San Diego, USA
2. Yale-NUS College, Singapore / National University of Singapore, Singapore
Abstract
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. Our approach to program synthesis is grounded in proof theory: we introduce the novel framework of Synthetic Separation Logic (SSL), which generalises the classical notion of heap entailment
P
⊢
Q
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
P
↝
Q
, 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 of 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.
Publisher
Association for Computing Machinery (ACM)
Subject
Safety, Risk, Reliability and Quality,Software
Cited by
35 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Term Search in Rust;Proceedings of the 9th ACM SIGPLAN International Workshop on Type-Driven Development;2024-08-28
2. Towards a Dynabook for verified VM construction;Journal of Computer Languages;2024-08
3. ProveNFix: Temporal Property-Guided Program Repair;Proceedings of the ACM on Software Engineering;2024-07-12
4. Enhanced Enumeration Techniques for Syntax-Guided Synthesis of Bit-Vector Manipulations;Proceedings of the ACM on Programming Languages;2024-01-05
5. Synthesis of Recursive Programs in Saturation;Lecture Notes in Computer Science;2024