Academia.eduAcademia.edu

Outline

Cocon: Computation in Contextual Type Theory

2019, ArXiv

Abstract

We describe a Martin-Lof style dependent type theory, called Cocon, that allows us to mix the intensional function space that is used to represent higher-order abstract syntax (HOAS) trees with the extensional function space that describes (recursive) computations. We mediate between HOAS representations and computations using contextual modal types. Our type theory also supports an infinite hierarchy of universes and hence supports type-level computation -- thereby providing metaprogramming and (small-scale) reflection. Our main contribution is the development of a Kripke-style model for Cocon that allows us to prove normalization. From the normalization proof, we derive subject reduction and consistency. Our work lays the foundation to incorporate the methodology of logical frameworks into systems such as Agda and bridges the longstanding gap between these two worlds.

References (27)

  1. A. Abel and G. Scherer. On irrelevance and algorithmic equality in predicative type theory. Logical Methods in Computer Science, 8(1), 2012. doi: 10.2168/LMCS-8(1:29)2012. URL h ps://doi.org/10.2168/LMCS-8(1:29)2012.
  2. A. Abel, J. Öhman, and A. Vezzosi. Decidability of conversion for type theory in type theory. 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'18), PACMPL 2(POPL):23:1-23:29, 2018.
  3. Y. Bertot and P. Castéran. Interactive eorem Proving and Program Development. Coq'Art: e Calculus of Inductive Constructions. Springer, 2004.
  4. A. Cave and B. Pientka. Programming with binders and indexed data-types. In 39th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'12), pages 413-424. ACM Press, 2012.
  5. A. J. Chlipala. Parametric higher-order abstract syntax for mechanized semantics. In J. Hook and P. iemann, editors, 13th ACM SIGPLAN International Conference on Functional Programming (ICFP'08), pages 143-156. ACM, 2008.
  6. D. R. Christiansen. Type-directed elaboration of quasiquotations: A high-level syntax for low-level reflection. In Proceedings of the 26nd International Symposium on Implementation and Application of Functional Languages (IFL'14), pages 1:1-1:9. ACM, 2014. ISBN 978-1-4503-3284-2. doi: 10.1145/ 2746325.2746326. URL h p://doi.acm.org/10.1145/2746325.2746326.
  7. D. R. Christiansen. Practical Reflection and Metaprogramming for Dependent Types,. PhD thesis, IT University Copenhagen, Denmark, 2015.
  8. R. Davies and F. Pfenning. A modal analysis of staged computation. Journal of the ACM, 48(3):555-604, 2001. doi: 10.1145/382780.382785. J. Despeyroux and P. Leleu. Primitive recursion for higher order abstract syntax with dependent types. In International Workshop on Intuitionistic Modal Logics and Applications (IMLA), 1999.
  9. J. Despeyroux, A. P. Felty, and A. Hirschowitz. Higher-order abstract syntax in coq. In M. Dezani-Ciancaglini and G. D. Plotkin, editors, 2nd International Conference on Typed Lambda Calculi and Applications (TLCA '95), Lecture Notes in Computer Science (LNCS 902), pages 124-138. Springer, 1995. doi: 10.1007/BFb0014049. URL h ps://doi.org/10.1007/BFb0014049.
  10. J. Despeyroux, F. Pfenning, and C. Schürmann. Primitive recursion for higher-order abstract syntax. In Proceedings of the ird International Conference on Typed Lambda Calculus and Applications (TLCA'97), pages 147-163. Springer, 1997. Extended version available as Technical Report CMU-CS-96-172, Carnegie Mellon University.
  11. G. Ebner, S. Ullrich, J. Roesch, J. Avigad, and L. de Moura. A metaprogramming framework for formal verification. Proc. ACM Program. Lang., 1(ICFP): 34:1-34:29, Aug. 2017. ISSN 2475-1421. doi: 10.1145/3110278. URL h p://doi.acm.org/10.1145/3110278.
  12. A. Felty and A. Momigliano. Hybrid: A definitional two-level approach to reasoning with higher-order abstract syntax. Journal of Automated Reasoning, 48(1):43-105, 2012.
  13. R. Harper and F. Pfenning. On equivalence and canonical forms in the LF type theory. ACM Transactions on Computational Logic, 6(1):61-101, 2005.
  14. R. Harper, F. Honsell, and G. Plotkin. A framework for defining logics. Journal of the ACM, 40(1):143-184, January 1993.
  15. R. Jacob-Rao, B. Pientka, and D. ibodeau. Index-stratified types. In H. Kirchner, editor, 3rdd International Conference on Formal Structures for Compu- tation and Deduction (FSCD'18), LIPIcs. Schloss Dagstuhl -Leibniz-Zentrum für Informatik, January 2018.
  16. P. Martin-Löf. An intuitionistic theory of types: predicative part. In H. E. Rose and J. C. Shepherdson, editors, Logic Colloquium '73, Amsterdam, 1973. North-Holland.
  17. A. Nanevski, F. Pfenning, and B. Pientka. Contextual modal type theory. ACM Transactions on Computational Logic, 9(3):1-49, 2008.
  18. U. Norell. Towards a practical programming language based on dependent type theory. PhD thesis, Department of Computer Science and Engineering, Chalmers University of Technology, Sept. 2007. Technical Report 33D.
  19. B. Pientka. A type-theoretic foundation for programming with higher-order abstract syntax and first-class substitutions. In 35th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'08), pages 371-382. ACM Press, 2008.
  20. B. Pientka and A. Abel. Structural recursion over contextual objects. In T. Altenkirch, editor, 13th International Conference on Typed Lambda Calculi and Applications (TLCA'15), pages 273-287. Leibniz International Proceedings in Informatics (LIPIcs) of Schloss Dagstuhl, 2015.
  21. B. Pientka and A. Cave. Inductive Beluga:Programming Proofs (System Description). In A. P. Felty and A. Middeldorp, editors, 25th International Conference on Automated Deduction (CADE-25), Lecture Notes in Computer Science (LNCS 9195), pages 272-281. Springer, 2015.
  22. B. Pientka and J. Dunfield. Beluga: a framework for programming and reasoning with deductive systems (System Description). In J. Giesl and R. Haehnle, editors, 5th International Joint Conference on Automated Reasoning (IJCAR'10), Lecture Notes in Artificial Intelligence (LNAI 6173), pages 15-21. Springer, 2010.
  23. D. S. Sco . Data types as la ices. SIAM Journal on Computing, 5(3):522-587, 1976. doi: 10.1137/0205037. URL h ps://doi.org/10.1137/0205037.
  24. P. van Der Walt and W. Swierstra. Engineering proof by reflection in agda. In R. Hinze, editor, Implementation and Application of Functional Languages, Lecture Notes in Computer Science (LNCS 8241), pages 157-173. Springer, 2012.
  25. B. Werner. A normalization proof for an impredicative type system with large elimination over integers. In International Workshop on Types for Proofs and Programs (TYPES), pages 341-357, 1992.
  26. H. Xi and F. Pfenning. Dependent types in practical programming. In 26th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL'99), pages 214-227. ACM Press, 1999.
  27. C. Zenger. Indexed types. eoretical Computer Science, 187(1-2):147-165, 1997.