Specification Patterns and Proofs for Recursion through the Store

  • Nathaniel Charlton
  • Bernhard Reus
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6914)


Higher-order store means that code can be stored on the mutable heap that programs manipulate, and is the basis of flexible software that can be changed or re-configured at runtime. Specifying such programs is challenging because of recursion through the store, where new (mutual) recursions between code are set up on the fly. This paper presents a series of formal specification patterns that capture increasingly complex uses of recursion through the store. To express the necessary specifications we extend the separation logic for higher-order store given by Schwinghammer et al. (CSL, 2009), adding parameter passing, and certain recursively defined families of assertions. Finally, we apply our specification patterns and rules to an example program that exploits many of the possibilities offered by higher-order store; this is the first larger case study conducted with logical techniques based on work by Schwinghammer et al. (CSL, 2009), and shows that they are practical.


Tree Node Main Program Separation Logic Code List Left Subtree 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    The Crowfoot website (includes a version of the example in this paper),
  2. 2.
    Abadi, M., Cardelli, L.: A Theory of Objects. Springer-Verlag New York, Inc, Secaucus (1996)CrossRefzbMATHGoogle Scholar
  3. 3.
    Berdine, J., Calcagno, C., O’Hearn, P.W.: Smallfoot: Modular automatic assertion checking with separation logic. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 115–137. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  4. 4.
    Birkedal, L., Torp-Smith, N., Yang, H.: Semantics of separation-logic typing and higher-order frame rules for Algol-like languages. LMCS, vol. 2(5) (2006)Google Scholar
  5. 5.
    Charlton, N., Horsfall, B., Reus, B.: Formal reasoning about runtime code update. In: Abiteboul, S., Böhm, K., Koch, C., Tan, K.-L. (eds.) ICDE Workshops, pp. 134–138. IEEE, Los Alamitos (2011)Google Scholar
  6. 6.
    Corbet, J., Rubini, A., Kroah-Hartman, G.: Linux device drivers, 3rd edn. O’Reilly Media, Sebastopol (2005)zbMATHGoogle Scholar
  7. 7.
    Distefano, D., Parkinson, M.J.: jStar: towards practical verification for Java. In: OOPSLA, pp. 213–226 (2008)Google Scholar
  8. 8.
    Gamma, E., Helm, R., Johnson, R.E., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, Reading (1995)zbMATHGoogle Scholar
  9. 9.
    Henderson, B.: Linux loadable kernel module HOWTO, v1.09 (2006),
  10. 10.
    Honda, K., Yoshida, N., Berger, M.: An observationally complete program logic for imperative higher-order functions. In: LICS, pp. 270–279 (2005)Google Scholar
  11. 11.
    Jacobs, B., Smans, J., Piessens, F.: A quick tour of the veriFast program verifier. In: Ueda, K. (ed.) APLAS 2010. LNCS, vol. 6461, pp. 304–311. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  12. 12.
    Krishnaswami, N.R., Aldrich, J., Birkedal, L., Svendsen, K., Buisse, A.: Design patterns in separation logic. In: TLDI, pp. 105–116 (2009)Google Scholar
  13. 13.
    Landin, P.J.: The mechanical evaluation of expressions. Computer Journal 6(4), 308–320 (1964)CrossRefzbMATHGoogle Scholar
  14. 14.
    Neamtiu, I., Hicks, M.W., Stoyle, G., Oriol, M.: Practical dynamic software updating for C. In: PLDI, pp. 72–83 (2006)Google Scholar
  15. 15.
    Ni, Z., Shao, Z.: Certified assembly programming with embedded code pointers. In: POPL, pp. 320–333 (2006)Google Scholar
  16. 16.
    Parkinson, M.J., Bierman, G.M.: Separation logic, abstraction and inheritance. In: POPL, pp. 75–86 (2008)Google Scholar
  17. 17.
    Reynolds, J.C.: Separation logic: A logic for shared mutable data structures. In: LICS, pp. 55–74 (2002)Google Scholar
  18. 18.
    Schwinghammer, J., Birkedal, L., Reus, B., Yang, H.: Nested hoare triples and frame rules for higher-order store. In: Grädel, E., Kahle, R. (eds.) CSL 2009. LNCS, vol. 5771, pp. 440–454. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  19. 19.
    Stoyle, G., Hicks, M., Bierman, G., Sewell, P., Neamtiu, I.: Mutatis mutandis: Safe and predictable dynamic software updating. ACM Trans. Program. Lang. Syst. 29(4) (2007)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Nathaniel Charlton
    • 1
  • Bernhard Reus
    • 1
  1. 1.University of SussexBrightonUK

Personalised recommendations