Skip to main content

Verifying a Copying Garbage Collector in GP 2

  • Conference paper
  • First Online:
Software Technologies: Applications and Foundations (STAF 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 11176))

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).

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. 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

    Chapter  Google Scholar 

  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

  3. Cheney, C.J.: A nonrecursive list compacting algorithm. Commun. ACM 13(11), 677–678 (1970). https://doi.org/10.1145/362790.362798

    Article  MATH  Google Scholar 

  4. 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

    Book  MATH  Google Scholar 

  5. 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

    Article  Google Scholar 

  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 

  8. 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

    Chapter  Google Scholar 

  9. 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

    Article  MathSciNet  MATH  Google Scholar 

  10. 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

    Article  MathSciNet  Google Scholar 

  11. 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

    Article  MathSciNet  MATH  Google Scholar 

  12. Poskitt, C.M.: Verification of Graph Programs. Ph.D thesis, University of York (2013)

    Google Scholar 

  13. 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

    Article  MathSciNet  MATH  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

  15. 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

    Chapter  MATH  Google Scholar 

  16. 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

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Gia S. Wulandari .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

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)

Publish with us

Policies and ethics