Advertisement

Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types

  • Amal Ahmed
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3924)

Abstract

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.

Keywords

Operational Semantic Recursive Function Logical Relation Typing Rule Shade Part 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
    Plotkin, G.D.: Lambda-definability and logical relations. Memorandum SAI–RM–4. University of Edinburgh, Edinburgh, Scotland (1973)Google Scholar
  2. 2.
    Statman, R.: Logical relations and the typed λ-calculus. Information and Control 65(2–3), 85–97 (1985)MathSciNetCrossRefMATHGoogle Scholar
  3. 3.
    Pitts, A.M.: Relational properties of domains. Information and Computation 127(2), 66–90 (1996)MathSciNetCrossRefMATHGoogle Scholar
  4. 4.
    Tait, W.W.: Intensional interpretations of functionals of finite type i. Journal of Symbolic Logic 32(2), 198–212 (1967)MathSciNetCrossRefMATHGoogle Scholar
  5. 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
  6. 6.
    Pitts, A.M.: Parametric polymorphism and operational equivalence. Mathematical Structures in Computer Science 10, 321–359 (2000)MathSciNetCrossRefMATHGoogle Scholar
  7. 7.
    Pitts, A.M.: Existential types: Logical relations and operational equivalence. In: Larsen, K.G., Skyum, S., Winskel, G. (eds.) ICALP 1998. LNCS, vol. 1443, pp. 309–326. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  8. 8.
    Crary, K., Harper, R.: Syntactic logical relations over polymorphic and recursive types. Draft (2000)Google Scholar
  9. 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
  10. 10.
    Birkedal, L., Harper, R.: Relational interpretations of recursive types in an operational setting. In: Ito, T., Abadi, M. (eds.) TACS 1997. LNCS, vol. 1281. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  11. 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. 12.
    Melliès, P.A., Vouillon, J.: Recursive polymorphic types and parametricity in an operational framework. In: LICS, Chicago, Illinois (2005)Google Scholar
  13. 13.
    Appel, A.W., McAllester, D.: An indexed model of recursive types for foundational proof-carrying code. ACM TOPLAS 23(5), 657–683 (2001)CrossRefGoogle Scholar
  14. 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. 15.
    Ahmed, A.J.: Semantics of Types for Mutable State. PhD thesis, Princeton University (2004)Google Scholar
  16. 16.
    Ahmed, A.: Step-indexed syntactic logical relations for recursive and quantified types. Technical Report TR-01-06, Harvard University (2006)Google Scholar
  17. 17.
    Pierce, B.C.: Types and Programming Languages. MIT Press, Cambridge (2002)MATHGoogle Scholar
  18. 18.
    Mason, I.A., Talcott, C.L.: Equivalence in functional languages with effects. Journal of Functional Programming 1(3), 287–327 (1991)MathSciNetCrossRefMATHGoogle Scholar
  19. 19.
    Sumii, E., Pierce, B.C.: A bisimulation for type abstraction and recursion. In: POPL, Long Beach, California, pp. 63–74 (2005)Google Scholar
  20. 20.
    MacQueen, D., Plotkin, G., Sethi, R.: An ideal model for recursive polymorphic types. Information and Computation 71(1/2), 95–130 (1986)MathSciNetMATHGoogle Scholar
  21. 21.
    Wadler, P.: Theorems for free! In: ACM Symposium on Functional Programming Languages and Computer Architecture (FPCA), London (1989)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Amal Ahmed
    • 1
  1. 1.Harvard UniversityCambridge

Personalised recommendations