Reusable Verification of a Copying Collector

  • Magnus O. Myreen
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6217)


Garbage collectors are very hard to implement correctly due to their low-level manipulation of memory. In this paper, we construct a copying garbage collector which we have proved to be functionally correct. Our verification proof is structured as a sequence of refinements to aid clarity and proof reuse; it is the first to map implementations into three different machine languages and, unlike some noteworthy published proofs, our verified implementations of memory allocation handle termination and the ‘out-of-memory’ case properly. The work presented here has been developed in the HOL4 theorem prover.


Null Pointer Garbage Collection Block Element Machine Code Separation Logic 
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.
    Benton, N.: Abstracting allocation: The new new thing. In: Ésik, Z. (ed.) CSL 2006. LNCS, vol. 4207, pp. 182–196. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  2. 2.
    Benton, N.: Machine obstructed proof (abstract). In: ACM SIGPLAN Workshop on Mechanizing Metatheory (2006)Google Scholar
  3. 3.
    Birkedal, L., Torp-Smith, N., Reynolds, J.: Local reasoning about a copying garbage collector. In: Principles of programming languages (POPL). ACM, New York (2004)Google Scholar
  4. 4.
    Böhme, S., Weber, T.: Fast LCF-style proof reconstruction for Z3. In: Theorem Proving in Higher Order Logics (TPHOLs), Springer, Heidelberg (to appear, 2010)Google Scholar
  5. 5.
    Dijkstra, E.W., Lamport, L., Martin, A.J., Scholten, C.S., Steffens, E.F.M.: On-the-fly garbage collection: an exercise in cooperation. Commun. ACM 21(11), 966–975 (1978)zbMATHCrossRefGoogle Scholar
  6. 6.
    Gonthier, G.: Verifying the safety of a practical concurrent garbage collector. In: Alur, R., Henzinger, T.A. (eds.) CAV 1996. LNCS, vol. 1102, pp. 462–465. Springer, Heidelberg (1996)Google Scholar
  7. 7.
    Gries, D.: An exercise in proving parallel programs correct. Commun. ACM 20(12), 921–930 (1977)zbMATHCrossRefMathSciNetGoogle Scholar
  8. 8.
    Guttman, J., Ramsdell, J., Wand, M.: VLISP: A verified implementation of Scheme. Lisp and Symbolic Computation 8(1/2), 5–32 (1995)CrossRefGoogle Scholar
  9. 9.
    Hawblitzel, C., Petrank, E.: Automated verification of practical garbage collectors. In: Principles of Programming Languages (POPL). ACM, New York (2009)Google Scholar
  10. 10.
    Hurd, J.: First-order proof tactics in higher-order logic theorem provers. In: Design and Application of Strategies/Tactics in Higher Order Logics (STRATA 2003), NASA/CP-2003-212448 in NASA Technical Reports, pp. 56–68 (2003)Google Scholar
  11. 11.
    Jackson, P.B.: Verifying a garbage collection algorithm. In: Grundy, J., Newey, M. (eds.) TPHOLs 1998. LNCS, vol. 1479, pp. 225–244. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  12. 12.
    McCreight, A., Shao, Z., Lin, C., Li, L.: A general framework for certifying garbage collectors and their mutators. In: Programming Language Design and Implementation (PLDI), pp. 468–479. ACM, New York (2007)Google Scholar
  13. 13.
    Myreen, M.O., Gordon, M.J.C.: Verified LISP implementations on ARM, x86 and PowerPC. In: Urban, C. (ed.) TPHOLs 2009. LNCS, vol. 5674, pp. 359–374. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  14. 14.
    Myreen, M.O., Slind, K., Gordon, M.J.C.: Machine-code verification for multiple architectures – An application of decompilation into logic. In: Formal Methods in Computer Aided Design (FMCAD). IEEE, Los Alamitos (2008)Google Scholar
  15. 15.
    Reynolds, J.: Separation logic: A logic for shared mutable data structures. In: Logic in Computer Science (LICS). IEEE Computer Society, Los Alamitos (2002)Google Scholar
  16. 16.
    Russinoff, D.M.: A mechanically verified incremental garbage collector. Formal Asp. Comput. 6(4), 359–390 (1994)zbMATHCrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Magnus O. Myreen
    • 1
  1. 1.Computer LaboratoryUniversity of CambridgeUK

Personalised recommendations