Nothing Special   »   [go: up one dir, main page]

skip to main content
research-article

State-dependent representation independence

Published: 21 January 2009 Publication 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.
[2]
Amal Ahmed and Matthias Blume. Typed closure conversion preserves observational equivalence. In ICFP, 2008.
[3]
Amal Ahmed, Derek Dreyer, and Andreas Rossberg. State-dependent representation independence (Technical appendix), 2008. Available at: http://ttic.uchicago.edu/~amal/papers/sdri/
[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.
[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.
[6]
Anindya Banerjee and David A. Naumann. State based ownership, reentrance, and encapsulation. In ECOOP, 2005.
[7]
Nick Benton and Benjamin Leperchey. Relational reasoning in a nominal semantics for storage. In TLCA, 2005.
[8]
Lars Birkedal, Kristian Støvring, and Jacob Thamsborg. Relational parametricity for references and recursive types, July 2008. Draft, submitted for publication.
[9]
Nina Bohr. Advances in Reasoning Principles for Contextual Equivalence and Termination. PhD thesis, IT University of Copenhagen, 2007.
[10]
Nina Bohr and Lars Birkedal. Relational reasoning for recursive types and references. In APLAS, 2006.
[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.
[12]
Derek Dreyer, Karl Crary, and Robert Harper. A type system for higher-order modules. In POPL, 2003.
[13]
Vasileios Koutavas and Mitchell Wand. Small bisimulations for reasoning about higher-order imperative programs. In POPL, 2006.
[14]
Vasileios Koutavas and Mitchell Wand. Reasoning about class behavior. In FOOL/WOOD, 2007.
[15]
Xavier Leroy. Applicative functors and fully transparent higher-order modules. In POPL, 1995.
[16]
Paul-André Melliès and Jérôme Vouillon. Recursive polymorphic types and parametricity in an operational framework. In LICS, 2005.
[17]
John C. Mitchell. Representation independence and data abstraction. In POPL, 1986.
[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.
[19]
Benjamin C. Pierce and Davide Sangiorgi. Behavioral equivalence in the polymorphic pi-calculus. Journal of the ACM, 47(3):531--586, 2000.
[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.
[21]
Andrew Pitts and Ian Stark. Operational reasoning for functions with local state. In HOOTS, 1998.
[22]
Uday Reddy and Hongseok Yang. Correctness of data representations involving heap data structures. In ESOP, 2003.
[23]
John C. Reynolds. Types, abstraction and parametric polymorphism. In Information Processing, 1983.
[24]
John C. Reynolds. Separation logic: A logic for shared mutable data structures. In LICS, 2002.
[25]
Claudio V. Russo. Non-dependent types for Standard ML modules. In PPDP, 1999.
[26]
Davide Sangiorgi, Naoki Kobayashi, and Eijiro Sumii. Environmental bisimulations for higher-order languages. In LICS, 2007.
[27]
Eijiro Sumii and Benjamin Pierce. A bisimulation for dynamic sealing. Theoretical Computer Science, 375(1-3):161--192, 2007.
[28]
Eijiro Sumii and Benjamin Pierce. A bisimulation for type abstraction and recursion. Journal of the ACM, 54(5):1--43, 2007.
[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.

Cited By

View all
  • (2022)GADTs, Functoriality, Parametricity: Pick TwoElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.357.6357(77-92)Online publication date: 7-Apr-2022
  • (2021)Session logical relations for noninterferenceProceedings of the 36th Annual ACM/IEEE Symposium on Logic in Computer Science10.1109/LICS52264.2021.9470654(1-14)Online publication date: 29-Jun-2021
  • (2021)Compositional relational reasoning via operational game semanticsProceedings of the 36th Annual ACM/IEEE Symposium on Logic in Computer Science10.1109/LICS52264.2021.9470524(1-13)Online publication date: 29-Jun-2021
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

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
  • 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
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
Published in SIGPLAN Volume 44, Issue 1

Check for updates

Author Tags

  1. abstract data types
  2. existential types
  3. local state
  4. representation independence
  5. step-indexed logical relations

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)37
  • Downloads (Last 6 weeks)6
Reflects downloads up to 01 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2022)GADTs, Functoriality, Parametricity: Pick TwoElectronic Proceedings in Theoretical Computer Science10.4204/EPTCS.357.6357(77-92)Online publication date: 7-Apr-2022
  • (2021)Session logical relations for noninterferenceProceedings of the 36th Annual ACM/IEEE Symposium on Logic in Computer Science10.1109/LICS52264.2021.9470654(1-14)Online publication date: 29-Jun-2021
  • (2021)Compositional relational reasoning via operational game semanticsProceedings of the 36th Annual ACM/IEEE Symposium on Logic in Computer Science10.1109/LICS52264.2021.9470524(1-13)Online publication date: 29-Jun-2021
  • (2021)Complete trace models of state and controlProgramming Languages and Systems10.1007/978-3-030-72019-3_13(348-374)Online publication date: 23-Mar-2021
  • (2020)Program equivalence for assisted grading of functional programsProceedings of the ACM on Programming Languages10.1145/34282394:OOPSLA(1-29)Online publication date: 13-Nov-2020
  • (2020)Type-Based Declassification for FreeFormal Methods and Software Engineering10.1007/978-3-030-63406-3_11(181-197)Online publication date: 19-Dec-2020
  • (2019)SyTeCi: automating contextual equivalence for higher-order programs with referencesProceedings of the ACM on Programming Languages10.1145/33711274:POPL(1-28)Online publication date: 20-Dec-2019
  • (2019)Binders by day, labels by night: effect instances via lexically scoped handlersProceedings of the ACM on Programming Languages10.1145/33711164:POPL(1-29)Online publication date: 20-Dec-2019
  • (2019)The next 700 relational program logicsProceedings of the ACM on Programming Languages10.1145/33710724:POPL(1-33)Online publication date: 20-Dec-2019
  • (2019)Reasoning about a Machine with Local CapabilitiesACM Transactions on Programming Languages and Systems10.1145/336351942:1(1-53)Online publication date: 10-Dec-2019
  • Show More Cited By

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media