ABSTRACT
We present a Coq formalization of the normalization-by-evaluation algorithm for Martin-Löf dependent type theory with one universe and judgmental equality. The end results of the formalization are certified implementations of a reduction-free normalizer and of a decision procedure for term equality.
The formalization takes advantage of a graph-based variant of the Bove-Capretta method to encode mutually recursive evaluation functions with nested recursive calls. The proof of completeness, which uses the PER-model of dependent types, is formalized by relying on impredicativity of the Coq system rather than on the commonly used induction-recursion scheme which is not available in Coq. The proof of soundness is formalized by encoding logical relations as partial functions.
Supplemental Material
Available for Download
Source code for coq formalization
- Martín Abadi, Luca Cardelli, Pierre-Louis Curien, and Jean-Jacques Lévy. 1991. Explicit Substitutions. J. Funct. Program. 1, 4 (1991), 375s416.Google ScholarCross Ref
- Andreas Abel. 2010. Towards Normalization by Evaluation for the ß¿-Calculus of Constructions. In Functional and Logic Programming, 10th International Symposium, FLOPS 2010, Sendai, Japan, April 19-21, 2010. Proceedings (Lecture Notes in Computer Science), Matthias Blume, Naoki Kobayashi, and German Vidal (Eds.), Vol. 6009. Springer, 224s239. Google ScholarDigital Library
- Andreas Abel, Klaus Aehlig, and Peter Dybjer. 2007a. Normalization by Evaluation for Martin-Lof Type Theory with One Universe. Electr. Notes Theor. Comput. Sci. 173 (2007), 17-39. Google ScholarDigital Library
- Andreas Abel and James Chapman. 2014. Normalization by Evaluation in the Delay Monad: A Case Study for Coinduction via Copatterns and Sized Types. In Proceedings 5th Workshop on Mathematically Structured Functional Programming, MSFP@ETAPS 2014, Grenoble, France, 12 April 2014. (EPTCS), Paul Levy and Neel Krishnaswami (Eds.), Vol. 153. 51-67.Google ScholarCross Ref
- Andreas Abel, Thierry Coquand, and Peter Dybjer. 2007b. Normalization by Evaluation for Martin-Lof Type Theory with Typed Equality Judgements. In 22nd IEEE Symposium on Logic in Computer Science (LICS 2007), 10-12 July 2007, Wroclaw, Poland, Proceedings. IEEE Computer Society, 3-12. Google ScholarDigital Library
- Andreas Abel, Thierry Coquand, and Miguel Pagano. 2009. A Modular Type-Checking Algorithm for Type Theory with Singleton Types and Proof Irrelevance. In Typed Lambda Calculi and Applications, 9th International Conference, TLCA 2009, Brasilia, Brazil, July 1-3, 2009. Proceedings (Lecture Notes in Computer Science), Pierre-Louis Curien (Ed.), Vol. 5608. Springer, 5s19. Google ScholarDigital Library
- Robin Adams. 2006. Pure Type Systems with Judgemental Equality. J. Funct. Program. 16, 2 (2006), 219-246. Google ScholarDigital Library
- Klaus Aehlig and Felix Joachimski. 2004. Operational aspects of untyped Normalisation by Evaluation. Mathematical Structures in Computer Science 14, 4 (2004), 587s611. Google ScholarDigital Library
- Thorsten Altenkirch and Ambrus Kaposi. 2016. Normalisation by Evaluation for Dependent Types. In 1st International Conference on Formal Structures for Computation and Deduction, FSCD 2016, June 22-26, 2016, Porto, Portugal (LIPIcs), Delia Kesner and Brigitte Pientka (Eds.), Vol. 52. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik, 6:1-6:16.Google Scholar
- Bruno Barras and BenjaminWerner. 1997. Coq in Coq. (1997). Unpublished note.Google Scholar
- Ulrich Berger, Stefan Berghofer, Pierre Letouzey, and Helmut Schwichtenberg. 2006. Program Extraction from Normalization Proofs. Studia Logica 82, 1 (2006), 25s49.Google Scholar
- Ulrich Berger and Helmut Schwichtenberg. 1991. An Inverse of the Evaluation Functional for Typed lambda-calculus. In Proceedings of the Sixth Annual Symposium on Logic in Computer Science (LICS '91), Amsterdam, The Netherlands, July 15-18, 1991, Giles Kahn (Ed.). IEEE Computer Society, 203-211.Google ScholarCross Ref
- Yves Bertot and Pierre Castéran. 2004. Interactive Theorem Proving and Program Development - Coq'Art: The Calculus of Inductive Constructions. Springer. Google ScholarDigital Library
- Ana Bove. 2009. Another Look at Function Domains. Electr. Notes Theor. Comput. Sci. 249 (2009), 61-74. Google ScholarDigital Library
- Ana Bove and Venanzio Capretta. 2001. Nested General Recursion and Partiality in Type Theory. In Theorem Proving in Higher Order Logics, 14th International Conference, TPHOLs 2001, Edinburgh, Scotland, UK, September 3-6, 2001, Proceedings (Lecture Notes in Computer Science), Richard J. Boulton and Paul B. Jackson (Eds.), Vol. 2152. Springer, 121- 135. Google ScholarDigital Library
- Alexandre Buisse and Peter Dybjer. 2008. Towards Formalizing Categorical Models of Type Theory in Type Theory. Electr. Notes Theor. Comput. Sci. 196 (2008), 137-151. Google ScholarDigital Library
- Thierry Coquand and Peter Dybjer. 1997. Intuitionistic Model Constructions and Normalization Proofs. Mathematical Structures in Computer Science 7, 1 (1997), 75-94. Google ScholarDigital Library
- Nils Anders Danielsson. 2006. A Formalisation of a Dependently Typed Language as an Inductive-Recursive Family. In Types for Proofs and Programs, International Workshop, TYPES 2006, Nottingham, UK, April 18-21, 2006, Revised Selected Papers (Lecture Notes in Computer Science), Thorsten Altenkirch and Conor McBride (Eds.), Vol. 4502. Springer, 93- 109. Google ScholarDigital Library
- Peter Dybjer. 2000. A General Formulation of Simultaneous Inductive-Recursive Definitions in Type Theory. J. Symb. Log. 65, 2 (2000), 525-549.Google ScholarCross Ref
- Andrzej Filinski and Henning Korsholm Rohde. 2004. A Denotational Account of Untyped Normalization by Evaluation. In Foundations of Software Science and Computation Structures, 7th International Conference, FOSSACS 2004, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2004, Barcelona, Spain, March 29 - April 2, 2004, Proceedings (Lecture Notes in Computer Science), Igor Walukiewicz (Ed.), Vol. 2987. Springer, 167s181.Google ScholarCross Ref
- François Garillot and Benjamin Werner. 2007. Simple Types in Type Theory: Deep and Shallow Encodings. In Theorem Proving in Higher Order Logics, 20th International Conference, TPHOLs 2007, Kaiserslautern, Germany, September 10-13, 2007, Proceedings (Lecture Notes in Computer Science), Klaus Schneider and Jens Brandt (Eds.), Vol. 4732. Springer, 368-382. Google ScholarDigital Library
- Jean-Yves Girard, Paul Taylor, and Yves Lafont. 1989. Proofs and Types. Cambridge University Press. Google ScholarDigital Library
- Peter Hancock, Conor McBride, Neil Ghani, Lorenzo Malatesta, and Thorsten Altenkirch. 2013. Small Induction Recursion. In Typed Lambda Calculi and Applications, 11th International Conference, TLCA 2013, Eindhoven, The Netherlands, June 26-28, 2013. Proceedings (Lecture Notes in Computer Science), Masahito Hasegawa (Ed.), Vol. 7941. Springer, 156- 172.Google Scholar
- Robert Pieter Nederpelt Lazarom. 1973. Strong Normalization in a Typed Lambda Calculus with Lambda Structured Types. Ph.D. Dissertation. Technische Universiteit Eindhoven.Google Scholar
- Pierre Letouzey. 2008. Extraction in Coq: An Overview. In Logic and Theory of Algorithms, 4th Conference on Computability in Europe, CiE 2008, Athens, Greece, June 15-20, 2008, Proceedings (Lecture Notes in Computer Science), Arnold Beckmann, Costas Dimitracopoulos, and Benedikt Löwe (Eds.), Vol. 5028. Springer, 359s369. Google ScholarDigital Library
- Per Martin-Löf. 1998. An Intuitionistic Theory of Types. In Twenty-Five Years of Constructive Type Theory, Giovanni Sambin and Jan M. Smith (Eds.). Oxford University Press.Google Scholar
- Bengt Nordström, Kent Petersson, and Jan M. Smith. 1990. Programming in Martin-Löf's Type Theory: An Introduction. Oxford University Press. Google ScholarDigital Library
- Miguel Pagano. 2012. Type-Checking and Normalisation By Evaluation For Dependent Type Systems. Ph.D. Dissertation. Universidad Nacional De Córdoba.Google Scholar
- Matthieu Sozeau. 2007. A Dependently-Typed Formalization of Simply-Typed Lambda-Calculus: Substitution, Denotation, Normalization. (2007). Unpublished note.Google Scholar
Index Terms
- A Coq formalization of normalization by evaluation for Martin-Löf type theory
Recommendations
Call-by-push-value in Coq: operational, equational, and denotational theory
CPP 2019: Proceedings of the 8th ACM SIGPLAN International Conference on Certified Programs and ProofsCall-by-push-value (CBPV) is an idealised calculus for functional and imperative programming, introduced as a subsuming paradigm for both call-by-value (CBV) and call-by-name (CBN). We formalise weak and strong operational semantics for (effect-free) ...
Completeness and decidability of converse PDL in the constructive type theory of Coq
CPP 2018: Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and ProofsThe completeness proofs for Propositional Dynamic Logic (PDL) in the literature are non-constructive and usually presented in an informal manner. We obtain a formal and constructive completeness proof for Converse PDL by recasting a completeness proof ...
Normalization by Evaluation for Martin-Löf Type Theory with One Universe
We present an algorithm for computing normal terms and types in Martin-Lof type theory with one universe and eta-conversion. We prove that two terms or types are equal in the theory iff the normal forms are identical (as de Bruijn terms). It thus ...
Comments