Author:
COCKX JESPER,DEVRIESE DOMINIQUE
Abstract
AbstractDependently 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.
Publisher
Cambridge University Press (CUP)
Reference54 articles.
1. Vezzosi A. (2015) Heterogeneous equality incompatible with univalence even –without-k. Accessed April 17, 2017. Available at: https://github.com/agda/agda/issues/1408 (on the Agda bug tracker).
2. Streicher T. (1993) Investigations into intensional type theory. Habilitation thesis, Ludwig Maximilian University of Munich.
3. Equations: A Dependent Pattern-Matching Compiler
4. Sicard-Ramírez A. (2016) The –without-K option generates unsolved metas. Accessed April 17, 2017. Available at: https://github.com/agda/agda/issues/1775 (on the Agda bug tracker).
5. Reed J. (2009) Higher-order constraint simplification in dependent type theory. In Proceedings of the 4th International Workshop on Logical Frameworks and Meta-Languages: Theory and Practice. ACM, pp. 49–56.
Cited by
7 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Homotopy Type Theory for Sewn Quilts;Proceedings of the 11th ACM SIGPLAN International Workshop on Functional Art, Music, Modelling, and Design;2023-08-30
2. Practical generic programming over a universe of native datatypes;Proceedings of the ACM on Programming Languages;2022-08-29
3. A novice-friendly induction tactic for lean;Proceedings of the 10th ACM SIGPLAN International Conference on Certified Programs and Proofs;2021-01-17
4. Cubical Agda: A dependently typed programming language with univalence and higher inductive types;Journal of Functional Programming;2021
5. Equations reloaded: high-level dependently-typed functional programming and proving in Coq;Proceedings of the ACM on Programming Languages;2019-07-26