Existential Types: Logical Relations and Operational Equivalence

Existential types have proved useful for classifying various kinds of information hiding in programming languages, such as occurs in abstract datatypes and objects. In this paper we address the question of when two elements of an existential type are semantically equivalent. Of course, it depends what one means by ‘semantic equivalence’. Here we take a syntactic approach—so semantic equivalence will mean some kind of operational equivalence. The paper begins by surveying some of the literature on this topic involving ‘logical relations’. Matters become quite complicated if the programming language mixes existential types with function types and features involving non-termination (such as recursive definitions). We give an example (suggested by Ian Stark) to show that in this case the existence of suitable relations is sufficient, but not necessary for proving operational equivalences at existential types. Properties of this and other examples are proved using a new form of operationally-based logical relation which does in fact provide a useful characterisation of operational equivalence for existential types.

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

[2]  D. Evelyne Thèse de doctorat d'Etat , 1988 .

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

[4]  Soren Lassen Relational reasoning about contexts , 1997 .

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

[6]  Luca Cardelli,et al.  Comparing Object Encodings , 1997, Inf. Comput..

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

[8]  John C. Mitchell,et al.  Abstract types have existential types , 1985, POPL.

[9]  John C. Mitchell,et al.  Abstract types have existential type , 1988, TOPL.

[10]  Andrew K. Wright Simple imperative polymorphism , 1995, LISP Symb. Comput..

[11]  David B. MacQueen,et al.  The Definition of Standard ML (Revised) , 1997 .

[12]  John C. Mitchell,et al.  On the Equivalence of Data Representations , 1991, Artificial and Mathematical Theory of Computation.

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

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

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

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

[17]  I. Stark,et al.  Operational reasoning for functions with local state , 1999 .

[18]  Lars Birkedal,et al.  Relational Interpretations of Recursive Types in an operational Setting (Summary) , 1997, TACS.

[19]  Glynn Winskel,et al.  Relational Reasoning about Functions and Nondeterminism , 1999 .

[20]  R. E. A. Mason,et al.  Information Processing 83 , 1984 .