paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Decalf: A Directed, Effectful Cost-Aware Logical Framework

Decalf:一个有向、带效应且成本感知的逻辑框架
POPL 8(POPL)2024匹配度 3/10 · 该论文是程序语言理论中针对带效应函数式程序的成本感知类型论与语义模型,属于形式化方法/程序验证的范畴,但并未涉及用户核心关注的静态分析在 ML/Agentic 程序中的应用、LLM 与程序分析的交叉、浮点程序分析或贝叶斯程序分析。其概率效应与成本界可能与概率程序语义有间接关联,但整体匹配度较低。引用 11 inbox
Harrison Grodin, Yue Niu, Jonathan Sterling, Robert Harper
crossref: 2026-09-10

AI 速览

一句话:提出 Decalf,用内在前序刻画带效应函数式程序成本界的有向成本感知逻辑框架,并给出单纯集模型。

针对带效应函数式程序(如概率选择、可变状态)的成本分析,现有 calf 等成本感知类型论依赖可分离的成本记账,难以直接处理效应与高阶程序。Decalf 将成本界本身视为一个程序,并给每个类型配备内在前序:在扩展阶段退化为外延相等,在内涵阶段反映成本近似。该设计保持程序行为不受成本记账影响,并避免显式成本递归。作者通过纯排序与带效应排序、简单概率程序和高阶函数等例子展示其表达力,最后在增广单纯集拓扑斯中给出模型,证明该类型系统的合理性。

问题
如何为带效应(概率选择、可变状态)的函数式程序建立成本感知类型论,使成本界不依赖可分离的成本递归,并能扩展到高阶程序。
方法
在 calf 基础上引入有向类型与内在前序,将成本界表示为程序本身,并构造 decalf 类型系统;最后用增广单纯集拓扑斯中的模型给出语义保证。
评估
通过纯排序与带效应排序、概率程序、高阶函数等示例进行说明,并以增广单纯集拓扑斯中的模型验证系统的合理性。
原文摘要(Abstract)

We present decalf , a d irected, e ffectful c ost- a ware l ogical f ramework for studying quantitative aspects of functional programs with effects. Like calf , the language is based on a formal phase distinction between the extension and the intension of a program, its pure behavior as distinct from its cost measured by an effectful step-counting primitive. The type theory ensures that the behavior is unaffected by the cost accounting. Unlike calf , the present language takes account of effects , such as probabilistic choice and mutable state. This extension requires a reformulation of calf ’s approach to cost accounting: rather than rely on a “separable” notion of cost, here a cost bound is simply another program . To make this formal, we equip every type with an intrinsic preorder, relaxing the precise cost accounting intrinsic to a program to a looser but nevertheless informative estimate. For example, the cost bound of a probabilistic program is itself a probabilistic program that specifies the distribution of costs. This approach serves as a streamlined alternative to the standard method of isolating a cost recurrence and readily extends to higher-order, effectful programs. The development proceeds by first introducing the decalf type system, which is based on an intrinsic ordering among terms that restricts in the extensional phase to extensional equality, but in the intensional phase reflects an approximation of the cost of a program of interest. This formulation is then applied to a number of illustrative examples, including pure and effectful sorting algorithms, simple probabilistic programs, and higher-order functions. Finally, we justify decalf via a model in the topos of augmented simplicial sets.

链接与引用

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

BibTeX
@article{paperbot2587,
  title = {Decalf: A Directed, Effectful Cost-Aware Logical Framework},
  author = {Harrison Grodin and Yue Niu and Jonathan Sterling and Robert Harper},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {POPL},
  year = {2024},
  doi = {10.1145/3632852}
}