Automatic Termination Proofs for Programs with Shape-Shifting Heaps

  • Josh Berdine
  • Byron Cook
  • Dino Distefano
  • Peter W. O’Hearn
Part of the Lecture Notes in Computer Science book series (LNCS, volume 4144)


We describe a new program termination analysis designed to handle imperative programs whose termination depends on the mutation of the program’s heap. We first describe how an abstract interpretation can be used to construct a finite number of relations which, if each is well-founded, implies termination. We then give an abstract interpretation based on separation logic formulæwhich tracks the depths of pieces of heaps. Finally, we combine these two techniques to produce an automatic termination prover. We show that the analysis is able to prove the termination of loops extracted from Windows device drivers that could not be proved terminating before by other means; we also discuss a previously unknown bug found with the analysis.


Symbolic Execution Termination Proof Separation Logic Abstraction Relation Instrument Semantic 
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.
    Berdine, J., Calcagno, C., O’Hearn, P.W.: Symbolic execution with separation logic. In: Yi, K. (ed.) APLAS 2005. LNCS, vol. 3780, pp. 52–68. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  2. 2.
    Bradley, A., Manna, Z., Sipma, H.: Termination of polynomial programs. In: Cousot, R. (ed.) VMCAI 2005. LNCS, vol. 3385, pp. 113–129. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  3. 3.
    Cook, B., Podelski, A., Rybalchenko, A.: Abstraction refinement for termination. In: Hankin, C., Siveroni, I. (eds.) SAS 2005. LNCS, vol. 3672, pp. 87–101. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  4. 4.
    Cook, B., Podelski, A., Rybalchenko, A.: Termination proofs for systems code. In: PLDI (2006)Google Scholar
  5. 5.
    Cook, B., Podelski, A., Rybalchenko, A.: Terminator: Beyond safety. In: Ball, T., Jones, R.B. (eds.) CAV 2006. LNCS, vol. 4144, pp. 415–418. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  6. 6.
    Distefano, D., Katoen, J.-P., Rensink, A.: Who is pointing when to whom? on the automated verification of linked list structures. In: Lodaya, K., Mahajan, M. (eds.) FSTTCS 2004. LNCS, vol. 3328, pp. 250–262. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  7. 7.
    Distefano, D., O’Hearn, P.W., Yang, H.: A local shape analysis based on separation logic. In: Hermanns, H., Palsberg, J. (eds.) TACAS 2006. LNCS, vol. 3920, pp. 287–302. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  8. 8.
    Dor, N., Rodeh, M., Sagiv, S.: Checking cleanness in linked lists. In: Palsberg, J. (ed.) SAS 2000. LNCS, vol. 1824, pp. 115–135. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  9. 9.
    Floyd, R.W.: Assigning meanings to programs. In: Proceedings of Symposia in Applied Mathematics (1967)Google Scholar
  10. 10.
    Lee, C.S., Jones, N.D., Ben-Amram, A.M.: The size-change principle for program termination. In: POPL (2001)Google Scholar
  11. 11.
    Podelski, A., Rybalchenko, A.: A complete method for the synthesis of linear ranking functions. In: Steffen, B., Levi, G. (eds.) VMCAI 2004. LNCS, vol. 2937, pp. 239–251. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  12. 12.
    Podelski, A., Rybalchenko, A.: Transition invariants. In: LICS (2004)Google Scholar
  13. 13.
    Podelski, A., Rybalchenko, A.: Transition predicate abstraction and fair termination. In: POPL (2005)Google Scholar
  14. 14.
    Reynolds, J.: Separation logic: A logic for shared mutable data structures. In: LICS (2002)Google Scholar
  15. 15.
    Yahav, E.: Property-Guided Verification of Concurrent Heap-Manipulating Programs. PhD thesis (2004)Google Scholar
  16. 16.
    Yahav, E., Reps, T., Sagiv, M., Wilhelm, R.: Verifying temporal heap properties specified via evolution logic. In: Degano, P. (ed.) ESOP 2003. LNCS, vol. 2618, pp. 204–222. Springer, Heidelberg (2003)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Josh Berdine
    • 1
  • Byron Cook
    • 1
  • Dino Distefano
    • 2
  • Peter W. O’Hearn
    • 1
    • 2
  1. 1.Microsoft Research 
  2. 2.Queen Mary, University of London 

Personalised recommendations