Abstract
Modalities are everywhere in programming and mathematics! Despite this, however, there are still significant technical challenges in formulating a core dependent type theory with modalities. We present a dependent type theory MLTT🔒 supporting the connectives of standard Martin-Löf Type Theory as well as an S4-style necessity operator. MLTT🔒 supports a smooth interaction between modal and dependent types and provides a common basis for the use of modalities in programming and in synthetic mathematics. We design and prove the soundness and completeness of a type checking algorithm for MLTT🔒, using a novel extension of normalization by evaluation. We have also implemented our algorithm in a prototype proof assistant for MLTT🔒, demonstrating the ease of applying our techniques.
Supplemental Material
- Martín Abadi, Anindya Banerjee, Nevin Heintze, and Jon G. Riecke. 1999. A Core Calculus of Dependency. Conference Record of the Annual ACM Symposium on Principles of Programming Languages, 147–160. Google Scholar
Digital Library
- Andreas Abel. 2009. Extensional normalization in the logical framework with proof irrelevant equality. In 2009 Workshop on Normalization by Evaluation.Google Scholar
- Andreas Abel. 2013. Normalization by Evaluation: Dependent Types and Impredicativity.Google Scholar
- Andreas Abel, Klaus Aehlig, and Peter Dybjer. 2007. Normalization by Evaluation for Martin-LöF Type Theory with One Universe. Electron. Notes Theor. Comput. Sci. 173 (April 2007), 17–39. Google Scholar
Digital 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, Pierre-Louis Curien (Ed.). Springer Berlin Heidelberg, 5–19. Google Scholar
Digital Library
- Andreas Abel, Andrea Vezzosi, and Theo Winterhalter. 2017. Normalization by Evaluation for Sized Dependent Types. Proc. ACM Program. Lang. 1, ICFP (Aug. 2017), 33:1–33:30. Google Scholar
Digital Library
- Stuart Frazier Allen. 1987. A non-type-theoretic semantics for type-theoretic language.Google Scholar
- Thorsten Altenkirch, Martin Hofmann, and Thomas Streicher. 1995. Categorical reconstruction of a reduction free normalization proof. In Category Theory and Computer Science, David Pitt, David E. Rydeheard, and Peter Johnstone (Eds.). Springer Berlin Heidelberg, 182–199. Google Scholar
Digital Library
- Carlo Angiuli. 2019. Computational Semantics of Cartesian Cubical Type Theory. Ph.D. Dissertation. Carnegie Mellon University, Pittsburgh, PA, USA. To appear.Google Scholar
- Carlo Angiuli, Guillaume Brunerie, Thierry Coquand, Kuen-Bang Hou (Favonia), Robert Harper, and Daniel R. Licata. 2019. Cartesian Cubical Type Theory. (Feb. 2019). https://github.com/dlicata335/cart-cube Preprint.Google Scholar
- P. Bahr, H. B. Grathwohl, and R. E. Møgelberg. 2017. The clocks are ticking: No more delays!. In 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). 1–12. Google Scholar
Digital Library
- Ulrich Berger and H Schwichtenberg. 1991. An inverse of the evaluation functional for typed λ-calculus. Proceedings -Symposium on Logic in Computer Science, 203–211.Google Scholar
Cross Ref
- Lars Birkedal, Aleš Bizjak, Ranald Clouston, Hans Bugge Grathwohl, Bas Spitters, and Andrea Vezzosi. 2016. Guarded Cubical Type Theory: Path Equality for Guarded Recursion. In 25th EACSL Annual Conference on Computer Science Logic (CSL 2016) (Leibniz International Proceedings in Informatics (LIPIcs)), Jean-Marc Talbot and Laurent Regnier (Eds.), Vol. 62. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 23:1–23:17.Google Scholar
- Lars Birkedal, Rasmus Ejlers Møgelberg, Jan Schwinghammer, and Kristian Stovring. 2011. First Steps in Synthetic Guarded Domain Theory: Step-Indexing in the Topos of Trees. In Proceedings of the 2011 IEEE 26th Annual Symposium on Logic in Computer Science (LICS ’11). IEEE Computer Society, 55–64. Google Scholar
Digital Library
- Aleš Bizjak and Lars Birkedal. 2018. On Models of Higher-Order Separation Logic. Electr. Notes Theor. Comput. Sci. 336 (2018), 57–78.Google Scholar
Cross Ref
- Aleš Bizjak, Hans Bugge Grathwohl, Ranald Clouston, Rasmus E. Møgelberg, and Lars Birkedal. 2016. Guarded Dependent Type Theory with Coinductive Types. In Foundations of Software Science and Computation Structures: 19th International Conference, FOSSACS 2016, Held as Part of the European Joint Conferences on Theory and Practice of Software, ETAPS 2016, Eindhoven, The Netherlands, April 2–8, 2016, Proceedings, Bart Jacobs and Christof Löding (Eds.). Springer Berlin Heidelberg, 20–35.Google Scholar
- Aleš Bizjak and Rasmus Ejlers Møgelberg. 2015. A Model of Guarded Recursion With Clock Synchronisation. Electron. Notes Theor. Comput. Sci. 319, C (Dec. 2015), 83–101. Google Scholar
Digital Library
- Mathieu Boespflug and Brigitte Pientka. 2011. Multi-level Contextual Type Theory. Electronic Proceedings in Theoretical Computer Science 71 (Oct. 2011).Google Scholar
- V. A. J. Borghuis. 1994. Coming to terms with modal logic : on the interpretation of modalities in typed lambda-calculus.Google Scholar
- Peter Brottveit Bock and Carsten Schürmann. 2015. A Contextual Logical Framework, Vol. 9450. 402–417.Google Scholar
- Ranald Clouston. 2018. Fitch-Style Modal Lambda Calculi. In Foundations of Software Science and Computation Structures, Christel Baier and Ugo Dal Lago (Eds.). Springer International Publishing, 258–275.Google Scholar
- Ranald Clouston, Aleš Bizjak, Hans Bugge Grathwohl, and Lars Birkedal. 2015. Programming and Reasoning with Guarded Recursion for Coinductive Types. In Foundations of Software Science and Computation Structures, Andrew Pitts (Ed.). Springer Berlin Heidelberg, 407–421.Google Scholar
- Ranald Clouston, Bassel Mannaa, Rasmus Ejlers Møgelberg, Andrew M. Pitts, and Bas Spitters. 2018. Modal Dependent Type Theory and Dependent Right Adjoints. (2018). https://arxiv.org/abs/1804.05236Google Scholar
- The Coq Development Team. 2016. The Coq Proof Assistant Reference Manual.Google Scholar
- Thierry Coquand. 1996. An algorithm for type-checking dependent types. Science of Computer Programming 26, 1 (1996), 167–177. Google Scholar
Digital Library
- Thierry Coquand. 2018. Canonicity and normalization for Dependent Type Theory. https://arxiv.org/abs/1810.09367Google Scholar
- Rowan Davies and Frank Pfenning. 1999. A Modal Analysis of Staged Computation. J. ACM 48 (Sept. 1999). Google Scholar
Digital Library
- Jeff Epstein, Andrew Black, and Simon Peyton Jones. 2011. Towards Haskell in the cloud. https://www.microsoft.com/enus/research/publication/towards-haskell-cloud/Google Scholar
- Marcelo Fiore. 2002. Semantic Analysis of Normalisation by Evaluation for Typed Lambda Calculus. In Proceedings of the 4th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming (PPDP ’02). ACM, 26–37. Google Scholar
Digital Library
- Peter Freyd. 1991. Algebraically complete categories. In Category Theory, Aurelio Carboni, Maria Cristina Pedicchio, and Guiseppe Rosolini (Eds.). Springer Berlin Heidelberg, 95–104.Google Scholar
- Johan G. Granström. 2013. Treatise on Intuitionistic Type Theory. Springer Publishing Company, Incorporated. Google Scholar
Digital Library
- Adrien Guatto. 2018. A Generalized Modality for Recursion. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09-12, 2018. 482–491. Google Scholar
Digital Library
- Robert Harper and Daniel R. Licata. 2007. Mechanizing Metatheory in a Logical Framework. Journal of Functional Programming 17, 4-5 (July 2007), 613–673. Google Scholar
Digital Library
- G. A. Kavvos. 2017. Dual-Context Calculi for Modal Logic. In Proceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). http://arxiv.org/abs/1602.04860 Google Scholar
Digital Library
- Robbert Krebbers, Ralf Jung, Aleš Bizjak, Jacques-Henri Jourdan, Derek Dreyer, and Lars Birkedal. 2017. The Essence of Higher-Order Concurrent Separation Logic. In European Symposium on Programming. Google Scholar
Digital Library
- F. William Lawvere. 1992. Categories of Space and of Quantity. In The Space of Mathematics, Javier Echeverria, Andoni Ibarra, and Thomas Mormann (Eds.). De Gruyter, 14–30.Google Scholar
- F. William Lawvere. 2007. Axiomatic Cohesion. Theory and Applications of Categories 19 (June 2007).Google Scholar
- Daniel R. Licata, Ian Orton, Andrew M. Pitts, and Bas Spitters. 2018. Internal Universes in Models of Homotopy Type Theory. In 3rd International Conference on Formal Structures for Computation and Deduction, FSCD 2018, July 9-12, 2018, Oxford, UK. 22:1–22:17.Google Scholar
- Daniel R. Licata, Michael Shulman, and Mitchell Riley. 2017. A Fibrational Framework for Substructural and Modal Logics. In 2nd International Conference on Formal Structures for Computation and Deduction (FSCD 2017) (Leibniz International Proceedings in Informatics (LIPIcs)), Dale Miller (Ed.), Vol. 84. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 25:1– 25:22.Google Scholar
- Bassel Mannaa and Rasmus Ejlers Møgelberg. 2018. The Clocks They Are Adjunctions Denotational Semantics for Clocked Type Theory. In 3rd International Conference on Formal Structures for Computation and Deduction (FSCD 2018) (Leibniz International Proceedings in Informatics (LIPIcs)), Hélène Kirchner (Ed.), Vol. 108. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 23:1–23:17.Google Scholar
- Per Martin-Löf. 1975. An Intuitionistic Theory of Types: Predicative Part. In Logic Colloquium ’73, H. E. Rose and J. C. Shepherdson (Eds.). Studies in Logic and the Foundations of Mathematics, Vol. 80. Elsevier, 73–118.Google Scholar
- Per Martin-Löf. 1992. Substitution calculus. Notes from a lecture given in Göteborg.Google Scholar
- Per Martin-Löf. 1996. On the meanings of the logical constants and the justifications of the logical laws. Nordic Journal of Philosophical Logic 1, 1 (1996), 11–60.Google Scholar
- Simone Martini and Andrea Masini. 1996. A Computational Interpretation of Modal Proofs. Springer Netherlands, Dordrecht, 213–241.Google Scholar
- Conor McBride and Ross Paterson. 2008. Applicative Programming with Effects. J. Funct. Program. 18, 1 (Jan. 2008), 1–13. Google Scholar
Digital Library
- Tom Murphy, VII. 2008. Modal Types for Mobile Code. http://tom7.org/papers/ Available as technical report CMU-CS-08-126.Google Scholar
Digital Library
- Tom Murphy, VII, Karl Crary, Robert Harper, and Frank Pfenning. 2004. A Symmetric Modal Lambda Calculus for Distributed Computing. In Proceedings of the 19th IEEE Symposium on Logic in Computer Science (LICS 2004). IEEE Press. Google Scholar
Digital Library
- Aleksandar Nanevski, Frank Pfenning, and Brigitte Pientka. 2008. Contextual modal type theory. ACM Transactions Computational Logic 9 (June 2008). Google Scholar
Digital Library
- Ulf Norell. 2007. Towards a practical programming language based on dependent type theory. Ph.D. Dissertation. Department of Computer Science and Engineering, Chalmers University of Technology.Google Scholar
- Frank Pfenning and Rowan Davies. 2000. A Judgmental Reconstruction of Modal Logic. Mathematical Structures in Computer Science 11 (Feb. 2000). Google Scholar
Digital Library
- Brigitte Pientka, Andreas Abel, Francisco Ferreira, David Thibodeau, and Rébecca Zucchini. 2019. A Type Theory for Defining Logics and Proofs. In Proceedings of the 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS).Google Scholar
Cross Ref
- Benjamin C. Pierce and David N. Turner. 2000. Local type inference. ACM Transactions Programming Language and Systems 22, 1 (2000), 1–44. Google Scholar
Digital Library
- Dag Prawitz. 1967. Natural Deduction. A Proof-Theoretical Study. Journal of Symbolic Logic 32, 2 (1967), 255–256.Google Scholar
- Urs Schreiber. 2013. Differential cohomology in a cohesive infinity-topos. arXiv e-prints, Article arXiv:1310.7930 (Oct 2013), arXiv:1310.7930 pages. arXiv: math-ph/1310.7930Google Scholar
- Urs Schreiber and Michael Shulman. 2014. Quantum Gauge Field Theory in Cohesive Homotopy Type Theory. In Proceedings 9th Workshop on Quantum Physics and Logic Brussels, Belgium, 10-12 October 2012. 109–126.Google Scholar
Cross Ref
- Peter Schroeder-Heister. 1987. Structural Frameworks with Higher-level Rules: Philosophical Investigations on the Foundations of Formal Reasoning. Habilitation thesis.Google Scholar
- Michael Shulman. 2018. Brouwer’s fixed-point theorem in real-cohesive homotopy type theory. Mathematical Structures in Computer Science 28, 6 (2018), 856–941.Google Scholar
- Thomas Streicher. 1998. Categorical intuitions underlying semantic normalisation proofs. In Preliminary Proceedings of the APPSEM Workshop on Normalisation by Evaluation, O. Danvy and P. Dybjer (Eds.). Department of Computer Science, Aarhus University.Google Scholar
- The Agda Development Team. 2018. agda-flat. https://github.com/agda/agda/tree/flatGoogle Scholar
- The Univalent Foundations Program. 2013. Homotopy Type Theory: Univalent Foundations of Mathematics. https: //homotopytypetheory.org/book .Google Scholar
- Paweł Wieczorek and Dariusz Biernacki. 2018. A Coq Formalization of Normalization by Evaluation for Martin-Löf Type Theory. In Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP 2018). ACM, 266–279. Google Scholar
Digital Library
Index Terms
Implementing a modal dependent type theory
Recommendations
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 ...
Type Theory based on Dependent Inductive and Coinductive Types
LICS '16: Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer ScienceWe develop a dependent type theory that is based purely on inductive and coinductive types, and the corresponding recursion and corecursion principles. This results in a type theory with a small set of rules, while still being fairly expressive. For ...
Decidability of conversion for type theory in type theory
Type theory should be able to handle its own meta-theory, both to justify its foundational claims and to obtain a verified implementation. At the core of a type checker for intensional type theory lies an algorithm to check equality of types, or in ...








Comments