paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Structuring the synthesis of heap-manipulating programs

结构化堆操纵程序的合成
POPL 3(POPL)2019匹配度 2/10 · 该论文研究基于分离逻辑的演绎程序合成与证明搜索,属于程序合成/形式验证方向,但未涉及用户核心关注的 LLM/Agent 与静态分析/形式化验证交叉、浮点程序分析或贝叶斯程序分析。引用 46 inbox
Nadia Polikarpova, Ilya Sergey
crossref: 2026-09-10

AI 速览

一句话:提出合成分离逻辑 SSL,将堆蕴含泛化为变换蕴含,通过证明搜索从分离逻辑规约合成指针程序。

本文研究如何从分离逻辑声明式规约演绎合成带指针的命令式程序。输入是一对描述符号堆状态的前置与后置断言,合成算法根据堆的形状推导出将一种状态转换为另一种状态的程序。方法上提出 Synthetic Separation Logic(SSL),把经典堆蕴含 P ⊢ Q 泛化为变换蕴含 P ↝ Q,合成出的程序对应变换蕴含的证明项,合成过程即证明搜索,因此程序构造即正确,满足所声明的前后条件并附带可独立检查的证明推导。作者实现了 SSL 的证明搜索合成器 SuSLik,并利用 SSL 规则的可逆性以及不相交堆上规则应用的交换性来剪枝搜索空间。论文通过典型例子展示 SSL 的用法,并报告在操作基于堆的链表数据结构的一组基准程序上的合成经验。

问题
如何从分离逻辑给出的前后条件规约自动合成带指针的命令式程序,并保证程序满足规约。
方法
提出 Synthetic Separation Logic(SSL),将堆蕴含扩展为变换蕴含,使程序成为证明项、合成成为证明搜索;实现 SuSLik,并利用规则可逆性与不相交堆上规则应用的交换性进行剪枝。
评估
在典型示例上展示 SSL 的推导与使用方式,并在操作基于堆的链表数据结构的一系列基准程序上评估 SuSLik 的合成能力。
原文摘要(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.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot620,
  title = {Structuring the synthesis of heap-manipulating programs},
  author = {Nadia Polikarpova and Ilya Sergey},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {POPL},
  year = {2019},
  doi = {10.1145/3290385}
}