paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Mechanized relational verification of concurrent programs with continuations

带续延的并发程序的机械化关系验证
ICFP 3(ICFP)2019匹配度 3/10 · 该论文属于纯形式化程序验证,研究带 continuation 的并发高阶命令式程序的关系验证与机械化证明,与用户核心关注的 LLM/Agent 和静态分析交叉、浮点程序分析、贝叶斯程序分析均无直接关联。仅在“形式化验证”这一泛 PL 主题上与 AI→PL 方向有边缘相关性,但论文本身不涉及 LLM/Agent。引用 24 inbox
Amin Timany, Lars Birkedal
crossref: 2026-09-10

AI 速览

一句话:首个全形式化工具,机械化关系验证带 call/cc 与 throw 的并发高阶命令式程序。

本文针对带续延(continuations,call/cc 与 throw)的并发高阶命令式语言难以推理的问题:非局部控制流破坏 Hoare 逻辑中关键的 bind 模块化规则。作者提出首个完全形式化的交互式机械化关系验证工具,并开发新型逻辑关系以机械化证明关系性质。为恢复模块化推理,他们引入 context-local 推理原则,使无异常控制流片段可模块化推理,并可与处理非局部控制流的 Hoare 逻辑结合。评估中,他们证明用续延实现的合作式并发的正确性,并证明基于续延模式实现的简易 web server 与不使用该模式的实现上下文等价;组合推理还简化了这些例子的验证。

问题
并发高阶命令式语言中的 continuations 带来非局部控制流,破坏 Hoare 逻辑 bind 规则,导致难以进行模块化关系验证。
方法
开发首个完全形式化的交互式机械化关系验证工具,提出新逻辑关系,并引入 context-local 推理原则与 Hoare 逻辑结合。
评估
在 call/cc 与 throw 语言中机械化证明合作式并发实现的正确性,以及基于续延的简易 web server 与无续延实现的上下文等价。
原文摘要(Abstract)

Concurrent higher-order imperative programming languages with continuations are very flexible and allow for the implementation of sophisticated programming patterns. For instance, it is well known that continuations can be used to implement cooperative concurrency. Continuations can also simplify web server implementations. This, in particular, helps simplify keeping track of the state of server’s clients. However, such advanced programming languages are very challenging to reason about. One of the main challenges in reasoning about programs in the presence of continuations is due to the fact that the non-local flow of control breaks the bind rule, one of the important modular reasoning principles of Hoare logic. In this paper we present the first completely formalized tool for interactive mechanized relational verification of programs written in a concurrent higher-order imperative programming language with continuations (call/cc and throw). We develop novel logical relations which can be used to give mechanized proofs of relational properties. In particular, we prove correctness of an implementation of cooperative concurrency with continuations. In addition, we show that that a rudimentary web server implemented using the continuation-based pattern is contextually equivalent to one implemented without the continuation-based pattern. We introduce context-local reasoning principles for our calculus which allows us to regain modular reasoning principles for the fragment of the language without non-local control flow. These novel reasoning principles can be used in tandem with our (non-context-local) Hoare logic for reasoning about programs that do feature non-local control flow. Indeed, we use the combination of context-local and non-context-local reasoning to simplify reasoning about the examples.

链接与引用

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

BibTeX
@article{paperbot597,
  title = {Mechanized relational verification of concurrent programs with continuations},
  author = {Amin Timany and Lars Birkedal},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {ICFP},
  year = {2019},
  doi = {10.1145/3341709}
}