paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Compositional Cost Model for the λ-calculus

λ-演算的组合式代价模型
LICS 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)2021匹配度 2/10 · 该论文属于纯 PL 语义与复杂度理论:为按值调用 λ-演算给出基于博弈语义的组合式时间代价模型及 RAM 上的惰性图归约实现,既不涉及 LLM/Agent,也不涉及静态分析在 ML/Agentic 系统中的应用、浮点程序分析或贝叶斯程序分析。仅在“代价/资源分析的形式化基础”与“理论+工程实现兼顾”这两点上与研究画像有极间接的联系。引用 0 inbox
James Laird
crossref: 2026-09-12

AI 速览

一句话:基于博弈语义为按值调用 λ-演算提出组合式时间代价模型,并在 RAM 上给出保常因子的完全惰性图归约实现。

本文为按值调用 λ-演算建立可组合的时间代价模型。作者基于博弈语义的自然表示,将项指称的有限逼近(求值树)的代价定义为该逼近在语义中最小推导的大小。该度量具有最优性,可组合地推理代价界:从 C[A] 计算 c 的代价不超过从 A 计算 a 再在 C[a] 中计算 c 的代价。尽管底层语义非确定,作者给出确定性算法识别求值树逼近,并在随机存取机上以常数因子开销满足该模型。为满足完全惰性,作者提出无名显式替换的新型图归约,并通过一系列线性代价归约编译 λv-演算。

问题
如何为按值调用 λ-演算定义可组合、且在实现上可行的计算代价度量,使子项与上下文的代价能组合成整体代价。
方法
以博弈语义中最小推导大小定义求值树逼近的代价;给出在 RAM 上识别逼近的确定性算法,并设计无名显式替换的完全惰性图归约,通过线性代价归约编译 λv-演算。
评估
证明代价模型的组合性与最优性,并说明确定性算法在随机存取机上以常数因子开销实现该模型。
原文摘要(Abstract)

We describe a (time) cost model for the (call-by-value) λ-calculus based on a natural presentation of its game semantics: the cost of computing a finite approximant to the denotation of a term (its evaluation tree) is the size of its smallest derivation in the semantics. This measure has an optimality property enabling compositional reasoning about cost bounds: for any term A, context C[_] and approximants a and c to the trees of A and C[A], the cost of computing c from C[A] is no more than the cost of computing a from A and c from C[a].Although the natural semantics on which it is based is nondeterministic, our cost model is reasonable: we describe a deterministic algorithm for recognizing evaluation tree approximants which satisfies it (up to a constant factor overhead) on a Random Access Machine. This requires an implementation of the λv-calculus on the RAM which is completely lazy: compositionality of costs entails that work done to evaluate any part of a term cannot be duplicated. This is achieved by a novel implementation of graph reduction for nameless explicit substitutions, to which we compile the λv-calculus via a series of linear cost reductions.

链接与引用

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

BibTeX
@inproceedings{paperbot6198,
  title = {A Compositional Cost Model for the λ-calculus},
  author = {James Laird},
  booktitle = {LICS},
  year = {2021},
  doi = {10.1109/lics52264.2021.9470567}
}