Advertisement

Relational Parametricity for a Polymorphic Linear Lambda Calculus

  • Jianzhou Zhao
  • Qi Zhang
  • Steve Zdancewic
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6461)

Abstract

This paper presents a novel syntactic logical relation for a polymorphic linear λ-calculus that treats all types as linear and introduces the constructor ! to account for intuitionistic terms, and System F°—an extension of System F that uses kinds to distinguish linear from intuitionistic types. We define a logical relation for open values under both open linear and intuitionistic contexts, then extend it for open terms with evaluation and open relation substitutions. Relations that instantiate type quantifiers are for open terms and types. We demonstrate the applicability of this logical relation through its soundness with respect to contextual equivalence, along with free theorems for linearity that are difficult to achieve by closed logical relations. When interpreting types on only closed terms, the model defaults to a closed logical relation that is both sound and complete with respect to contextual equivalence and is sufficient to reason about isomorphisms of type encodings. All of our results have been mechanically verified in Coq.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Ahmed, A.: Step-indexed syntactic logical relations for recursive and quantified types. In: Sestoft, P. (ed.) ESOP 2006. LNCS, vol. 3924, pp. 69–83. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  2. 2.
    Ahmed, A., Dreyer, D., Rossberg, A.: State-dependent representation independence. SIGPLAN Not. 44(1), 340–353 (2009)CrossRefzbMATHGoogle Scholar
  3. 3.
    Aydemir, B., Charguéraud, A., Pierce, B.C., Pollack, R., Weirich, S.: Engineering formal metatheory. In: POPL 2008: Proceedings of the 35th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages (2008)Google Scholar
  4. 4.
    Barber, A.: Linear Type Theories, Semantics and Action Calculi. PhD thesis, Edinburgh University (1997)Google Scholar
  5. 5.
    Bierman, G.M.: Program equivalence in a linear functional language. J. Funct. Program. 10(2), 167–190 (2000)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Bierman, G.M., Pitts, A.M., Russo, C.V.: Operational properties of lily, a polymorphic linear lambda calculus with recursion. In: Proc. of HOOTS. ENTCS, vol. 41. Elsevier, Amsterdam (2000)Google Scholar
  7. 7.
    Birkedal, L., Møgelberg, R.E., Petersen, R.L.: Linear Abadi and Plotkin logic. Logical Methods in Computer Science 2(5:1), 1–33 (2006)MathSciNetzbMATHGoogle Scholar
  8. 8.
    Birkedal, L., Støvring, K., Thamsborg, J.: Relational parametricity for references and recursive types. In: TLDI 2009: Proceedings of the 4th International Workshop on Types in Language Design and Implementation, pp. 91–104. ACM, New York (2009)Google Scholar
  9. 9.
    The Coq Development Team. The Coq Proof Assistant Reference Manual, Version 8.2 (2009), http://coq.inria.fr
  10. 10.
    Crary, K.: Logical Relations and a Case Study in Equivalence Checking. In: Advanced Topics in Types and Programming Languages. MIT Press, Cambridge (2005)Google Scholar
  11. 11.
    Crole, R.L.: Completeness of bisimilarity for contextual equivalence in linear theories. Logic Jnl IGPL 9(1), 27–51 (2001)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Donnelly, K., Xi, H.: A formalization of strong normalization for simply-typed lambda-calculus and System F. Electron. Notes Theor. Comput. Sci. 174(5), 109–125 (2007)CrossRefzbMATHGoogle Scholar
  13. 13.
    Girard, J.-Y.: Interprétation fonctionnelle et élimination des coupures de l’arith mé tique d’ordre supérieur. Thèse d’état (1972); Summary in Fenstad, J.E. (ed.): Scandinavian Logic Symposium, pp. 63–92. North-Holland, Amsterdam (1971)Google Scholar
  14. 14.
    Hasegawa, M.: Logical predicates for intuitionistic linear type theories. In: Girard, J.-Y. (ed.) TLCA 1999. LNCS, vol. 1581, pp. 198–213. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  15. 15.
    Mason, I., Talcott, C.: Equivalence in functional languages with effects. J. Funct. Program. 1(3), 245–285 (1991)MathSciNetCrossRefzbMATHGoogle Scholar
  16. 16.
    Mazurak, K., Zhao, J., Zdancewic, S.: Lightweight linear types in system \(\textrm{F}^{\o}\). In: TLDI 2010: Proceedings of the 4th International Workshop on Types in Language Design and Implementation (2010)Google Scholar
  17. 17.
    Pitts, A.: Typed Operational Reasoning. In: Advanced Topics in Types and Programming Languages. MIT Press, Cambridge (2005)Google Scholar
  18. 18.
    Reynolds, J.C.: Types, abstraction, and parametric polymorphism. In: Mason, R.E.A. (ed.) Information Processing, pp. 513–523. Elsevier Science Publishers B.V., Amsterdam (1983)Google Scholar
  19. 19.
    Schürmann, C., Sarnat, J.: Towards a judgmental reconstruction of logical relation proofs. Technical report, Yale University (2006)Google Scholar
  20. 20.
    Sewell, P., Nardelli, F.Z., Owens, S., Peskine, G., Ridge, T., Sarkar, S., Strniša, R.: Ott: Effective Tool Support for the Working Semanticist. J. Funct. Program. 20(1), 71–122 (2010)CrossRefzbMATHGoogle Scholar
  21. 21.
    Tait, W.W.: Intensional interpretations of functionals of finite type I. Journal of Symbolic Logic 32(2), 198–212 (1967)MathSciNetCrossRefzbMATHGoogle Scholar
  22. 22.
    Vytiniotis, D., Weirich, S.: Free theorems and runtime type representations. Electron. Notes Theor. Comput. Sci. 173, 357–373 (2007)CrossRefzbMATHGoogle Scholar
  23. 23.
    Wadler, P.: Theorems for free! In: Proceedings of the 4th International Symposium on Functional Programming and Computer Architecture (September 1989)Google Scholar
  24. 24.
    Walker, D.: Substructural Type Systems. In: Advanced Topics in Types and Programming Languages. MIT Press, Cambridge (2005)Google Scholar
  25. 25.
    Zhao, J., Zhang, Q., Zdancewic, S.: Relational parametricity for a polymorphic linear lambda calculus. Technical report (2010), http://www.cis.upenn.edu/~jianzhou/parametricity4linf

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Jianzhou Zhao
    • 1
  • Qi Zhang
    • 1
  • Steve Zdancewic
    • 1
  1. 1.University of PennsylvaniaUSA

Personalised recommendations