Abstract
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.
G. S. Wulandari—Supported by Indonesia Endowment Fund for Education (LPDP).
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Bak, C., Plump, D.: Compiling graph programs to C. In: Echahed, R., Minas, M. (eds.) ICGT 2016. LNCS, vol. 9761, pp. 102–117. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-40530-8_7
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
Cheney, C.J.: A nonrecursive list compacting algorithm. Commun. ACM 13(11), 677–678 (1970). https://doi.org/10.1145/362790.362798
Courcelle, B., Engelfriet, J.: Graph Structure and Monadic Second-Order Logic: A Language-Theoretic Approach. Cambridge University Press, Cambridge (2012). https://doi.org/10.1017/CBO9780511977619
Hobor, A., Villard, J.: The ramifications of sharing in data structures. In Proceedings Symposium on Principles of Programming Languages (POPL 2013), pp. 523–536. ACM (2013). https://doi.org/10.1145/2480359.2429131
Klarlund, N., Schwartzbach, M.: Verification of pointers. DAIMI Report Series 23(470). Aarhus University (1994). https://doi.org/10.7146/dpb.v23i470.6943
Mccreight, A.E.: The Mechanized Verification of Garbage Collector Implementations. Ph.D thesis, Yale University (2008)
Myreen, M.O.: Reusable verification of a copying collector. In: Leavens, G.T., O’Hearn, P., Rajamani, S.K. (eds.) VSTTE 2010. LNCS, vol. 6217, pp. 142–156. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-15057-9_10
Plotkin, G.D.: A structural approach to operational semantics. J. Log. Algebraic Program. 60–61, 17–139 (2004). https://doi.org/10.1016/j.jlap.2004.05.001
Plump, D.: Reasoning about graph programs. In: Proceedings Computing with Terms and Graphs (TERMGRAPH 2016), Electronic Proceedings in Theoretical Computer Science, vol. 225, pp. 35–44 (2016). https://doi.org/10.4204/EPTCS.225.6
Plump, D.: From imperative to rule-based graph programs. J. Log. Algebraic Methods Program. 88, 154–173 (2017). https://doi.org/10.1016/j.jlamp.2016.12.001
Poskitt, C.M.: Verification of Graph Programs. Ph.D thesis, University of York (2013)
Poskitt, C.M., Plump, D.: Hoare-style verification of graph programs. Fundamenta Informaticae 118(1), 135–175 (2012). https://doi.org/10.3233/FI-2012-708
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
Poskitt, C.M., Plump, D.: Verifying monadic second-order properties of graph programs. In: Giese, H., König, B. (eds.) ICGT 2014. LNCS, vol. 8571, pp. 33–48. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-09108-2_3
Torp-Smith, N., Birkedal, L., Reynolds, J.C.: Local reasoning about a copying garbage collector. ACM Trans. Program. Lang. Syst. 30(4), 24:1–24:58 (2008). https://doi.org/10.1145/964001.964020
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2018 Springer Nature Switzerland AG
About this paper
Cite this paper
Wulandari, G.S., Plump, D. (2018). Verifying a Copying Garbage Collector in GP 2. In: Mazzara, M., Ober, I., Salaün, G. (eds) Software Technologies: Applications and Foundations. STAF 2018. Lecture Notes in Computer Science(), vol 11176. Springer, Cham. https://doi.org/10.1007/978-3-030-04771-9_34
Download citation
DOI: https://doi.org/10.1007/978-3-030-04771-9_34
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-04770-2
Online ISBN: 978-3-030-04771-9
eBook Packages: Computer ScienceComputer Science (R0)