paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Quantitative program reasoning with graded modal types

使用分级模态类型的定量程序推理
ICFP 3(ICFP)2019匹配度 2/10 · 该论文属于类型系统与函数式编程中的定量程序推理,未涉及用户核心关注的 LLM/Agent、机器学习系统静态分析、浮点程序分析或贝叶斯程序分析;仅在“理论形式化+工程实现”偏好上略有契合,整体研究方向匹配度低。引用 86 inbox
Dominic Orchard, Vilem-Benjamin Liepelt, Harley Eades III
crossref: 2026-09-10

AI 速览

一句话:提出分级模态类型统一 coeffect 与 graded monad,并在 Granule 中结合线性/索引类型实现定量程序推理。

程序中的数据常作为受使用约束的资源(如文件句柄、通道),而多数语言不检查这些约束,带来正确性挑战。线性类型可区分资源与不受限值,但有界线性逻辑通过索引模态族量化非线性使用,coeffect 类型进一步推广为分级 comonad。本文提出分级模态类型这一统一概念,涵盖 coeffect 类型以及经分级 monad 进行的对偶效应推理;将其与线性类型和索引类型结合,形成可表达定量程序推理的类型理论,从而扩大类型系统可捕获和验证的程序性质范围。作者在完整的函数式语言 Granule 中实现该类型系统,并通过多类示例展示其表达能力。

问题
多数语言不检查数据作为资源时的使用约束,线性类型只能部分处理,缺少对资源使用和效应进行细粒度定量推理的类型机制。
方法
提出分级模态类型,统一 coeffect 类型与分级 monad 效应推理,并将其与线性类型和索引类型结合,在函数式语言 Granule 中实现该类型系统。
评估
通过在 Granule 中实现完整语言并探索多个示例,展示该类型系统在定量程序推理方面的表达能力,而非大规模实证评估。
原文摘要(Abstract)

In programming, some data acts as a resource (e.g., file handles, channels) subject to usage constraints. This poses a challenge to software correctness as most languages are agnostic to constraints on data. The approach of linear types provides a partial remedy, delineating data into resources to be used but never copied or discarded, and unconstrained values. Bounded Linear Logic provides a more fine-grained approach, quantifying non-linear use via an indexed-family of modalities. Recent work on coeffect types generalises this idea to graded comonads, providing type systems which can capture various program properties. Here, we propose the umbrella notion of graded modal types, encompassing coeffect types and dual notions of type-based effect reasoning via graded monads. In combination with linear and indexed types, we show that graded modal types provide an expressive type theory for quantitative program reasoning, advancing the reach of type systems to capture and verify a broader set of program properties. We demonstrate this approach via a type system embodied in a fully-fledged functional language called Granule, exploring various examples.

链接与引用

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

BibTeX
@article{paperbot607,
  title = {Quantitative program reasoning with graded modal types},
  author = {Dominic Orchard and Vilem-Benjamin Liepelt and Harley Eades III},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {ICFP},
  year = {2019},
  doi = {10.1145/3341714}
}