当前位置: X-MOL 学术J. Funct. Program. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
ANF preserves dependent types up to extensional equality
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2022-09-16 , DOI: 10.1017/s0956796822000090
PAULETTE KORONKEVICH , RAMON RAKOW , AMAL AHMED , WILLIAM J. BOWMAN

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.



中文翻译:

ANF 保留依赖类型直到外延相等

许多程序员使用 Coq 等依赖类型语言来机器验证高保证软件。但是,这些语言的现有编译器在编译后或编译后链接时不提供任何保证。类型保持编译器保留编码在类型中的保证,然后使用类型检查来验证编译的代码并确保与外部代码的安全链接。不幸的是,标准编译器传递不保留常用(内涵)类型理论的依赖类型。这是因为在简单类型系统中有效的假设不再成立,并且内涵依赖类型系统对句法变化高度敏感,包括编译。我们开发了具有连接点优化的 A 范式 (ANF) 翻译——一种用于在函数式语言中明确控制流的标准翻译——来自扩展构造演算 (ECC),具有依赖消除布尔值和自然数(代表性子集) Coq)。我们的依赖类型目标语言具有相等反射,允许类型系统对术语的语义相等性进行编码。这是证明此翻译的单独编译的类型保留和正确性的关键。这是依赖类型的第一个 ANF 转换。与相关翻译不同的是,它支持宇宙层次结构,不依赖于参数性或不可预测性。

更新日期:2022-09-16
down
wechat
bug