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.
Supplemental Material
- }}S. Abramsky, K. Honda, and G. McCusker. A fully abstract game semantics for general references. In LICS, 1998. Google Scholar
Digital Library
- }}A. Ahmed. Semantics of Types for Mutable State. PhD thesis, Princeton University, 2004. Google Scholar
Digital Library
- }}A. Ahmed, D. Dreyer, and A. Rossberg. State-dependent representation independence. In POPL, 2009. Google Scholar
Digital Library
- }}A. Appel and D. McAllester. An indexed model of recursive types for foundational proof-carrying code. TOPLAS, 23(5):657--683, 2001. Google Scholar
Digital Library
- }}N. Benton and C.-K. Hur. Biorthogonality, step-indexing and compiler correctness. In ICFP, 2009. Google Scholar
Digital Library
- }}N. Benton and N. Tabareau. Compiling functional types to relational specifications for low level imperative code. In TLDI, 2009. Google Scholar
Digital Library
- }}N. Bohr. Advances in Reasoning Principles for Contextual Equivalence and Termination. PhD thesis, IT University of Copenhagen, 2007.Google Scholar
- }}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 Scholar
- }}D. Dreyer, G. Neis, A. Rossberg, and L. Birkedal. A relational modal logic for higher-order stateful ADTs. In POPL, 2010. Google Scholar
Digital Library
- }}M. Felleisen and R. Hieb. The revised report on the syntactic theories of sequential control and state. TCS, 103(2):235--271, 1992. Google Scholar
Digital Library
- }}D. Friedman and C. Haynes. Constraining control. In POPL, 1985. Google Scholar
Digital Library
- }}D. R. Ghica and G. McCusker. Reasoning about Idealized Algol using regular languages. In ICALP, 2000. Google Scholar
Digital Library
- }}P. Johann. Short cut fusion is correct. JFP, 13(4):797--814, 2003. Google Scholar
Digital Library
- }}P. Johann, A. Simpson, and J. Voigtländer. A generic operational metatheory for algebraic effects. In LICS, 2010. Google Scholar
Digital Library
- }}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 Scholar
Digital Library
- }}V. Koutavas and S. Lassen. Fun with fully abstract operational game semantics for general references. Unpublished, Feb. 2008.Google Scholar
- }}V. Koutavas and M. Wand. Small bisimulations for reasoning about higher-order imperative programs. In POPL, 2006. Google Scholar
Digital Library
- }}J.-L. Krivine. Classical logic, storage operators and second-order lambda-calculus. Annals of Pure and Applied Logic, 68:53--78, 1994.Google Scholar
Cross Ref
- }}J. Laird. Full abstraction for functional languages with control. In LICS, 1997. Google Scholar
Digital Library
- }}J. Laird. A fully abstract trace semantics for general references. In ICALP, 2007. Google Scholar
Digital Library
- }}S. B. Lassen and P. B. Levy. Typed normal form bisimulation. In CSL, 2007. Google Scholar
Digital Library
- }}S. B. Lassen and P. B. Levy. Typed normal form bisimulation for parametric polymorphism. In LICS, 2008. Google Scholar
Digital Library
- }}I. Mason and C. Talcott. Equivalence in functional languages with effects. JFP, 1(3):287--327, 1991.Google Scholar
Cross Ref
- }}A. S. Murawski. Functions with local state: regularity and undecidability. TCS, 338(1-3):315--349, 2005. Google Scholar
Digital Library
- }}A. S. Murawski and I. Walukiewicz. Third-order Idealized Algol with iteration is decidable. TCS, 390(2-3):214--229, 2008. Google Scholar
Digital Library
- }}P. O’Hearn and U. Reddy. Objects, interference, and the Yoneda embedding. In MFPS, 1995.Google Scholar
Cross Ref
- }}A. Pilkiewicz and F. Pottier. The essence of monotonic state. Submitted for publication, 2009.Google Scholar
- }}A. Pitts and I. Stark. Operational reasoning for functions with local state. In HOOTS, 1998. Google Scholar
Digital Library
- }}A. M. Pitts. Reasoning about local variables with operationally-based logical relations. In LICS, 1996. Google Scholar
Digital Library
- }}F. Pottier. Hiding local state in direct style: a higher-order anti-frame rule. In LICS, 2008. Google Scholar
Digital Library
- }}F. Pottier. Generalizing the higher-order frame and anti-frame rules. Unpublished, 2009.Google Scholar
- }}D. Sangiorgi, N. Kobayashi, and E. Sumii. Environmental bisimulations for higher-order languages. In LICS, 2007. Google Scholar
Digital Library
- }}J. Schwinghammer, H. Yang, L. Birkedal, F. Pottier, and B. Reus. A semantic foundation for hidden state. In FOSSACS, 2010. Google Scholar
Digital Library
- }}K. Støvring and S. B. Lassen. A complete, co-inductive syntactic theory of sequential control and state. In POPL, 2007. Google Scholar
Digital Library
- }}E. Sumii. A complete characterization of observational equivalence in polymorphic λ-calculus with general references. In CSL, 2009. Google Scholar
Digital Library
- }}E. Sumii and B. Pierce. A bisimulation for type abstraction and recursion. Journal of the ACM, 54(5):1--43, 2007. Google Scholar
Digital Library
- }}H. Thielecke. On exceptions versus continuations in the presence of state. In ESOP, 2000. Google Scholar
Digital Library
- }}N. Yoshida, K. Honda, and M. Berger. Logical reasoning for higher-order functions with local state. LMCS, 4(4:2), 2008.Google Scholar
Index Terms
The impact of higher-order state and control effects on local relational reasoning
Recommendations
The impact of higher-order state and control effects on local relational reasoning
ICFP '10: Proceedings of the 15th ACM SIGPLAN international conference on Functional programmingReasoning 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 ...
A relational modal logic for higher-order stateful ADTs
POPL '10: Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languagesThe method of logical relations is a classic technique for proving the equivalence of higher-order programs that implement the same observable behavior but employ different internal data representations. Although it was originally studied for pure, ...
A relational modal logic for higher-order stateful ADTs
POPL '10The method of logical relations is a classic technique for proving the equivalence of higher-order programs that implement the same observable behavior but employ different internal data representations. Although it was originally studied for pure, ...







Comments