skip to main content
10.1145/1480881.1480925acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

State-dependent representation independence

Published:21 January 2009Publication History

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.

References

  1. Amal Ahmed. Step-indexed syntactic logical relations for recursive and quantified types. In ESOP, 2006. Extended/corrected version of this paper available as Harvard University TR-01-06. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Amal Ahmed and Matthias Blume. Typed closure conversion preserves observational equivalence. In ICFP, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Amal Ahmed, Derek Dreyer, and Andreas Rossberg. State-dependent representation independence (Technical appendix), 2008. Available at: http://ttic.uchicago.edu/~amal/papers/sdri/ Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Andrew W. Appel and David McAllester. An indexed model of recursive types for foundational proof-carrying code. Transactions on Programming Languages and Systems, 23(5):657--683, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Anindya Banerjee and David A. Naumann. Ownership confinement ensures representation independence in object-oriented programs. Journal of the ACM, 52(6):894--960, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Anindya Banerjee and David A. Naumann. State based ownership, reentrance, and encapsulation. In ECOOP, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Nick Benton and Benjamin Leperchey. Relational reasoning in a nominal semantics for storage. In TLCA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Lars Birkedal, Kristian Støvring, and Jacob Thamsborg. Relational parametricity for references and recursive types, July 2008. Draft, submitted for publication.Google ScholarGoogle Scholar
  9. Nina Bohr. Advances in Reasoning Principles for Contextual Equivalence and Termination. PhD thesis, IT University of Copenhagen, 2007.Google ScholarGoogle Scholar
  10. Nina Bohr and Lars Birkedal. Relational reasoning for recursive types and references. In APLAS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Karl Crary and Robert Harper. Syntactic logical relations for polymorphic and recursive types. In Computation, Meaning and Logic: Articles dedicated to Gordon Plotkin. 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Derek Dreyer, Karl Crary, and Robert Harper. A type system for higher-order modules. In POPL, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Vasileios Koutavas and Mitchell Wand. Small bisimulations for reasoning about higher-order imperative programs. In POPL, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Vasileios Koutavas and Mitchell Wand. Reasoning about class behavior. In FOOL/WOOD, 2007.Google ScholarGoogle Scholar
  15. Xavier Leroy. Applicative functors and fully transparent higher-order modules. In POPL, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Paul-André Melliès and Jérôme Vouillon. Recursive polymorphic types and parametricity in an operational framework. In LICS, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. John C. Mitchell. Representation independence and data abstraction. In POPL, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Aleksandar Nanevski, Greg Morrisett, and Lars Birkedal. Hoare type theory, polymorphism and separation. Journal of Functional Programming, 18(5&6):865--911, September 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Benjamin C. Pierce and Davide Sangiorgi. Behavioral equivalence in the polymorphic pi-calculus. Journal of the ACM, 47(3):531--586, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Andrew Pitts. Typed operational reasoning. In B. C. Pierce, editor, Advanced Topics in Types and Programming Languages, pages 245--289. The MIT Press, 2005.Google ScholarGoogle Scholar
  21. Andrew Pitts and Ian Stark. Operational reasoning for functions with local state. In HOOTS, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Uday Reddy and Hongseok Yang. Correctness of data representations involving heap data structures. In ESOP, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. John C. Reynolds. Types, abstraction and parametric polymorphism. In Information Processing, 1983.Google ScholarGoogle Scholar
  24. John C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Claudio V. Russo. Non-dependent types for Standard ML modules. In PPDP, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Davide Sangiorgi, Naoki Kobayashi, and Eijiro Sumii. Environmental bisimulations for higher-order languages. In LICS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Eijiro Sumii and Benjamin Pierce. A bisimulation for dynamic sealing. Theoretical Computer Science, 375(1-3):161--192, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Eijiro Sumii and Benjamin Pierce. A bisimulation for type abstraction and recursion. Journal of the ACM, 54(5):1--43, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Janis Voigtländer and Patricia Johann. Selective strictness and parametricity in structural operational semantics, inequationally. Theoretical Computer Science, 388(1-3):290--318, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. State-dependent representation independence

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in
            • Published in

              cover image ACM Conferences
              POPL '09: Proceedings of the 36th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
              January 2009
              464 pages
              ISBN:9781605583792
              DOI:10.1145/1480881
              • cover image ACM SIGPLAN Notices
                ACM SIGPLAN Notices  Volume 44, Issue 1
                POPL '09
                January 2009
                453 pages
                ISSN:0362-1340
                EISSN:1558-1160
                DOI:10.1145/1594834
                Issue’s Table of Contents

              Copyright © 2009 ACM

              Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

              Publisher

              Association for Computing Machinery

              New York, NY, United States

              Publication History

              • Published: 21 January 2009

              Permissions

              Request permissions about this article.

              Request Permissions

              Check for updates

              Qualifiers

              • research-article

              Acceptance Rates

              Overall Acceptance Rate824of4,130submissions,20%

              Upcoming Conference

              POPL '25

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader