Verifying a Copying Garbage Collector in GP 2
Cheney’s copying garbage collector is regarded as a challenging test case for formal approaches to the verification of imperative programs with pointers. The algorithm works for possibly cyclic data structures with unrestricted sharing which cannot be handled by standard separation logics. In addition, the algorithm relocates data and requires establishing an isomorphism between the initial and the final data structure of a program run.
We present an implementation of Cheney’s garbage collector in the graph programming language GP 2 and a proof that it is totally correct. Our proof is shorter and less complicated than comparable proofs in the literature. This is partly due to the fact that the GP 2 program abstracts from details of memory management such as address arithmetic. We use sound proof rules previously employed in the verification of GP 2 programs but treat assertions semantically because current assertion languages for graph transformation cannot express the existence of an isomorphism between initial and final graphs.
- 2.Birkedal, L., Torp-Smith, N., Reynolds, J.C.: Local reasoning about a copying garbage collector. In Proceedings Symposium on Principles of Programming Languages (POPL 2004), pp. 220–231. ACM (2004). https://doi.org/10.1145/964001.964020
- 6.Klarlund, N., Schwartzbach, M.: Verification of pointers. DAIMI Report Series 23(470). Aarhus University (1994). https://doi.org/10.7146/dpb.v23i470.6943
- 7.Mccreight, A.E.: The Mechanized Verification of Garbage Collector Implementations. Ph.D thesis, Yale University (2008)Google Scholar
- 12.Poskitt, C.M.: Verification of Graph Programs. Ph.D thesis, University of York (2013)Google Scholar
- 14.Poskitt, C.M., Plump, D.: Verifying total correctness of graph programs. In: Proceedings International Workshop on Graph Computation Models (GCM 2012) 2012. Revised version, Electronic Communications of the EASST, vol. 61 (2013). https://doi.org/10.14279/tuj.eceasst.61.827