Skip to main content
×
×
Home

Denotational semantics of recursive types in synthetic guarded domain theory

  • RASMUS E. MØGELBERG (a1) and MARCO PAVIOTTI (a2)
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.

Copyright
References
Hide All
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.
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.
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.
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.
Benton, N., Birkedal, L., Kennedy, A. and Varming, C. (2010). Formalizing domains, ultrametric spaces and semantics of programming languages. Unpublished manuscript.
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).
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).
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).
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.
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.
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).
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).
Capretta, V. (2005). General recursion via coinductive types. Logical Methods in Computer Science 1 (2). doi:10.2168/LMCS-1(2:1)2005.
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).
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.
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.
Dockins, R. (2014). Formalized, effective domain theory in Coq. In: Proceedings of the International Conference on Interactive Theorem Proving (ITP '14).
Escardó, M.H. (1999). A metric model of PCF, Laboratory for Foundations of Computer Science, University of Edinburgh.
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.
Kapulkin, C. and Lumsdaine, P.L. (2012). The simplicial model of univalent foundations (after voevodsky). Unpublished manuscript, arXiv: 1211.2851.
McBride, C. and Paterson, R. (2008). Applicative programming with effects. Journal of Functional Programming 18 (1) 113.
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).
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.
Nakano, H. (2000). A modality for recursion. In: Proceedings of the 15th Annual IEEE Symposium on Logic in Computer Science (LICS '00) 255–266.
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.
Pitts, A.M. (1996). Relational properties of domains. Information and Computation 127 (2) 6690.
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).
Rosolini, G. (1986). Continuity and Effectiveness in Topoi. Ph.D. Thesis, University of Oxford.
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.
Streicher, T. (2006). Domain-Theoretic Foundations of Functional Programming, World Scientific.
Svendsen, K. and Birkedal, L. (2014). Impredicative concurrent abstract predicates. In: Proceedings of the 23rd European Symposium on Programming Languages and Systems (ESOP '14).
The Univalent Foundations Program. (2013). Homotopy Type Theory: Univalent Foundations of Mathematics, Institute for Advanced Study. Available at http://homotopytypetheory.org/book.
Veltri, N. (2017). A Type-Theoretical Study of Nontermination. Ph.D. Thesis.
Winskel, G. (1993). The Formal Semantics of Programming Languages: An Introduction, MIT Press, Cambridge, MA, USA.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Mathematical Structures in Computer Science
  • ISSN: 0960-1295
  • EISSN: 1469-8072
  • URL: /core/journals/mathematical-structures-in-computer-science
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 2 *
Loading metrics...

Abstract views

Total abstract views: 42 *
Loading metrics...

* Views captured on Cambridge Core between 15th May 2018 - 21st June 2018. This data will be updated every 24 hours.