Hostname: page-component-7479d7b7d-q6k6v Total loading time: 0 Render date: 2024-07-11T23:00:58.308Z Has data issue: false hasContentIssue false

Denotational semantics for guarded dependent type theory

Published online by Cambridge University Press:  08 May 2020

Aleš Bizjak
Affiliation:
Department of Computer Science, Aarhus University, Aarhus N, Denmark
Rasmus Ejlers Møgelberg*
Affiliation:
Department of Computer Science, IT University of Copenhagen, Copenhagen, Denmark
*
*Corresponding author. Email: mogel@itu.dk

Abstract

We present a new model of guarded dependent type theory (GDTT), a type theory with guarded recursion and multiple clocks in which one can program with and reason about coinductive types. Productivity of recursively defined coinductive programs and proofs is encoded in types using guarded recursion and can therefore be checked modularly, unlike the syntactic checks implemented in modern proof assistants. The model is based on a category of covariant presheaves over a category of time objects, and quantification over clocks is modelled using a presheaf of clocks. To model the clock irrelevance axiom, crucial for programming with coinductive types, types must be interpreted as presheaves internally right orthogonal to the object of clocks. In the case of dependent types, this translates to a lifting condition similar to the one found in homotopy theoretic models of type theory, but here with an additional requirement of uniqueness of lifts. Since the universes defined by the standard Hofmann–Streicher construction in this model do not satisfy this property, the universes in GDTT must be indexed by contexts of clock variables. We show how to model these universes in such a way that inclusions of clock contexts give rise to inclusions of universes commuting with type operations on the nose.

Type
Paper
Copyright
© The Author(s) 2020. Published by Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Abel, A. and Pientka, B. (2013). Wellfounded recursion with copatterns: A unified approach to termination and productivity. In: Proceedings ICFP 2013, ACM, 185–196. https://dl.acm.org/doi/10.1145/2544174.2500591CrossRefGoogle Scholar
Abel, A., Vezzosi, A. and Winterhalter, T. (2017). Normalization by evaluation for sized dependent types. PACMPL 1 (ICFP) 33:133:30. https://doi.org/10.1145/3110277Google Scholar
Anel, M., Biedermann, G., Finster, E. and Joyal, A. (2017). A generalized Blakers-Massey theorem. arXiv preprint arXiv:1703.09050.Google Scholar
Appel, A. W. and McAllester, D. A. (2001). An indexed model of recursive types for foundational proof-carrying code. ACM Transactions on Programming Languages and Systems 23 (5) 657683.CrossRefGoogle Scholar
Appel, A. W., Melliès, P., Richards, C. D. and Vouillon, J. (2007). A very modal model of a modern, major, general type system. In: Hofmann, M. and Felleisen, M. (eds.) POPL, ACM, 109–122.CrossRefGoogle Scholar
Atkey, R. and McBride, C. (2013). Productive coprogramming with guarded recursion. In: Proceedings of ICFP 2013, ACM, 197208.CrossRefGoogle Scholar
Awodey, S. and Warren, M. A. (2009). Homotopy theoretic models of identity types. In: Mathematical Proceedings of the Cambridge Philosophical Society, Vol. 146, Cambridge University Press, 45–55. doi:10.1017/S0305004108001783Google Scholar
Bahr, P., Grathwohl, H. B. and Møgelberg, R. E. (2017). The clocks are ticking: No more delays! In: 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavik, Iceland, IEEE Computer Society, June 20–23, 2017, 112.CrossRefGoogle Scholar
Bezem, M., Coquand, T. and Huber, S. (2013). A model of type theory in cubical sets. In: Matthes, R. and Schubert, A. (eds.) 19th International Conference on Types for Proofs and Programs, TYPES 2013, April 22–26, 2013, Toulouse, France, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 107–128.Google Scholar
Birkedal, L., Bizjak, A., Clouston, R., Grathwohl, H. B., Spitters, B. and Vezzosi, A. (2016). Guarded cubical type theory: Path equality for guarded recursion. In: Talbot, J.-M. and Regnier, L. (eds.) 25th EACSL Annual Conference on Computer Science Logic, CSL 2016, August 29–September 1, 2016, Marseille, France, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 23:1–23:17.Google Scholar
Birkedal, L., Grathwohl, H. B., Bizjak, A. and Clouston, R. (2017). The guarded lambda-calculus: Programming and reasoning with guarded recursion for coinductive types. Logical Methods in Computer Science 12.Google Scholar
Birkedal, L., Møgelberg, R. E., Schwinghammer, J. and Støvring, K. (2012). First steps in synthetic guarded domain theory: Step-indexing in the topos of trees. Logical Methods in Computer Science 8(4).CrossRefGoogle Scholar
Bizjak, A., Birkedal, L. and Miculan, M. (2014). A model of countable nondeterminism in guarded type theory. In: RTA-TLCA, 108–123.CrossRefGoogle Scholar
Bizjak, A., Grathwohl, H. B., Clouston, R., Møgelberg, R. E. and Birkedal, L. (2016). Guarded dependent type theory with coinductive types. In: Jacobs, B. and Löding, C. (eds.) FoSSaCS, Springer, 20–35.CrossRefGoogle Scholar
Bizjak, A. and Møgelberg, R. E. (2015). A model of guarded recursion with clock synchronisation. Electronic Notes in Theoretical Computer Science 319 83101. The 31st Conference on the Mathematical Foundations of Programming Semantics (MFPS XXXI).CrossRefGoogle Scholar
Cohen, C., Coquand, T., Huber, S. and Mörtberg, A. (2016). Cubical type theory: a constructive interpretation of the univalence axiom. CoRR abs/1611.02108. http://arxiv.org/abs/1611.02108Google Scholar
Danielsson, N. A. (2010). Beating the productivity checker using embedded languages. In: PAR, Vol. 43, 2948.CrossRefGoogle Scholar
Dybjer, P. (1995). Internal type theory. In: International Workshop on Types for Proofs and Programs, Springer, 120–134.Google Scholar
Hofmann, M. (1994). On the interpretation of type theory in locally cartesian closed categories. In: Proceedings of Computer Science Logic, Lecture Notes in Computer Science, Springer, 427–441.Google Scholar
Hofmann, M. (1997). Syntax and semantics of dependent types. In: Extensional Constructs in Intensional Type Theory, Springer, 13–54. https://dblp.org/rec/bibtex/conf/csl/1997Google Scholar
Hofmann, M. and Streicher, T. (1999), Lifting Grothendieck universes. Unpublished. www.mathematik.tu-darmstadt.de/streicher/NOTES/lift.pdfGoogle Scholar
Hughes, J., Pareto, L. and Sabry, A. (1996). Proving the correctness of reactive systems using sized types. In: Conference Record of POPL 1996: The 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Papers Presented at the Symposium, St. Petersburg Beach, Florida, USA, January 21–24, 1996, 410423. https://dl.acm.org/doi/proceedings/10.1145/237721CrossRefGoogle Scholar
Hyland, J. M. E., Robinson, E. P. and Rosolini, G. (1990). The discrete objects in the effective topos. Proceedings of the London Mathematical Society 3 (1) 136.CrossRefGoogle Scholar
Kapulkin, C. and Lumsdaine, P. L. (2012). The simplicial model of univalent foundations (after voevodsky), CoRR abs/1211.2851. https://arxiv.org/abs/1211.2851Google Scholar
Luo, Z. (1994). Computation and Reasoning. A Type Theory for Computer Science, Vol. 11. International Series of Monographs on Computer Science, Oxford University Press.Google Scholar
MacLane, S. (1998). Categories for the Working Mathematician. Graduate Texts in Mathematics, Second edn, New York, Springer.Google Scholar
Mannaa, B. and Møgelberg, R. E. (2018). The clocks they are adjunctions denotational semantics for clocked type theory, In: Kirchner, H. (ed.) 3rd International Conference on Formal Structures for Computation and Deduction, FSCD 2018, July 9–12, 2018, Oxford, UK, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 23:1–23:17.Google Scholar
Martin-Löf, P. (1973). An intuitionistic theory of types: Predicative part. In: Rose, H. and Shepherdson, J. (eds.) Logic Colloquium, Amsterdam, North-Holland, 73118.Google Scholar
McBride, C. and Paterson, R. (2008). Applicative programming with effects. Journal of Functional Programming 18 (1) 113.CrossRefGoogle Scholar
Møgelberg, R. E. (2014). A type theory for productive coprogramming via guarded recursion. In: Proceedings of CSL-LICS 2014, ACM, 71:1–71:10. https://dl.acm.org/doi/proceedings/10.1145/2603088CrossRefGoogle Scholar
Møgelberg, R. E. and Paviotti, M. (2016). Denotational semantics of recursive types in synthetic guarded domain theory, In: Grohe, M., Koskinen, E. and Shankar, N. (eds.) Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2016, New York, NY, USA, ACM, July 5–8, 2016, 317–326.CrossRefGoogle Scholar
Nakano, H. (2000). A modality for recursion. In: Proceedings of LICS 2000, IEEE, 255266.CrossRefGoogle Scholar
Norell, U. (2007). Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Chalmers University of Technology.Google Scholar
Sacchini, J. L. (2013). Type-based productivity of stream definitions in the calculus of constructions. In: 28th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2013, New Orleans, LA, USA, June 25–28, 2013, 233–242. https://dl.acm.org/doi/proceedings/10.5555/2591370CrossRefGoogle Scholar
Sterling, J. and Harper, R. (2018). Guarded computational type theory. In: Dawar, A. and Grädel, E. (eds.) Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, ACM, New York, NY, USA, 879–888. http://doi.acm.org/10.1145/3209108.3209153CrossRefGoogle Scholar
Svendsen, K. and Birkedal, L. (2014), Impredicative concurrent abstract predicates. In: Shao, Z. (ed.) ESOP, Springer, 149–168.CrossRefGoogle Scholar
The Coq Development Team (2004). The Coq proof assistant reference manual, LogiCal Project. Version 8.0. http://coq.inria.frGoogle Scholar
Veltri, N. and van der Weide, N. (2019). Guarded recursion in agda via sized types. In: Geuvers, H. (ed.) 4th International Conference on Formal Structures for Computation and Deduction, FSCD 2019, June 24–30, 2019, Dortmund, Germany, Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 32:1–32:19.Google Scholar