当前位置: 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.)
Proof-relevant unification: Dependent pattern matching with only the axioms of your type theory
Journal of Functional Programming ( IF 1.1 ) Pub Date : 2018-05-10 , DOI: 10.1017/s095679681800014x
JESPER COCKX , DOMINIQUE DEVRIESE

Dependently typed languages such as Agda, Coq, and Idris use a syntactic first-order unification algorithm to check definitions by dependent pattern matching. However, standard unification algorithms implicitly rely on principles such asuniqueness of identity proofsandinjectivity of type constructors. These principles are inadmissible in many type theories, particularly in the new and promising branch known as homotopy type theory. As a result, programs and proofs in these new theories cannot make use of dependent pattern matching or other techniques relying on unification, and are as a result much harder to write, modify, and understand. This paper proposes a proof-relevant framework for reasoning formally about unification in a dependently typed setting. In this framework, unification rules compute not just a unifier but also a corresponding soundness proof in the form of anequivalencebetween two sets of equations. By rephrasing the standard unification rules in a proof-relevant manner, they are guaranteed to preserve soundness of the theory. In addition, it enables us to safely add new rules that can exploit the dependencies between the types of equations, such as rules for eta-equality of record types and higher dimensional unification rules for solving equations between equality proofs. Using our framework, we implemented a complete overhaul of the unification algorithm used by Agda. As a result, we were able to replace previousad-hocrestrictions with formally verified unification rules, fixing a substantial number of bugs in the process. In the future, we may also want to integrate new principles with pattern matching, for example, the higher inductive types introduced by homotopy type theory. Our framework also provides a solid basis for such extensions to be built on.

中文翻译:

证明相关的统一:依赖模式匹配仅与您的类型理论的公理

依赖类型语言,如 Agda、Coq 和 Idris 使用句法一阶统一算法通过依赖模式匹配来检查定义。然而,标准统一算法隐含地依赖于诸如身份证明的唯一性类型构造函数的注入. 这些原则在许多类型理论中是不可接受的,特别是在被称为同伦类型理论的新的和有前途的分支中。因此,这些新理论中的程序和证明不能利用依赖模式匹配或其他依赖统一的技术,因此更难编写、修改和理解。本文提出了一个证明相关的框架,用于正式推理依赖类型设置中的统一。在这个框架中,统一规则不仅计算统一器,还计算相应的健全性证明,其形式为等价两组方程之间。通过以证明相关的方式重新表述标准统一规则,可以保证它们保持理论的合理性。此外,它使我们能够安全地添加可以利用方程类型之间的依赖关系的新规则,例如记录类型的 eta 等式规则和用于求解等式证明之间的方程的更高维统一规则。使用我们的框架,我们对 Agda 使用的统一算法进行了全面检查。结果,我们能够替换以前的特设具有正式验证的统一规则的限制,修复了过程中的大量错误。将来,我们可能还想将新的原理与模式匹配结合起来,例如同伦类型理论引入的更高归纳类型。我们的框架还为构建此类扩展提供了坚实的基础。
更新日期:2018-05-10
down
wechat
bug