Relational parametricity for references and recursive types

We present a possible world semantics for a call-by-value higher-order programming language with impredicative polymorphism, general references, and recursive types. The model is one of the first relationally parametric models of a programming language with all these features. To model impredicative polymorphism we define the semantics of types via parameterized (world-indexed) logical relations over a universal domain. It is well-known that it is non-trivial to show the existence of logical relations in the presence of recursive types. Here the problems are exacerbated because of general references. We explain what the problems are and present our solution, which makes use of a novel approach to modeling references. We prove that the resulting semantics is adequate with respect to a standard operational semantics and include simple examples of reasoning about contextual equivalence via parametricity.

[1]  LARS BIRKEDAL,et al.  Categorical Models for Abadi-Plotkin ’ s Logic for Parametricity , 2005 .

[2]  Paul Blain Levy,et al.  Possible World Semantics for General Storage in Call-By-Value , 2002, CSL.

[3]  Masahito Hasegawa Relational Parametricity and Control , 2005, LICS.

[4]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

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

[6]  Rasmus Ejlers Møgelberg,et al.  Relational Parametricity for Computational Effects , 2007, 22nd Annual IEEE Symposium on Logic in Computer Science (LICS 2007).

[7]  Rasmus Ejlers Møgelberg,et al.  Linear Abadi & Plotkin Logic , 2006 .

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

[9]  Andrzej Filinski On the relations between monadic semantics , 2007, Theor. Comput. Sci..

[10]  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.

[11]  Martín Abadi,et al.  A Logic for Parametric Polymorphism , 1993, TLCA.

[12]  Andrew W. Appel,et al.  A very modal model of a modern, major, general type system , 2007, POPL '07.

[13]  Mitchell Wand,et al.  Small bisimulations for reasoning about higher-order imperative programs , 2006, POPL '06.

[14]  Andrew M. Pitts,et al.  Observable Properties of Higher Order Functions that Dynamically Create Local Names, or What's new? , 1993, MFCS.

[15]  Rasmus Ejlers Møgelberg,et al.  Relational Parametricity for Control Considered as a Computational Effect , 2007, MFPS.

[16]  Paul Blain Levy,et al.  Typed Normal Form Bisimulation for Parametric Polymorphism , 2008, 2008 23rd Annual IEEE Symposium on Logic in Computer Science.

[17]  Andrew M. Pitts,et al.  Parametric polymorphism and operational equivalence , 2000, Mathematical Structures in Computer Science.

[18]  Amal Ahmed,et al.  Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types , 2006, ESOP.

[19]  Benjamin C. Pierce,et al.  Advanced Topics In Types And Programming Languages , 2004 .

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

[21]  Andrew W. Appel,et al.  An indexed model of recursive types for foundational proof-carrying code , 2001, TOPL.

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

[23]  Claudio V. Russo,et al.  Operational Properties of Lily, a Polymorphic Linear Lambda Calculus with Recursion , 2001, HOOTS.

[24]  Rasmus Ejlers Møgelberg,et al.  Categorical models for Abadi and Plotkin's logic for parametricity , 2005, Mathematical Structures in Computer Science.

[25]  Rasmus Ejlers Møgelberg Interpreting Polymorphic FPC into Domain Theoretic Models of Parametric Polymorphism , 2006, ICALP.

[26]  Patricia Johann,et al.  The Impact of seq on Free Theorems-Based Program Transformations , 2006, Fundam. Informaticae.

[27]  Patricia Johann On proving the correctness of program transformations based on free theorems for higher-order polymorphic calculi , 2005, Math. Struct. Comput. Sci..

[28]  Paul Blain Levy,et al.  Typed Normal Form Bisimulation , 2007, CSL.

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

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

[31]  Søren B. Lassen,et al.  A complete, co-inductive syntactic theory of sequential control and state , 2007, POPL '07.

[32]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[33]  Mitchell Wand,et al.  Bisimulations for Untyped Imperative Objects , 2006, ESOP.

[34]  Jérôme Vouillon,et al.  Recursive polymorphic types and parametricity in an operational framework , 2005, 20th Annual IEEE Symposium on Logic in Computer Science (LICS' 05).

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