skip to main content
research-article

The impact of higher-order state and control effects on local relational reasoning

Published:27 September 2010Publication History
Skip Abstract Section

Abstract

Reasoning about program equivalence is one of the oldest problems in semantics. In recent years, useful techniques have been developed, based on bisimulations and logical relations, for reasoning about equivalence in the setting of increasingly realistic languages - languages nearly as complex as ML or Haskell. Much of the recent work in this direction has considered the interesting representation independence principles enabled by the use of local state, but it is also important to understand the principles that powerful features like higher-order state and control effects disable. This latter topic has been broached extensively within the framework of game semantics, resulting in what Abramsky dubbed the "semantic cube": fully abstract game-semantic characterizations of various axes in the design space of ML-like languages. But when it comes to reasoning about many actual examples, game semantics does not yet supply a useful technique for proving equivalences.

In this paper, we marry the aspirations of the semantic cube to the powerful proof method of step-indexed Kripke logical relations. Building on recent work of Ahmed, Dreyer, and Rossberg, we define the first fully abstract logical relation for an ML-like language with recursive types, abstract types, general references and call/cc. We then show how, under orthogonal restrictions to the expressive power our language - namely, the restriction to first-order state and/or the removal of call/cc - we can enhance the proving power of our possible-worlds model in correspondingly orthogonal ways, and we demonstrate this proving power on a range of interesting examples. Central to our story is the use of state transition systems to model the way in which properties of local state evolve over time.

Skip Supplemental Material Section

Supplemental Material

icfp-tues-1055-neis.mov

References

  1. }}S. Abramsky, K. Honda, and G. McCusker. A fully abstract game semantics for general references. In LICS, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. }}A. Ahmed. Semantics of Types for Mutable State. PhD thesis, Princeton University, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. }}A. Ahmed, D. Dreyer, and A. Rossberg. State-dependent representation independence. In POPL, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. }}A. Appel and D. McAllester. An indexed model of recursive types for foundational proof-carrying code. TOPLAS, 23(5):657--683, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. }}N. Benton and C.-K. Hur. Biorthogonality, step-indexing and compiler correctness. In ICFP, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. }}N. Benton and N. Tabareau. Compiling functional types to relational specifications for low level imperative code. In TLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. }}N. Bohr. Advances in Reasoning Principles for Contextual Equivalence and Termination. PhD thesis, IT University of Copenhagen, 2007.Google ScholarGoogle Scholar
  8. }}D. Dreyer, G. Neis, and L. Birkedal. The impact of higher-order state and control effects on local relational reasoning (Technical appendix), 2010. http://www.mpi-sws.org/ dreyer/papers/stslr/Google ScholarGoogle Scholar
  9. }}D. Dreyer, G. Neis, A. Rossberg, and L. Birkedal. A relational modal logic for higher-order stateful ADTs. In POPL, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. }}M. Felleisen and R. Hieb. The revised report on the syntactic theories of sequential control and state. TCS, 103(2):235--271, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. }}D. Friedman and C. Haynes. Constraining control. In POPL, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. }}D. R. Ghica and G. McCusker. Reasoning about Idealized Algol using regular languages. In ICALP, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. }}P. Johann. Short cut fusion is correct. JFP, 13(4):797--814, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. }}P. Johann, A. Simpson, and J. Voigtländer. A generic operational metatheory for algebraic effects. In LICS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. }}P. Johann and J. Voigtländer. The impact of phseq on free theorems-based program transformations. Fundamenta Informaticae, 69(1-2):63--102, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. }}V. Koutavas and S. Lassen. Fun with fully abstract operational game semantics for general references. Unpublished, Feb. 2008.Google ScholarGoogle Scholar
  17. }}V. Koutavas and M. Wand. Small bisimulations for reasoning about higher-order imperative programs. In POPL, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. }}J.-L. Krivine. Classical logic, storage operators and second-order lambda-calculus. Annals of Pure and Applied Logic, 68:53--78, 1994.Google ScholarGoogle ScholarCross RefCross Ref
  19. }}J. Laird. Full abstraction for functional languages with control. In LICS, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. }}J. Laird. A fully abstract trace semantics for general references. In ICALP, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. }}S. B. Lassen and P. B. Levy. Typed normal form bisimulation. In CSL, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. }}S. B. Lassen and P. B. Levy. Typed normal form bisimulation for parametric polymorphism. In LICS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. }}I. Mason and C. Talcott. Equivalence in functional languages with effects. JFP, 1(3):287--327, 1991.Google ScholarGoogle ScholarCross RefCross Ref
  24. }}A. S. Murawski. Functions with local state: regularity and undecidability. TCS, 338(1-3):315--349, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. }}A. S. Murawski and I. Walukiewicz. Third-order Idealized Algol with iteration is decidable. TCS, 390(2-3):214--229, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. }}P. O’Hearn and U. Reddy. Objects, interference, and the Yoneda embedding. In MFPS, 1995.Google ScholarGoogle ScholarCross RefCross Ref
  27. }}A. Pilkiewicz and F. Pottier. The essence of monotonic state. Submitted for publication, 2009.Google ScholarGoogle Scholar
  28. }}A. Pitts and I. Stark. Operational reasoning for functions with local state. In HOOTS, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. }}A. M. Pitts. Reasoning about local variables with operationally-based logical relations. In LICS, 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. }}F. Pottier. Hiding local state in direct style: a higher-order anti-frame rule. In LICS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. }}F. Pottier. Generalizing the higher-order frame and anti-frame rules. Unpublished, 2009.Google ScholarGoogle Scholar
  32. }}D. Sangiorgi, N. Kobayashi, and E. Sumii. Environmental bisimulations for higher-order languages. In LICS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. }}J. Schwinghammer, H. Yang, L. Birkedal, F. Pottier, and B. Reus. A semantic foundation for hidden state. In FOSSACS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. }}K. Støvring and S. B. Lassen. A complete, co-inductive syntactic theory of sequential control and state. In POPL, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. }}E. Sumii. A complete characterization of observational equivalence in polymorphic λ-calculus with general references. In CSL, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. }}E. Sumii and B. Pierce. A bisimulation for type abstraction and recursion. Journal of the ACM, 54(5):1--43, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. }}H. Thielecke. On exceptions versus continuations in the presence of state. In ESOP, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. }}N. Yoshida, K. Honda, and M. Berger. Logical reasoning for higher-order functions with local state. LMCS, 4(4:2), 2008.Google ScholarGoogle Scholar

Index Terms

  1. The impact of higher-order state and control effects on local relational reasoning

            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

            Full Access

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader

            ePub

            View this article in ePub.

            View ePub
            About Cookies On This Site

            We use cookies to ensure that we give you the best experience on our website.

            Learn more

            Got it!