paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A High-Level Separation Logic for Heap Space under Garbage Collection

面向垃圾回收下堆空间的高层分离逻辑
POPL 7(POPL)2023匹配度 3/10 · 论文属于分离逻辑与程序验证形式化工作,与用户核心方向(LLM/Agent 与静态分析、浮点程序分析、贝叶斯程序分析)没有直接交叉;仅在“AI→PL/LLM 辅助形式化验证”的潜在目标领域上具有间接参考价值。引用 0 inbox
Alexandre Moine, Arthur Charguéraud, François Pottier
crossref: 2026-09-10

AI 速览

一句话:提出带空间信用与可堆叠断言的高层分离逻辑,在含GC的高层语言中模块化推理堆空间,并在Coq/Iris中机器化验证。

本文研究在带垃圾回收与可变状态的顺序按值调用 lambda 演算中推理堆空间用量的问题。关键难点在于以可靠、模块化且轻量的方式建立内存块的不可达性:已有工作使用 pointed-by 断言追踪每个块的前驱,但局限于类汇编语言。本文将其提升到高层语言,核心挑战是识别并推理垃圾回收器视为根的内存位置。为此,作者提出新颖的“可堆叠”(stackable)断言,在不显式记录来源的情况下追踪栈到堆指针的存在性,并说明如何推理闭包——实现一等函数抽象概念的具体堆分配数据结构。文章通过一系列示例展示该程序逻辑的表达力与可操作性,包括链表上的递归函数、用闭包与可变内部状态实现的对象、续延传递风格(CPS)的递归函数,以及三种具有不同空间界的栈实现;后三者还涉及容器中元素可达性的推理与空间的摊还推理。所有结果均在 Iris 之上用 Coq 机器化证明。

问题
如何在带有垃圾回收的高层语言中,以可靠、模块化且轻量的方式推理堆空间用量,尤其是建立内存块的不可达性并识别垃圾回收器的根。
方法
在顺序按值调用 lambda 演算(含 GC 与可变状态)中设计带空间信用(space credits)的分离逻辑,引入“可堆叠”断言来追踪栈到堆指针的存在性而不记录其来源,并给出对闭包的推理机制。
评估
在 Coq 中基于 Iris 机器化验证全部结果,并通过链表递归函数、闭包实现的对象、CPS 递归函数以及三种不同空间界的栈实现等示例展示该逻辑的表达力与可操作性。
原文摘要(Abstract)

We present a Separation Logic with space credits for reasoning about heap space in a sequential call-by-value lambda-calculus equipped with garbage collection and mutable state. A key challenge is to design sound, modular, lightweight mechanisms for establishing the unreachability of a block. Prior work in this area uses pointed-by assertions to keep track of the predecessors of every block, but is carried out in the setting of an assembly-like programming language. We take up the challenge in the setting of a high-level language, where a key problem is to identify and reason about the memory locations that the garbage collector considers as roots. For this purpose, we propose novel "stackable" assertions, which keep track of the existence of stack-to-heap pointers without explicitly recording their origin. Furthermore, we explain how to reason about closures -- concrete heap-allocated data structures that implement the abstract concept of a first-class function. We demonstrate the expressiveness and tractability of our program logic via a range of examples, including recursive functions on linked lists, objects implemented using closures and mutable internal state, recursive functions in continuation-passing style, and three stack implementations that exhibit different space bounds. These last three examples illustrate reasoning about the reachability of the items stored in a container as well as amortized reasoning about space. All of our results are proved in Coq on top of Iris.

链接与引用

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

BibTeX
@article{paperbot2106,
  title = {A High-Level Separation Logic for Heap Space under Garbage Collection},
  author = {Alexandre Moine and Arthur Charguéraud and François Pottier},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {POPL},
  year = {2023},
  doi = {10.1145/3571218}
}