paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Raising expectations: automating expected cost analysis with types

提升期望:用类型自动进行期望成本分析
ICFP 4(ICFP)2020匹配度 4/10 · 论文属于概率程序的类型化静态分析与期望成本上界推断,兼具形式化与工程实现,与用户对程序分析的理论兴趣有一定背景关联;但它不涉及 LLM/Agent、AI 与 PL 的双向结合、浮点程序分析或贝叶斯程序分析,因此与当前核心研究方向交叉有限。引用 39 inbox
Di Wang, David M. Kahn, Jan Hoffmann
dblp: 2026-09-10crossref: 2026-09-10arxiv: 2026-09-10

AI 速览

一句话:提出基于类型的概率程序期望执行成本上界分析,支持高阶函数与归纳数据类型,并将推断归约为线性约束求解。

本文提出一种基于类型的分析,自动推导概率程序期望执行成本的上界。方法基于摊销分析的势方法,扩展面向确定性程序的 AARA,支持高阶函数与归纳数据类型,且对成本模型参数化。局部类型规则将上界推断归约为线性约束求解;所得边界为关于数据结构的多元多项式,并可含符号概率。文章在基于分布的操作成本语义下证明可靠性,该语义涵盖非平凡发散;对时间等成本模型,边界意味着以概率 1 终止。作者在 Resource Aware ML 中实现该分析,支持多项式边界与自定义数据结构,并用离散分布样本复杂度及结合统计方法的确定性程序平均情况估计进行评估。

问题
如何自动、组合式地为概率程序推导与数据结构相关的期望执行成本上界,并处理高阶函数、归纳数据类型、符号概率以及可能发散的行为?
方法
基于摊销分析的势方法扩展 AARA,设计局部类型规则将边界推断归约为线性约束求解,并在基于分布的操作成本语义下证明所导边界的可靠性。
评估
在 Resource Aware ML 中实现,分析离散分布的样本复杂度,并结合统计方法对确定性程序做平均情况估计。
原文摘要(Abstract)

This article presents a type-based analysis for deriving upper bounds on the expected execution cost of probabilistic programs. The analysis is naturally compositional, parametric in the cost model, and supports higher-order functions and inductive data types. The derived bounds are multivariate polynomials that are functions of data structures. Bound inference is enabled by local type rules that reduce type inference to linear constraint solving. The type system is based on the potential method of amortized analysis and extends automatic amortized resource analysis (AARA) for deterministic programs. A main innovation is that bounds can contain symbolic probabilities, which may appear in data structures and function arguments. Another contribution is a novel soundness proof that establishes the correctness of the derived bounds with respect to a distribution-based operational cost semantics that also includes nontrivial diverging behavior. For cost models like time, derived bounds imply termination with probability one. To highlight the novel ideas, the presentation focuses on linear potential and a core language. However, the analysis is implemented as an extension of Resource Aware ML and supports polynomial bounds and user defined data structures. The effectiveness of the technique is evaluated by analyzing the sample complexity of discrete distributions and with a novel average-case estimation for deterministic programs that combines expected cost analysis with statistical methods.

链接与引用

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

BibTeX
@article{WangKH20,
  title = {Raising expectations: automating expected cost analysis with types},
  author = {Di Wang and David M. Kahn and Jan Hoffmann},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {4},
  number = {ICFP},
  year = {2020},
  doi = {10.1145/3408992}
}