Relational parametricity and local variables

  • Authors:
  • P. W. O'Hearn;R. D. Tennent

  • Affiliations:
  • -;-

  • Venue:
  • POPL '93 Proceedings of the 20th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 1993

Quantified Score

Hi-index 0.00

Visualization

Abstract

J. C. Reynolds suggested that Strachey's intuitive concept of “parametric” (i.e., uniform) polymorphism is closely linked to representation independence, and used logical relations to formalize this principle in languages with type variables and user-defined types. Here, we use relational parametricity to address long-standing problems with the semantics of local-variable declarations, by showing that interactions between local and non-local entities satisfy certain relational criteria.The new model is based on a cartesian closed category of “relation-preserving” functors and natural transformations which is induced by a suitable category of “possible worlds” with relations assigned to its objects and morphisms. The semantic interpretation supports straightforward validations of all the test equivalences that have been proposed in the literature, and encompasses standard methods of reasoning about data representations; however, it is not known whether it is fully abstract.