Relational Interpretations of Recursive Types in an Operational Setting

Abstract Relational interpretations of type systems are useful for establishing properties of programming languages. For languages with recursive types it is difficult to establish the existence of a relational interpretation. The usual approach is to pass to a domain-theoretic model of the language and, exploiting the structure of the model, to derive relational properties of it. We investigate the construction of relational interpretations of recursive types in a purely operational setting, drawing on recent ideas from domain theory and operational semantics as a guide. We prove syntactic minimal invariance for an extension of PCF with a recursive type, a syntactic analogue of the minimal invariance property used by Freyd and Pitts to characterize the domain interpretation of a recursive type. As Pitts has shown in the setting of domains, syntactic minimal invariance suffices to establish the existence of relational interpretations. We give two applications of this construction. First, we derive a notion of logical equivalence for expressions of the language that we show coincides with experimental equivalence and which, by virtue of its construction, validates useful induction and coinduction principles for reasoning about the recursive type. Second, we give a relational proof of correctness of the continuation-passing transformation, which is used in some compilers for functional languages.

[1]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[2]  Brian A. Davey,et al.  An Introduction to Lattices and Order , 1989 .

[3]  Peter J. Freyd,et al.  Recursive types reduced to inductive types , 1990, [1990] Proceedings. Fifth Annual IEEE Symposium on Logic in Computer Science.

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

[5]  D. H. Bartley,et al.  Revised4 report on the algorithmic language scheme , 1991, LIPO.

[6]  Carolyn L. Talcott,et al.  From Operational Semantics to Domain Theory , 1996, Inf. Comput..

[7]  Robert Harper,et al.  TIL: a type-directed optimizing compiler for ML , 1996, PLDI '96.

[8]  Greg Morrisett,et al.  Compiling with Types , 1995 .

[9]  John H. Reppy,et al.  CML: A Higher-Order Concurrent Language , 1991, PLDI.

[10]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[11]  John C. Reynolds,et al.  On the Relation between Direct and Continuation Semantics , 1974, ICALP.

[12]  Andrew Pitts,et al.  Semantics and Logics of Computation: Operationally-Based Theories of Program Equivalence , 1997 .

[13]  P. J. Freyd Applications of Categories in Computer Science: Remarks on algebraically compact categories , 1992 .

[14]  P. Freyd Algebraically complete categories , 1991 .

[15]  Dana S. Scott,et al.  Some Domain Theory and Denotational Semantics in Coq , 2009, TPHOLs.

[16]  Andrew W. Appel,et al.  Compiling with Continuations , 1991 .

[17]  Richard Statman,et al.  Logical Relations and the Typed lambda-Calculus , 1985, Inf. Control..

[18]  John C. Reynolds,et al.  Towards a theory of type structure , 1974, Symposium on Programming.

[19]  Zhong Shao,et al.  Implementing typed intermediate languages , 1998, ICFP '98.

[20]  John C. Mitchell,et al.  Type Systems for Programming Languages , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[21]  Albert R. Meyer,et al.  Continuation Semantics in Typed Lambda-Calculi (Summary) , 1985, Logic of Programs.

[22]  Michael J. Fischer,et al.  Lambda-calculus schemata , 1993, LISP Symb. Comput..

[23]  Carl A. Gunter Semantics of programming languages: structures and techniques , 1993, Choice Reviews Online.

[24]  Robin Milner,et al.  Definition of standard ML , 1990 .

[25]  J. Y. Girard,et al.  Interpretation fonctionelle et elimination des coupures dans l'aritmetique d'ordre superieur , 1972 .

[26]  Robert Harper,et al.  Typing first-class continuations in ML , 1991, POPL '91.

[27]  John C. Reynolds,et al.  Definitional Interpreters for Higher-Order Programming Languages , 1972, ACM '72.

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