# Existential types: Logical relations and operational equivalence

## Abstract

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.

## Keywords

Operational Semantic Logical Relation Extensionality Principle Ground Type High Order Function## Preview

Unable to display preview. Download preview PDF.

## References

- Birkedal, L. and R. Harper (1997). Relational interpretation of recursive types in an operational setting (Summary). In M. Abadi and T. Ito (Eds.),
*Theoretical Aspects of Computer Software, Third International Symposium, TACS'97, Sendai, Japan, September 23–26, 1997, Proceedings*, Volume 1281 of*Lecture Notes in Computer Science*. Springer-Verlag, Berlin.Google Scholar - Bruce, K. B., L. Cardelli, and B. C. Pierce (1997). Comparing object encodings. In M. Abadi and T. Ito (Eds.),
*Theoretical Aspects of Computer Software, Third International Symposium, TACS'97, Sendai, Japan, September 23–26, 1997, Proceedings*, Volume 1281 of*Lecture Notes in Computer Science*. Springer-Verlag, Berlin.Google Scholar - Cardelli, L. (1997). Type systems. In
*CRC Handbook of Computer Science and Engineering*, Chapter 103, pp. 2208–2236. CRC Press.Google Scholar - Girard, J.-Y. (1972).
*Interprétation fonctionelle et élimination des coupures dans l'arithmetique d'ordre supérieur*. Ph. D. thesis, Université Paris VII. Thèse de doctorat d'état.Google Scholar - Lassen, S. B. (1998a). Relational reasoning about contexts. In A. D. Gordon and A. M. Pitts (Eds.),
*Higher Order Operational Techniques in Semantics*, Publications of the Newton Institute, pp. 91–135. Cambridge University Press.Google Scholar - Lassen, S. B. (1998b).
*Relational Reasoning about Functions and Nondeterminism*. Ph. D. thesis, Department of Computer Science, University of Aarhus.Google Scholar - Milner, R., M. Tofte, R. Harper, and D. MacQueen (1997).
*The Definition of Standard ML (Revised)*. MIT Press.Google Scholar - Mitchell, J. C. (1991). On the equivalence of data representations. In V. Lifschitz (Ed.),
*Artificial Intelligence and Mathematical Theory of Computation: Papers in Honor of John McCarthy*, pp. 305–330. Academic Press.Google Scholar - Mitchell, J. C. (1996).
*Foundations for Programming Languages*. Foundations of Computing series. MIT Press.Google Scholar - Mitchell, J. C. and G. D. Plotkin (1988). Abtract types have existential types.
*ACM Transactions on Programming Languages and Systems 10*, 470–502.CrossRefGoogle Scholar - Pitts, A. M. (1998). Parametric polymorphism and operational equivalence (preliminary version).
*Electronic Notes in Theoretical Computer Science 10*. Proceedings, 2nd Workshop on Higher Order Operational Techniques in Semantics, Stanford CA, December 1997. To appear.Google Scholar - Pitts, A. M. and I. D. B. Stark (1993). Observable properties of higher order functions that dynamically create local names, or: What's new? In
*Mathematical Foundations of Computer Science, Proc. 18th Int. Symp.*,*Gdańsk*,*1993*, Volume 711 of*Lecture Notes in Computer Science*, pp. 122–141. Springer-Verlag, Berlin.Google Scholar - Pitts, A. M. and I. D. B. Stark (1998). Operational reasoning for functions with local state. In A. D. Gordon and A. M. Pitts (Eds.),
*Higher Order Operational Techniques in Semantics*, Publications of the Newton Institute, pp. 227–273. Cambridge University Press.Google Scholar - Plotkin, G. D. (1973, October). Lambda-definability and logical relations. Memorandum SAI-RM-4, School of Artificial Intelligence, University of Edinburgh.Google Scholar
- Plotkin, G. D. (1977). LCF considered as a programming language.
*Theoretical Computer Science 5*, 223–255.MathSciNetCrossRefGoogle Scholar - Plotkin, G. D. and M. Abadi (1993). A logic for parametric polymorphism. In M. Bezem and J. F. Groote (Eds.),
*Typed Lambda Calculus and Applications*, Volume 664 of*Lecture Notes in Computer Science*, pp. 361–375. Springer-Verlag, Berlin.Google Scholar - Reynolds, J. C. (1974). Towards a theory of type structure. In
*Paris Colloquium on Programming*, Volume 19 of*Lecture Notes in Computer Science*, pp. 408–425. Springer-Verlag, Berlin.Google Scholar - Reynolds, J. C. (1983). Types, abstraction and parametric polymorphism. In R. E. A. Mason (Ed.),
*Information Processing 83*, pp. 513–523. North-Holland, Amsterdam.Google Scholar - Statman, R. (1985). Logical relations and the typed lambda calculus.
*Information and Control 65*, 85–97.zbMATHMathSciNetCrossRefGoogle Scholar - Wright, A. K. (1995). Simple imperative polymorphism.
*LISP and Symbolic Computation 8*, 343–355.CrossRefGoogle Scholar