paperbot · PL 论文追踪

全部论文 待读 收藏

P2 On continuation-passing transformations and expected cost analysis

论续延传递变换与期望成本分析
ICFP 5(ICFP)2021匹配度 3/10 · 论文属于概率程序的形式化验证与期望成本分析,与用户关注的贝叶斯程序分析有领域关联,但未涉及 LLM/Agent、静态分析应用、浮点分析等核心方向,且缺乏工程落地和 LLM 交叉。引用 17 inbox
Martin Avanzini, Gilles Barthe, Ugo Dal Lago
crossref: 2026-09-10

AI 速览

一句话:为带概率选择、递归与成本计量的λ演算定义CPS变换,使表达式应用于续延λv.0即得期望成本,并给出可靠的高阶逻辑EHOL推导紧界。

本文针对带概率选择、无界递归和tick计费算子的类型化λ演算,研究其期望成本分析问题。作者定义了一种续延传递风格(CPS)变换,将源语言翻译到非概率的λ演算,目标语言包含扩展正实数类型与不动点算子。核心结果是:将表达式M的CPS变换应用于续延λv.0,所得结果恰为M的期望成本。作者进一步提出高阶逻辑形式系统EHOL,证明其可靠性,并用它推导Coupon Collector、Random Walk等经典例子期望成本的紧上界。此外,论文将所提变换与Kaminski等人的ert-calculus建立联系,表明后者可通过对经典命令式程序到λ演算嵌入的推广应用CPS变换而恢复。最后,作者证明该CPS变换还可用于计算pre-expectation以及推理几乎必然终止。

问题
如何对同时具有概率选择、无界递归和显式成本计量的高阶程序进行期望成本分析,并给出可机械推理的紧上界。
方法
定义从概率类型化λ演算到含扩展正实数类型与不动点算子的非概率λ演算的CPS变换,将期望成本编码为续延应用;并设计高阶逻辑EHOL作为推理期望成本的形式系统,同时与ert-calculus建立联系。
评估
证明CPS变换的正确性(应用于λv.0得到期望成本)及EHOL的可靠性,并在Coupon Collector与Random Walk等经典例子上推导出期望成本的紧上界;还证明该变换可用于计算pre-expectation和推理几乎必然终止。
原文摘要(Abstract)

We define a continuation-passing style (CPS) translation for a typed λ-calculus with probabilistic choice, unbounded recursion, and a tick operator — for modeling cost. The target language is a (non-probabilistic) λ-calculus, enriched with a type of extended positive reals and a fixpoint operator. We then show that applying the CPS transform of an expression M to the continuation λ v . 0 yields the expected cost of M . We also introduce a formal system for higher-order logic, called EHOL, prove it sound, and show it can derive tight upper bounds on the expected cost of classic examples, including Coupon Collector and Random Walk. Moreover, we relate our translation to Kaminski et al.’s ert-calculus, showing that the latter can be recovered by applying our CPS translation to (a generalization of) the classic embedding of imperative programs into λ-calculus. Finally, we prove that the CPS transform of an expression can also be used to compute pre-expectations and to reason about almost sure termination.

链接与引用

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

BibTeX
@article{paperbot1120,
  title = {On continuation-passing transformations and expected cost analysis},
  author = {Martin Avanzini and Gilles Barthe and Ugo Dal Lago},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {ICFP},
  year = {2021},
  doi = {10.1145/3473592}
}