Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types
We present a sound and complete proof technique, based on syntactic logical relations, for showing contextual equivalence of expressions in a λ-calculus with recursive types and impredicative universal and existential types. Our development builds on the step-indexed PER model of recursive types presented by Appel and McAllester. We have discovered that a direct proof of transitivity of that model does not go through, leaving the “PER” status of the model in question. We show how to extend the Appel-McAllester model to obtain a logical relation that we can prove is transitive, as well as sound and complete with respect to contextual equivalence. We then augment this model to support relational reasoning in the presence of quantified types.
Step-indexed relations are indexed not just by types, but also by the number of steps available for future evaluation. This stratification is essential for handling various circularities, from recursive functions, to recursive types, to impredicative polymorphism. The resulting construction is more elementary than existing logical relations which require complex machinery such as domain theory, admissibility, syntactic minimal invariance, and ⊤ ⊤-closure.
KeywordsOperational Semantic Recursive Function Logical Relation Typing Rule Shade Part
- 1.Plotkin, G.D.: Lambda-definability and logical relations. Memorandum SAI–RM–4. University of Edinburgh, Edinburgh, Scotland (1973)Google Scholar
- 5.Girard, J.Y.: Interprétation Fonctionnelle et Élimination des Coupures de l’Arithm étique d’Ordre Supérieur. Thèse de doctorat d’état, Université Paris VII, Paris, France (1972)Google Scholar
- 8.Crary, K., Harper, R.: Syntactic logical relations over polymorphic and recursive types. Draft (2000)Google Scholar
- 9.Pitts, A.M.: Typed operational reasoning. In: Pierce, B.C. (ed.) Advanced Topics in Types and Programming Languages. MIT Press, Cambridge (2005)Google Scholar
- 11.Melliès, P.A., Vouillon, J.: Semantic types: A fresh look at the ideal model for types. In: POPL, Venice, Italy (2004)Google Scholar
- 12.Melliès, P.A., Vouillon, J.: Recursive polymorphic types and parametricity in an operational framework. In: LICS, Chicago, Illinois (2005)Google Scholar
- 14.Ahmed, A., Appel, A.W., Virga, R.: An indexed model of impredicative polymorphism and mutable references (2003), Available at http://www.cs.princeton.edu/~appel/papers/impred.pdf
- 15.Ahmed, A.J.: Semantics of Types for Mutable State. PhD thesis, Princeton University (2004)Google Scholar
- 16.Ahmed, A.: Step-indexed syntactic logical relations for recursive and quantified types. Technical Report TR-01-06, Harvard University (2006)Google Scholar
- 19.Sumii, E., Pierce, B.C.: A bisimulation for type abstraction and recursion. In: POPL, Long Beach, California, pp. 63–74 (2005)Google Scholar
- 21.Wadler, P.: Theorems for free! In: ACM Symposium on Functional Programming Languages and Computer Architecture (FPCA), London (1989)Google Scholar