paperbot · PL 论文追踪

全部论文 待读 收藏

P2 A Graded Modal Dependent Type Theory with a Universe and Erasure, Formalized

带宇宙与擦除的分级模态依赖类型理论及其形式化
ICFP 7(ICFP)2023匹配度 3/10 · 论文属于纯类型论与形式化验证基础,讨论分级模态依赖类型、擦除提取及元理论证明,与用户核心关注的静态分析/LLM/Agent、浮点程序分析、贝叶斯程序分析等方向没有直接交集;仅在 PL 理论基础和形式化方法层面有间接关联。引用 14 inbox
Andreas Abel, Nils Anders Danielsson, Oskar Eriksson
crossref: 2026-09-10

AI 速览

一句话:提出带宇宙与擦除的分级模态依赖类型理论,并在 Agda 中形式化,证明元理论性质与擦除提取的可靠性。

本文提出分级模态依赖类型理论,用偏序半环中的 grade 追踪变量在项与类型中的使用,支持把函数参数标为可擦除。理论含 Π、弱/强 Σ、自然数、空类型与宇宙,并扩展单位与分级 Σ。作者在 Agda 中完整形式化,核心采用句法 Kripke 逻辑关系,证明主体归约、一致性、规范化与定义等价可判定,以及 grade 替换和归约下 grade 保持。还定义到无类型 λ 演算的提取,删除可擦除内容,并对某类模态证明自然数程序提取前后值相同;当上下文变量可擦除且一致、弱 Σ 不允许擦除匹配时,开放程序也成立。

问题
如何在依赖类型理论中通过分级模态追踪变量使用,以表达可擦除等定量性质,并保证其元理论与提取的正确性。
方法
定义参数化于偏序半环模态的 graded modal dependent type theory,在 Agda 中以句法 Kripke 逻辑关系形式化,并定义到无类型 λ 演算的擦除提取。
评估
在 Agda 机制中证明主体归约、一致性、规范化、定义等价可判定、grade 替换与保持,并证明特定模态下提取对闭/开程序的可靠性。
原文摘要(Abstract)

We present a graded modal type theory, a dependent type theory with grades that can be used to enforce various properties of the code. The theory has Π-types, weak and strong Σ-types, natural numbers, an empty type, and a universe, and we also extend the theory with a unit type and graded Σ-types. The theory is parameterized by a modality, a kind of partially ordered semiring, whose elements (grades) are used to track the usage of variables in terms and types. Different modalities are possible. We focus mainly on quantitative properties, in particular erasure: with the erasure modality one can mark function arguments as erasable. The theory is fully formalized in Agda. The formalization, which uses a syntactic Kripke logical relation at its core and is based on earlier work, establishes major meta-theoretic properties such as subject reduction, consistency, normalization, and decidability of definitional equality. We also prove a substitution theorem for grade assignment, and preservation of grades under reduction. Furthermore we study an extraction function that translates terms to an untyped λ-calculus and removes erasable content, in particular function arguments with the “erasable” grade. For a certain class of modalities we prove that extraction is sound, in the sense that programs of natural number type have the same value before and after extraction. Soundness of extraction holds also for open programs, as long as all variables in the context are erasable, the context is consistent, and erased matches are not allowed for weak Σ-types.

链接与引用

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

BibTeX
@article{paperbot1912,
  title = {A Graded Modal Dependent Type Theory with a Universe and Erasure, Formalized},
  author = {Andreas Abel and Nils Anders Danielsson and Oskar Eriksson},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {7},
  number = {ICFP},
  year = {2023},
  doi = {10.1145/3607862}
}