Hostname: page-component-848d4c4894-jbqgn Total loading time: 0 Render date: 2024-07-04T16:45:03.427Z Has data issue: false hasContentIssue false

Denotational semantics of recursive types in synthetic guarded domain theory

Published online by Cambridge University Press:  15 May 2018

RASMUS E. MØGELBERG
Affiliation:
IT University of Copenhagen, Copenhagen, Denmark Email: mogel@itu.dk
MARCO PAVIOTTI
Affiliation:
University of Kent, Canterbury, U.K. Email: m.paviotti@kent.ac.uk

Abstract

Just like any other branch of mathematics, denotational semantics of programming languages should be formalised in type theory, but adapting traditional domain theoretic semantics, as originally formulated in classical set theory to type theory has proven challenging. This paper is part of a project on formulating denotational semantics in type theories with guarded recursion. This should have the benefit of not only giving simpler semantics and proofs of properties such as adequacy, but also hopefully in the future to scale to languages with advanced features, such as general references, outside the reach of traditional domain theoretic techniques.

Working in Guarded Dependent Type Theory (GDTT), we develop denotational semantics for Fixed Point Calculus (FPC), the simply typed lambda calculus extended with recursive types, modelling the recursive types of FPC using the guarded recursive types of GDTT. We prove soundness and computational adequacy of the model in GDTT using a logical relation between syntax and semantics constructed also using guarded recursive types. The denotational semantics is intensional in the sense that it counts the number of unfold-fold reductions needed to compute the value of a term, but we construct a relation relating the denotations of extensionally equal terms, i.e., pairs of terms that compute the same value in a different number of steps. Finally, we show how the denotational semantics of terms can be executed inside type theory and prove that executing the denotation of a boolean term computes the same value as the operational semantics of FPC.

Type
Paper
Copyright
Copyright © Cambridge University Press 2018 

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

Altenkirch, T., Capriotti, P., Dijkstra, G., Kraus, N. and Forsberg, F.N. (2018). Quotient inductive-inductive types. In: Proceedings of the 21st International Conference on Foundations of Software Science and Computation Structures (FOSSACS '18), Held as Part of the European Joint Conferences on Theory and Practice of Software (ETAPS '18), April 14–20, Thessaloniki, Greece 293–310.Google Scholar
Appel, A. W. and McAllester, D. (2001). An indexed model of recursive types for foundational proof-carrying code. ACM Transactions on Programming Languages and Systems 23 (5) 657683.Google Scholar
Atkey, R. and McBride, C. (2013). Productive coprogramming with guarded recursion. In: Proceedings of the 6th International Conference on Pumps and Fans with Compressors and Wind Turbines (ICFP '13) 197–208.Google Scholar
Bahr, P., Grathwohl, H.B. and Møgelberg, R.E. (2017). The clocks are ticking: No more delays! In: Proceedings of the 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS '17), Reykjavik, Iceland, June 20–23, 1–12.Google Scholar
Benton, N., Birkedal, L., Kennedy, A. and Varming, C. (2010). Formalizing domains, ultrametric spaces and semantics of programming languages. Unpublished manuscript.Google Scholar
Benton, N., Kennedy, A. and Varming, C. (2009). Some domain theory and denotational semantics in Coq. In: Proceedings of the Theorem Proving in Higher Order Logics (TPHOLs '09).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: Proceedings of the 25th EACSL Annual Conference on Computer Science Logic (CSL '16).Google Scholar
Birkedal, L., Møgelberg, R., Schwinghammer, J. and Støvring, K. (2012). First steps in synthetic guarded domain theory: Step-indexing in the topos of trees. In: Proceedings of the Logical Methods in Computer Science (LICS '12).Google Scholar
Birkedal, L. and Møgelberg, R.E. (2013). Intensional type theory with guarded recursive types qua fixed points on universes. In: Proceedings of the 28th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS '13) 213–222.Google Scholar
Bizjak, A., Birkedal, L. and Miculan, M. (2014). A model of countable nondeterminism in guarded type theory. In: Proceedings of International Conference on Rewriting Techniques and Applications (RTA–TLCA'14) 108–123.Google Scholar
Bizjak, A., Grathwohl, H.B., Clouston, R., Møgelberg, R.E. and Birkedal, L. (2016). Guarded dependent type theory with coinductive types. In: Proceedings of the 19th International Conference on Foundations of Software Science and Computation Structures (FoSSaCS '16).Google Scholar
Bizjak, A. and Møgelberg, R. E. (2015). A model of guarded recursion with clock synchronisation. In: Proceedings of Mathematical Foundations of Programming Semantics (MFPS '15).Google Scholar
Capretta, V. (2005). General recursion via coinductive types. Logical Methods in Computer Science 1 (2). doi:10.2168/LMCS-1(2:1)2005.Google Scholar
Chapman, J., Uustalu, T. and Veltri, N. (2015). Quotienting the delay monad by weak bisimilarity. In: Proceedings of the International Confederation for Thermal Analysis and Calorimetry (ICTAC '15).Google Scholar
Cohen, C., Coquand, T., Huber, S. and Mörtberg, A. (2015). Cubical type theory: A constructive interpretation of the univalence axiom. In: 21st International Conference on Types for Proofs and Programs (TYPES 2015), May 18–21, 2015, Tallinn, Estonia 5:1–5:34.Google Scholar
Danielsson, N.A. (2012). Operational semantics using the partiality monad. In: Proceedings of the 17th ACM SIGPLAN International Conference on Functional Programming (ICFP '12) 127–138.Google Scholar
Dockins, R. (2014). Formalized, effective domain theory in Coq. In: Proceedings of the International Conference on Interactive Theorem Proving (ITP '14).Google Scholar
Escardó, M.H. (1999). A metric model of PCF, Laboratory for Foundations of Computer Science, University of Edinburgh.Google Scholar
Hyland, J.M.E. (1991). First steps in synthetic domain theory. In: Proceedings of the 1990 Como Category Theory Conference, Volume 1272 of Lecture Notes in Mathematics 131–156.Google Scholar
Kapulkin, C. and Lumsdaine, P.L. (2012). The simplicial model of univalent foundations (after voevodsky). Unpublished manuscript, arXiv: 1211.2851.Google Scholar
McBride, C. and Paterson, R. (2008). Applicative programming with effects. Journal of Functional Programming 18 (1) 113.Google Scholar
Møgelberg, R.E. (2014). A type theory for productive coprogramming via guarded recursion. In: Proceedings of the Joint Meeting of the 23rd EACSL Annual Conference on Computer Science Logic and the 29th Annual ACM/IEEE Symposium on Logic in Computer Science (CSL-LICS '14).Google Scholar
Møgelberg, R.E. and Paviotti, M. (2016). Denotational semantics of recursive types in synthetic guarded domain theory. In: Proceedings of the 31st Annual ACM/IEEE Symposium on Logic in Computer Science (LICS '16) 317–326.Google Scholar
Nakano, H. (2000). A modality for recursion. In: Proceedings of the 15th Annual IEEE Symposium on Logic in Computer Science (LICS '00) 255–266.Google Scholar
Paviotti, M., Møgelberg, R.E. and Birkedal, L. (2015). A model of PCF in guarded type theory. Electronic Notes in Theoretical Computer Science 319 333349.Google Scholar
Pitts, A.M. (1996). Relational properties of domains. Information and Computation 127 (2) 6690.Google Scholar
Reus, B. (1996). Synthetic domain theory in type theory: Another logic of computable functions. In: Proceedings of the International Conference on Theorem Proving in Higher Order Logics (TPHOLs '96).Google Scholar
Rosolini, G. (1986). Continuity and Effectiveness in Topoi. Ph.D. Thesis, University of Oxford.Google Scholar
Simpson, A.K. (2002). Computational adequacy for recursive types in models of intuitionistic set theory. In: Proceedings of the 17th Annual IEEE Symposium on Logic in Computer Science (LICS '02) 287–298.Google Scholar
Streicher, T. (2006). Domain-Theoretic Foundations of Functional Programming, World Scientific.Google Scholar
Svendsen, K. and Birkedal, L. (2014). Impredicative concurrent abstract predicates. In: Proceedings of the 23rd European Symposium on Programming Languages and Systems (ESOP '14).Google Scholar
The Univalent Foundations Program. (2013). Homotopy Type Theory: Univalent Foundations of Mathematics, Institute for Advanced Study. Available at http://homotopytypetheory.org/book.Google Scholar
Veltri, N. (2017). A Type-Theoretical Study of Nontermination. Ph.D. Thesis.Google Scholar
Winskel, G. (1993). The Formal Semantics of Programming Languages: An Introduction, MIT Press, Cambridge, MA, USA.Google Scholar