Affiliation:
1. TTI-C, Chicago, IL, USA
2. MPI-SWS, Saarbrücken, Germany
Abstract
Mitchell's notion of representation independence is a particularly useful application of Reynolds' relational parametricity -- two different implementations of an abstract data type can be shown contextually equivalent so long as there exists a relation between their type representations that is preserved by their operations. There have been a number of methods proposed for proving representation independence in various pure extensions of System F (where data abstraction is achieved through existential typing), as well as in Algol- or Java-like languages (where data abstraction is achieved through the use of local mutable state). However, none of these approaches addresses the interaction of existential type abstraction and local state. In particular, none allows one to prove representation independence results for generative ADTs -- i.e. ADTs that both maintain some local state and define abstract types whose internal representations are dependent on that local state.
In this paper, we present a syntactic, logical-relations-based method for proving representation independence of generative ADTs in a language supporting polymorphic types, existential types, general recursive types, and unrestricted ML-style mutable references. We demonstrate the effectiveness of our method by using it to prove several interesting contextual equivalences that involve a close interaction between existential typing and local state, as well as some well-known equivalences from the literature (such as Pitts and Stark's "awkward" example) that have caused trouble for previous logical-relations-based methods.
The success of our method relies on two key technical innovations. First, in order to handle generative ADTs, we develop a possible-worlds model in which relational interpretations of types are allowed to grow over time in a manner that is tightly coupled with changes to some local state. Second, we employ a step-indexed stratification of possible worlds, which facilitates a simplified account of mutable references of higher type.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Reference29 articles.
1. Step-Indexed Syntactic Logical Relations for Recursive and Quantified Types
2. Typed closure conversion preserves observational equivalence
3. Amal Ahmed Derek Dreyer and Andreas Rossberg. State-dependent representation independence (Technical appendix) 2008. Available at: http://ttic.uchicago.edu/~amal/papers/sdri/ 10.1145/1480881.1480925 Amal Ahmed Derek Dreyer and Andreas Rossberg. State-dependent representation independence (Technical appendix) 2008. Available at: http://ttic.uchicago.edu/~amal/papers/sdri/ 10.1145/1480881.1480925
4. An indexed model of recursive types for foundational proof-carrying code
5. Ownership confinement ensures representation independence for object-oriented programs
Cited by
83 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. GADTs are not (Even partial) functors;Mathematical Structures in Computer Science;2024-08-27
2. Contextual Equivalence for State and Control via Nested Data;Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science;2024-07-08
3. Pushdown Normal-Form Bisimulation: A Nominal Context-Free Approach to Program Equivalence;Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science;2024-07-08
4. Bialgebraic Reasoning on Higher-order Program Equivalence;Proceedings of the 39th Annual ACM/IEEE Symposium on Logic in Computer Science;2024-07-08
5. The Logical Essence of Well-Bracketed Control Flow;Proceedings of the ACM on Programming Languages;2024-01-05