Hostname: page-component-8448b6f56d-sxzjt Total loading time: 0 Render date: 2024-04-25T03:37:25.263Z Has data issue: false hasContentIssue false

Realisability semantics of parametric polymorphism, general references and recursive types

Published online by Cambridge University Press:  02 July 2010

LARS BIRKEDAL
Affiliation:
IT University of Copenhagen, Rued Langgaards Vej 7, 2300 Copenhagen S, Denmark Email: birkedal@itu.dk; kss@itu.dk; thamsborg@itu.dk
KRISTIAN STØVRING
Affiliation:
IT University of Copenhagen, Rued Langgaards Vej 7, 2300 Copenhagen S, Denmark Email: birkedal@itu.dk; kss@itu.dk; thamsborg@itu.dk
JACOB THAMSBORG
Affiliation:
IT University of Copenhagen, Rued Langgaards Vej 7, 2300 Copenhagen S, Denmark Email: birkedal@itu.dk; kss@itu.dk; thamsborg@itu.dk

Abstract

We present a realisability model for a call-by-value, higher-order programming language with parametric polymorphism, general first-class references, and recursive types. The main novelty is a relational interpretation of open types that include general reference types. The interpretation uses a new approach to modelling references.

The universe of semantic types consists of world-indexed families of logical relations over a universal predomain. In order to model general reference types, worlds are finite maps from locations to semantic types: this introduces a circularity between semantic types and worlds that precludes a direct definition of either. Our solution is to solve a recursive equation in an appropriate category of metric spaces. In effect, types are interpreted using a Kripke logical relation over a recursively defined set of worlds.

We illustrate how the model can be used to prove simple equivalences between different implementations of imperative abstract data types.

Type
Paper
Copyright
Copyright © Cambridge University Press 2010

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

Abadi, M. (2000) Top-top-closed relations and admissibility. Mathematical Structures in Computer Science 10 (3)313320.CrossRefGoogle Scholar
Abadi, M. and Plotkin, G. D. (1990) A per model of polymorphism and recursive types. In: Proceedings of LICS 355–365.CrossRefGoogle Scholar
Abramsky, S., Honda, K. and McCusker, G. (1998) A fully abstract game semantics for general references. In: Proceedings of LICS 334–344.CrossRefGoogle Scholar
Abramsky, S. and Jagadeesan, R. (2005) A game semantics for generic polymorphism. Annals of Pure and Applied Logic 133 (1–3)337.CrossRefGoogle Scholar
Ahmed, A. (2004) Semantics of Types for Mutable State, Ph.D. thesis, Princeton University.Google Scholar
Ahmed, A., Dreyer, D. and Rossberg, A. (2009) State-dependent representation independence. In: Proceedings of POPL 340–353.CrossRefGoogle Scholar
Amadio, R. M. (1991) Recursion over realizability structures. Information and Computation 91 (1)5585.CrossRefGoogle Scholar
Amadio, R. M. and Curien, P.-L. (1998) Domains and Lambda-Calculi, Cambridge University Press.CrossRefGoogle Scholar
America, P. and Rutten, J. J. M. M. (1989) Solving reflexive domain equations in a category of complete metric spaces. J. Comput. Syst. Sci. 39 (3)343375.CrossRefGoogle Scholar
Baier, C. and Majster-Cederbaum, M. E. (1997) The connection between initial and unique solutions of domain equations in the partial order and metric approach. Formal Aspects of Computing 9 (4)425445.CrossRefGoogle Scholar
Benton, N. and Hur, C.-K. (2009) Biorthogonality, step-indexing and compiler correctness. In: Proceedings of ICFP 97–108.CrossRefGoogle Scholar
Benton, N. and Leperchey, B. (2005) Relational reasoning in a nominal semantics for storage. In: Proceedings of TLCA. Springer-Verlag Lecture Notes in Computer Science 3461 86101.CrossRefGoogle Scholar
Birkedal, L., Reus, B., Schwinghammer, J., Støvring, K., Thamsborg, J. and Yang, H. (2010a) Step-indexed kripke models over recursive worlds. Submitted for publication. Available at http://www.itu.dk/people/birkedal/papers/step-recworld-conf.pdf.CrossRefGoogle Scholar
Birkedal, L., Støvring, K. and Thamsborg, J. (2009) Relational parametricity for references and recursive types. In: Proceedings of TLDI 91–104.CrossRefGoogle Scholar
Birkedal, L., Støvring, K. and Thamsborg, J. (2010b) A relational realizability model for higher-order stateful ADTs. Submitted for publication. Available at http://www.itu.dk/people/birkedal/papers/relrmhoadt.pdf.Google Scholar
Bohr, N. and Birkedal, L. (2006) Relational reasoning for recursive types and references. In: Proceedings of APLAS. Springer-Verlag Lecture Notes in Computer Science 4279 7996.CrossRefGoogle Scholar
Cardone, F. (1989) Relational semantics for recursive types and bounded quantification. In: Proceedings of ICALP. Springer-Verlag Lecture Notes in Computer Science 372 164178.CrossRefGoogle Scholar
Crary, K. and Harper, R. (2007) Syntactic logical relations for polymorphic and recursive types. Electronic Notes in Theoretical Computer Science 172 259299.CrossRefGoogle Scholar
Laird, J. (2007) A fully abstract trace semantics for general references. In: Proceedings of ICALP. Springer-Verlag Lecture Notes in Computer Science 4596 667679.CrossRefGoogle Scholar
Levy, P. B. (2006) Call-by-push-value: Decomposing call-by-value and call-by-name. Higher-Order and Symbolic Computation 19 (4)377414.CrossRefGoogle Scholar
MacQueen, D. B., Plotkin, G. D. and Sethi, R. (1986) An ideal model for recursive polymorphic types. Information and Control 71 (1/2)95130.CrossRefGoogle Scholar
McCusker, G. (2000) Games and full abstraction for FPC. Information and Computation 160 (1–2)161.CrossRefGoogle Scholar
Moggi, E. (1991) Notions of computation and monads. Information and Computation 93 5592.CrossRefGoogle Scholar
Petersen, R. L., Birkedal, L., Nanevski, A. and Morrisett, G. (2008) A realizability model for impredicative Hoare type theory. In: Proceedings of ESOP. Springer-Verlag Lecture Notes in Computer Science 4960 337352.CrossRefGoogle Scholar
Pierce, B. C. (2002) Types and Programming Languages, The MIT Press.Google Scholar
Pitts, A. M. (1996) Relational properties of domains. Information and Computation 127 6690.CrossRefGoogle Scholar
Pitts, A. M. (1998) Existential types: Logical relations and operational equivalence. In: Proceedings of ICALP. Springer-Verlag Lecture Notes in Computer Science 1443 309326.CrossRefGoogle Scholar
Plotkin, G. D. and Power, J. (2004) Computational effects and operations: An overview. Electronic Notes in Theoretical Computer Science 73 149163.CrossRefGoogle Scholar
Schwinghammer, J., Birkedal, L., Reus, B. and Yang, H. (2009) Nested Hoare triples and frame rules for higher-order store. In: Proceedings of CSL. Springer-Verlag Lecture Notes in Computer Science 5771 440454.CrossRefGoogle Scholar
Schwinghammer, J., Yang, H., Birkedal, L., Pottier, F. and Reus, B. (2010) A semantic foundation for hidden state. In: Proceedings of FOSSACS. Springer-Verlag Lecture Notes in Computer Science 6014 217.CrossRefGoogle Scholar
Smyth, M. B. (1992) Topology. In: Abramsky, S., Gabbay, D. and Maibaum, T. S. E. (eds.) Handbook of Logic in Computer Science, Oxford University Press.Google Scholar
Smyth, M. B. and Plotkin, G. D. (1982) The category-theoretic solution of recursive domain equations. SIAM Journal on Computing 11 (4)761783.CrossRefGoogle Scholar
Wagner, K. R. (1994) Solving Recursive Domain Equations with Enriched Categories, Ph.D. thesis, Carnegie Mellon University.Google Scholar
Winskel, G. (1993) The Formal Semantics of Programming Languages, Foundation of Computing Series, The MIT Press.CrossRefGoogle Scholar