paperbot · PL 论文追踪

全部论文 待读 收藏

P2 ANF preserves dependent types up to extensional equality

ANF 在外延相等意义下保持依赖类型
JFP vol.322022匹配度 2/10 · 该论文属于依赖类型与类型保持编译的形式化验证工作,方向偏编程语言理论和编译器正确性,与用户画像中关注的LLM/Agent、静态分析、浮点程序分析、贝叶斯程序分析等核心交叉方向基本无关。仅在形式化验证/PL理论层面有非常弱的邻近性。引用 3 inbox
PAULETTE KORONKEVICH, RAMON RAKOW, AMAL AHMED, WILLIAM J. BOWMAN
crossref: 2026-09-10

AI 速览

一句话:首次为依赖类型提出带 join-point 优化的 ANF 翻译,并证明其类型保持及分离编译正确性。

许多程序员使用 Coq 等依赖类型语言做机器验证,但现有编译器在编译后及链接外部代码时不提供保证。类型保持编译器可保留类型中的保证,然而标准编译遍无法保持强度依赖类型理论(intensional dependent type theory)的依赖类型,因为该类型系统对语法变化高度敏感。本文为带布尔与自然数依赖消去的 Extended Calculus of Constructions(ECC)子集设计了一种带 join-point 优化的 A-normal form(ANF)翻译。目标语言具有 equality reflection,使类型系统能编码项的语义相等,这是证明类型保持与分离编译正确性的关键。该工作是首个面向依赖类型的 ANF 翻译,支持 universe hierarchy,且不依赖 parametricity 或 impredicativity。

问题
依赖类型语言经编译和链接后缺乏保证;标准编译遍难以保持强度依赖类型理论中的依赖类型,因其对语法变化高度敏感。
方法
为 ECC 的布尔/自然数依赖消去子集设计带 join-point 优化的 ANF 翻译,目标语言引入 equality reflection 以编码语义相等,并证明类型保持与分离编译正确性。
评估
以类型保持与分离编译正确性的证明作为评估,并说明该翻译支持 universe hierarchy、不依赖 parametricity 或 impredicativity;是首个依赖类型的 ANF 翻译。
原文摘要(Abstract)

Abstract Many programmers use dependently typed languages such as Coq to machine-verify high-assurance software. However, existing compilers for these languages provide no guarantees after compiling, nor when linking after compilation. Type-preserving compilers preserve guarantees encoded in types and then use type checking to verify compiled code and ensure safe linking with external code. Unfortunately, standard compiler passes do not preserve the dependent typing of commonly used (intensional) type theories. This is because assumptions valid in simpler type systems no longer hold, and intensional dependent type systems are highly sensitive to syntactic changes, including compilation. We develop an A-normal form (ANF) translation with join-point optimization—a standard translation for making control flow explicit in functional languages—from the Extended Calculus of Constructions (ECC) with dependent elimination of booleans and natural numbers (a representative subset of Coq). Our dependently typed target language has equality reflection, allowing the type system to encode semantic equality of terms. This is key to proving type preservation and correctness of separate compilation for this translation. This is the first ANF translation for dependent types. Unlike related translations, it supports the universe hierarchy, and does not rely on parametricity or impredicativity.

链接与引用

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

BibTeX
@article{paperbot1634,
  title = {ANF preserves dependent types up to extensional equality},
  author = {PAULETTE KORONKEVICH and RAMON RAKOW and AMAL AHMED and WILLIAM J. BOWMAN},
  journal = {Journal of Functional Programming},
  volume = {32},
  year = {2022},
  doi = {10.1017/s0956796822000090}
}