Separation Logic for Higher-Order Store

  • Bernhard Reus
  • Jan Schwinghammer
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4207)


Separation Logic is a sub-structural logic that supports local reasoning for imperative programs. It is designed to elegantly describe sharing and aliasing properties of heap structures, thus facilitating the verification of programs with pointers. In past work, separation logic has been developed for heaps containing records of basic data types. Languages like C or ML, however, also permit the use of code pointers. The corresponding heap model is commonly referred to as “higher-order store” since heaps may contain commands which in turn are interpreted as partial functions between heaps.

In this paper we make Separation Logic and the benefits of local reasoning available to languages with higher-order store. In particular, we introduce an extension of the logic and prove it sound, including the Frame Rule that enables specifications of code to be extended by invariants on parts of the heap that are not accessed.


Proof Rule Separation Logic Frame Property Memory Fault Hoare Logic 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abadi, M., Leino, K.R.M.: A logic of object-oriented programs. In: Verification: Theory and Practice. Essays Dedicated to Zohar Manna on the Occasion of his 64th Birthday, pp. 11–41. Springer, Heidelberg (2004)Google Scholar
  2. 2.
    Apt, K.R., Plotkin, G.D.: Countable nondeterminism and random assignment. Journal of the ACM 33(4), 724–767 (1986)MATHCrossRefMathSciNetGoogle Scholar
  3. 3.
    Benton, N., Leperchey, B.: Relational reasoning in a nominal semantics for storage. In: Urzyczyn, P. (ed.) TLCA 2005. LNCS, vol. 3461, pp. 86–101. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  4. 4.
    Birkedal, L., Torp-Smith, N., Reynolds, J.C.: Local reasoning about a copying garbage collector. In: Proc. 31st POPL, pp. 220–231. ACM Press, New York (2004)Google Scholar
  5. 5.
    Birkedal, L., Torp-Smith, N., Yang, H.: Semantics of separation-logic typing and higher-order frame rules. In: Proc. 20th LICS. IEEE Press, Los Alamitos (2005)Google Scholar
  6. 6.
    di Gianantonio, P., Honsell, F., Plotkin, G.D.: Uncountable limits and the lambda calculus. Nordic Journal of Computing 2(2), 126–145 (1995)MATHMathSciNetGoogle Scholar
  7. 7.
    Hoare, C.A.R.: An Axiomatic Basis of Computer Programming. Communications of the ACM 12, 576–580 (1969)MATHCrossRefGoogle Scholar
  8. 8.
    Honda, K., Yoshida, N., Berger, M.: An observationally complete program logic for imperative higher-order functions. In: Proc. 20th LICS, pp. 270–279. IEEE Computer Society Press, Los Alamitos (2005)Google Scholar
  9. 9.
    Ishtiaq, S.S., O’Hearn, P.W.: BI as an assertion language for mutable data structures. ACM SIGPLAN Notices 36(3), 14–26 (2001)CrossRefGoogle Scholar
  10. 10.
    Landin, P.J.: The mechanical evaluation of expressions. Computer Journal 6(4), 308–320 (1964)MATHGoogle Scholar
  11. 11.
    Levy, P.B.: Call-By-Push-Value. A Functional/Imperative Synthesis. Semantic Structures in Computation, vol. 2. Kluwer, Dordrecht (2004)Google Scholar
  12. 12.
    Ni, Z., Shao, Z.: Certified assembly programming with embedded code pointers. In: Proc. 33rd POPL, pp. 320–333. ACM Press, New York (2006)Google Scholar
  13. 13.
    O’Hearn, P.W.: Resources, concurrency and local reasoning. In: Gardner, P., Yoshida, N. (eds.) CONCUR 2004. LNCS, vol. 3170, pp. 49–67. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  14. 14.
    O’Hearn, P.W., Reynolds, J.C., Yang, H.: Local reasoning about programs that alter data structures. In: Fribourg, L. (ed.) CSL 2001. LNCS, vol. 2142, pp. 1–18. Springer, Heidelberg (2001)CrossRefGoogle Scholar
  15. 15.
    O’Hearn, P.W., Tennent, R.D.: Semantics of local variables. In: Programming Languages and their Definition. London Mathematical Society Lecture Note Series, vol. 177, pp. 217–238. Cambridge University Press, Cambridge (1992)CrossRefGoogle Scholar
  16. 16.
    O’Hearn, P.W., Yang, H., Reynolds, J.C.: Separation and information hiding. In: Proc. 31st POPL, pp. 268–280. ACM Press, New York (2004)Google Scholar
  17. 17.
    Oles, F.J.: A Category-theoretic approach to the semantics of programming languages. PhD thesis, Syracuse University (1982)Google Scholar
  18. 18.
    Pitts, A.M.: Relational properties of domains. Information and Computation 127, 66–90 (1996)MATHCrossRefMathSciNetGoogle Scholar
  19. 19.
    Podelski, A., Schaefer, I.: Local reasoning for termination. In: Informal Workshop Proc. Verification of Concurrent Systems with Dynamically Allocated Heaps (2005)Google Scholar
  20. 20.
    Reddy, U.S., Yang, H.: Correctness of data representations involving heap data structures. Science of Computer Programming 50(1–3), 129–160 (2004)MATHCrossRefMathSciNetGoogle Scholar
  21. 21.
    Reus, B., Schwinghammer, J.: Denotational semantics for a program logic of objects. Mathematical Structures in Computer Science 16(2), 313–358 (2006)MATHCrossRefMathSciNetGoogle Scholar
  22. 22.
    Reus, B., Streicher, T.: Semantics and logic of object calculi. Theoretical Computer Science 316, 191–213 (2004)MATHCrossRefMathSciNetGoogle Scholar
  23. 23.
    Reus, B., Streicher, T.: About Hoare logics for higher-order store. In: Caires, L., Italiano, G.F., Monteiro, L., Palamidessi, C., Yung, M. (eds.) ICALP 2005. LNCS, vol. 3580, pp. 1337–1348. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  24. 24.
    Reynolds, J.C.: The essence of Algol. In: de Bakker, J.W., van Vliet, J.C. (eds.) Algorithmic Languages, pp. 345–372. North-Holland, Amsterdam (1981)Google Scholar
  25. 25.
    Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: Proc. 17th LICS, pp. 55–74. IEEE Computer Society, Los Alamitos (2002)Google Scholar
  26. 26.
    Shinwell, M.R., Pitts, A.M.: On a monadic semantics for freshness. Theoretical Computer Science 342, 28–55 (2005)MATHCrossRefMathSciNetGoogle Scholar
  27. 27.
    Smyth, M.B., Plotkin, G.D.: The category-theoretic solution of recursive domain equations. SIAM Journal on Computing 11(4), 761–783 (1982)MATHCrossRefMathSciNetGoogle Scholar
  28. 28.
    Thielecke, H.: Frame rules from answer types for code pointers. In: Proc. 33rd POPL, pp. 309–319. ACM Press, New York (2006)Google Scholar
  29. 29.
    Yang, H.: An example of local reasoning in BI pointer logic: the Schorr-Waite graph marking algorithm. In: Proc. 2nd SPACE workshop (2001)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Bernhard Reus
    • 1
  • Jan Schwinghammer
    • 2
  1. 1.Department of InformaticsUniversity of SussexBrightonUK
  2. 2.Programming Systems LabSaarland UniversitySaarbrückenGermany

Personalised recommendations