paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Verifying Graph Algorithms in Separation Logic: A Case for an Algebraic Approach

在分离逻辑中验证图算法:一种代数方法的例证
ICFP 9(ICFP)2025匹配度 3/10 · 论文属于分离逻辑与图算法程序验证,和形式化验证方向有弱交集,但未涉及 LLM/Agent、静态分析、浮点程序分析或贝叶斯程序分析等用户核心研究问题。引用 0 inbox
Marcos Grandury, Aleksandar Nanevski, Alexander Gryzlov
crossref: 2026-09-10

AI 速览

一句话:提出用偏交换幺半群及其态射组织图算法的分离逻辑验证,实现上下文局部推理,并简洁验证 Schorr-Waite 与并查集。

在分离逻辑中验证图算法长期困难,主要原因是图子组件之间存在结构共享,难以只隔离相关堆片段。本文提出一种代数方法:将图表示为偏交换幺半群(PCM),并利用保持结构的 PCM 态射(包括高阶组合子)进行推理。PCM 态射推广了分离逻辑的局部推理原则:传统 framing 只在规格顶层隔离相关堆部分,而态射可对幺半群运算分配,从而在规格深层嵌套时实现上下文局部化,隔离相关子图。作者以 Schorr-Waite 图标记算法和并查集两个经典基准为例,给出了新颖且简洁的验证,表明该代数方法能有效应对结构共享带来的挑战。

问题
图算法因图子组件间的结构共享而难以在分离逻辑中验证,传统 framing 只能在规格顶层隔离相关堆片段。
方法
将图表示为偏交换幺半群(PCM),并使用保持结构的 PCM 态射(含高阶组合子)对幺半群运算分配,从而实现上下文局部化与深层子图隔离。
评估
通过对 Schorr-Waite 图标记算法和并查集两个经典基准给出新颖且简洁的验证,展示该代数方法的有效性。
原文摘要(Abstract)

Verifying graph algorithms has long been considered challenging in separation logic, mainly due to structural sharing between graph subcomponents. We show that these challenges can be effectively addressed by representing graphs as a partial commutative monoid (PCM), and by leveraging structure-preserving functions (PCM morphisms), including higher-order combinators. PCM morphisms are important because they generalize separation logic’s principle of local reasoning. While traditional framing isolates relevant portions of the heap only at the top level of a specification, morphisms enable contextual localization: they distribute over monoid operations to isolate relevant subgraphs, even when nested deeply within a specification. We demonstrate the morphisms’ effectiveness with novel and concise verifications of two canonical graph benchmarks: the Schorr-Waite graph marking algorithm and the union-find data structure.

链接与引用

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

BibTeX
@article{paperbot3044,
  title = {Verifying Graph Algorithms in Separation Logic: A Case for an Algebraic Approach},
  author = {Marcos Grandury and Aleksandar Nanevski and Alexander Gryzlov},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {ICFP},
  year = {2025},
  doi = {10.1145/3747510}
}