paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Almost-Sure Termination by Guarded Refinement

通过守卫精化的几乎必然终止证明
ICFP 8(ICFP)2024匹配度 3/10 · 该论文属于概率程序的形式化验证(高阶分离逻辑、守卫递归、Löb 归纳、Coq 机械化),与用户的四条主线——LLM/Agent 与静态分析的双向结合、浮点程序分析、贝叶斯程序分析——均无直接交集;仅在“形式化验证”这一泛化层面与 AI→PL 方向沾边,但完全不涉及 LLM/Agent 或静态分析工具。引用 7 inbox
Simon Oddershede Gregersen, Alejandro Aguirre, Philipp G. Haselwarter, Joseph Tassarotti, Lars Birkedal
dblp: 2026-09-10crossref: 2026-09-10arxiv: 2026-09-10

AI 速览

一句话:提出 Caliper:用保持终止的高阶程序—概率模型精化,经守卫递归与 Löb 归纳证明几乎必然终止。

几乎必然终止是概率程序的重要正确性性质,但已有程序逻辑大多针对一阶程序及特定循环语法。本文研究带一般引用的高阶概率程序的几乎必然终止:这类语言中递归与循环可编码为多种形式,因此难以给出针对具体递归模式的证明规则。作者提出 Caliper,一种用于证明“保持终止的精化”的高阶分离逻辑:通过证明高阶程序与更简单概率模型之间的精化,将程序的几乎必然终止性归约为对模型的分析。Caliper 使用概率耦合进行程序与模型之间的关系推理,并用守卫递归特别是 Löb 归纳处理高阶程序中的各种递归模式。技术上不需要超限步索引或既有守卫递归工作里的其他限制。作者验证了一阶循环构造、随机链表生成器、treap 以及使用高阶存储的 Galton-Watson 树采样器等例子,所有结果均在 Coq 中机器化。

问题
已有概率程序逻辑多为一阶语言和特定循环语法设计,难以覆盖带一般引用的高阶概率程序中多种多样的递归与循环编码形式。
方法
提出 Caliper 高阶分离逻辑,通过证明程序与简单概率模型之间保持终止行为的精化来规约几乎必然终止,用概率耦合做关系推理、用守卫递归与 Löb 归纳处理递归。
评估
在 Coq 证明助手中机器化全部结果,并用于验证一阶循环、随机链表生成器、treap 以及使用高阶存储的 Galton-Watson 树采样器等多个实例。
原文摘要(Abstract)

Almost-sure termination is an important correctness property for probabilistic programs, and a number of program logics have been developed for establishing it. However, these logics have mostly been developed for first-order programs written in languages with specific syntactic patterns for looping. In this paper, we consider almost-sure termination for higher-order probabilistic programs with general references. This combination of features allows for recursion and looping to be encoded through a variety of patterns. Therefore, rather than developing proof rules for reasoning about particular recursion patterns, we instead propose an approach based on proving refinement between a higher-order program and a simpler probabilistic model, in such a way that the refinement preserves termination behavior. By proving a refinement, almost-sure termination behavior of the program can then be established by analyzing the simpler model. We present this approach in the form of Caliper , a higher-order separation logic for proving terminationpreserving refinements. Caliper uses probabilistic couplings to carry out relational reasoning between a program and a model. To handle the range of recursion patterns found in higher-order programs, Caliper uses guarded recursion, in particular the principle of Löb induction. A technical novelty is that Caliper does not require the use of transfinite step indexing or other technical restrictions found in prior work on guarded recursion for termination-preservation refinement. We demonstrate the flexibility of this approach by proving almost-sure termination of several examples, including first-order loop constructs, a random list generator, treaps, and a sampler for Galton-Watson trees that uses higher-order store. All the results have been mechanized in the Coq proof assistant.

链接与引用

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

BibTeX
@article{Gregersen0HTB24,
  title = {Almost-Sure Termination by Guarded Refinement},
  author = {Simon Oddershede Gregersen and Alejandro Aguirre and Philipp G. Haselwarter and Joseph Tassarotti and Lars Birkedal},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {ICFP},
  year = {2024},
  doi = {10.1145/3674632}
}