Realizability Semantics of Parametric Polymorphism, General References, and Recursive Types

We present a realizability 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 (as needed for parametricity reasoning) that include general reference types. The interpretation uses a new approach to modeling 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.

[1]  Brian Campbell,et al.  Amortised Memory Analysis Using the Depth of Data Structures , 2009, ESOP.

[2]  Nick Benton,et al.  Relational Reasoning in a Nominal Semantics for Storage , 2005, TLCA.

[3]  Kim R. Wagner,et al.  Solving Recursive Domain Equations with Enriched Categories. , 1994 .

[4]  Lars Birkedal,et al.  A Realizability Model for Impredicative Hoare Type Theory , 2008, ESOP.

[5]  Andrew M. Pitts,et al.  Relational Properties of Domains , 1996, Inf. Comput..

[6]  James Laird A Fully Abstract Trace Semantics for General References , 2007, ICALP.

[7]  Alexey Gotsman,et al.  Local Reasoning for Storable Locks and Threads , 2007, APLAS.

[8]  Stefan Friedrich,et al.  Topology , 2019, Arch. Formal Proofs.

[9]  Lars Birkedal,et al.  Relational parametricity for references and recursive types , 2009, TLDI '09.

[10]  Felice Cardone,et al.  Relational Semantics for Recursive Types and Bounded Quantification , 1989, ICALP.

[11]  Lars Birkedal,et al.  The category-theoretic solution of recursive metric-space equations , 2010, Theor. Comput. Sci..

[12]  Chung-Kil Hur,et al.  Biorthogonality, step-indexing and compiler correctness , 2009, ICFP.

[13]  John C. Mitchell,et al.  Foundations for programming languages , 1996, Foundation of computing series.

[14]  Hongseok Yang,et al.  Nested Hoare Triples and Frame Rules for Higher-Order Store , 2009, CSL.

[15]  Sam Lindley,et al.  Extensional Rewriting with Sums , 2007, TLCA.

[16]  Lars Birkedal,et al.  A relational modal logic for higher-order stateful ADTs , 2010, POPL '10.

[17]  Gordon D. Plotkin,et al.  An ideal model for recursive polymorphic types , 1984, Inf. Control..

[18]  Christel Baier,et al.  The connection between initial and unique solutions of domain equations in the partial order and metric approach , 1997, Formal Aspects of Computing.

[19]  Gordon D. Plotkin,et al.  The Category-Theoretic Solution of Recursive Domain Equations (Extended Abstract) , 1977, FOCS.

[20]  Samson Abramsky,et al.  A fully abstract game semantics for general references , 1998, Proceedings. Thirteenth Annual IEEE Symposium on Logic in Computer Science (Cat. No.98CB36226).

[21]  Gordon D. Plotkin,et al.  Computational Effects and Operations: An Overview , 2004, Electron. Notes Theor. Comput. Sci..

[22]  Roberto M. Amadio,et al.  Domains and lambda-calculi , 1998, Cambridge tracts in theoretical computer science.

[23]  Lars Birkedal,et al.  Logical Step-Indexed Logical Relations , 2009, LICS.

[24]  Hongseok Yang,et al.  Step-indexed kripke models over recursive worlds , 2011, POPL '11.

[25]  Lars Birkedal,et al.  Relational Reasoning for Recursive Types and References , 2006, APLAS.

[26]  G. Winskel The formal semantics of programming languages , 1993 .

[27]  Andrew M. Pitts Existential Types: Logical Relations and Operational Equivalence , 1998, ICALP.

[28]  Hongseok Yang,et al.  A Semantic Foundation for Hidden State , 2010, FoSSaCS.

[29]  Roberto M. Amadio,et al.  Recursion over Realizability Structures , 1991, Inf. Comput..

[30]  Samson Abramsky,et al.  Handbook of logic in computer science. , 1992 .

[31]  Gordon D. Plotkin,et al.  The category-theoretic solution of recursive domain equations , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[32]  Robin Milner,et al.  On Observing Nondeterminism and Concurrency , 1980, ICALP.

[33]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[34]  Martín Abadi,et al.  A PER model of polymorphism and recursive types , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

[35]  Martín Abadi Top-top-closed Relations and Admissibility , 2000, Math. Struct. Comput. Sci..

[36]  Paul Blain Levy,et al.  Call-by-push-value: Decomposing call-by-value and call-by-name , 2006, High. Order Symb. Comput..

[37]  Radha Jagadeesan,et al.  A game semantics for generic polymorphism , 2005, Ann. Pure Appl. Log..

[38]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[39]  Derek Dreyer,et al.  State-dependent representation independence , 2009, POPL '09.

[40]  Pierre America,et al.  Solving Reflexive Domain Equations in a Category of Complete Metric Spaces , 1987, J. Comput. Syst. Sci..

[41]  Jan Rutten Elements of generalized ultrametric domain theory , 1996 .

[42]  Amal Ahmed,et al.  Semantics of types for mutable state , 2004 .

[43]  Karl Crary,et al.  Syntactic Logical Relations for Polymorphic and Recursive Types , 2007, Computation, Meaning, and Logic.

[44]  Guy McCusker Games and Full Abstraction for FPC , 2000, Inf. Comput..