Skip to main content

Separation Algebras for C Verification in Coq

  • Conference paper
  • First Online:

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

Abstract

Separation algebras are a well-known abstraction to capture common structure of both permissions and memories in programming languages, and form the basis of models of separation logic. As part of the development of a formal version of an operational and axiomatic semantics of the C11 standard, we present a variant of separation algebras that is well suited for C verification.

Our variant of separation algebras has been fully formalized using the Coq proof assistant, together with a library of concrete implementations. These instances are used to build a complex permission model, and a memory model that captures the strict aliasing restrictions of C.

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

Buying options

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

Learn about institutional subscriptions

Notes

  1. 1.

    In particular: “When a value is stored in an object of structure or union type, including in a member object, the bytes of the object representation that correspond to any padding bytes take unspecified values” [10, 6.2.6.1p6].

References

  1. Appel, A.W. (ed.): Program Logics for Certified Compilers. Cambridge University Press, Cambridge (2014)

    MATH  Google Scholar 

  2. Bengtson, J., Jensen, J.B., Sieczkowski, F., Birkedal, L.: Verifying object-oriented programs with higher-order separation logic in Coq. In: van Eekelen, M., Geuvers, H., Schmaltz, J., Wiedijk, F. (eds.) ITP 2011. LNCS, vol. 6898, pp. 22–38. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  3. Beringer, L., Stewart, G., Dockins, R., Appel, A.W.: Verified compilation for shared-memory C. In: Shao, Z. (ed.) ESOP 2014 (ETAPS). LNCS, vol. 8410, pp. 107–127. Springer, Heidelberg (2014)

    Chapter  Google Scholar 

  4. Bornat, R., Calcagno, C., O’Hearn, P. W., Parkinson, M. J.: Permission accounting in separation logic. In: POPL, pp. 259–270 (2005)

    Google Scholar 

  5. Boyland, J.: Checking interference with fractional permissions. In: Cousot, R. (ed.) SAS 2003. LNCS, vol. 2694, pp. 55–72. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  6. Calcagno, C., O’Hearn, P. W., Yangm, H.: Local action and abstract separation logic. In: LICS, pp. 366–378 (2007)

    Google Scholar 

  7. Coq Development Team. The Coq Proof Assistant Reference Manual (2012)

    Google Scholar 

  8. Dockins, R., Hobor, A., Appel, A.W.: A fresh look at separation algebras and share accounting. In: Hu, Z. (ed.) APLAS 2009. LNCS, vol. 5904, pp. 161–177. Springer, Heidelberg (2009)

    Chapter  Google Scholar 

  9. Ellison, C., Rosu, G.: An executable formal semantics of C with applications. In: POPL, pp. 533–544 (2012)

    Google Scholar 

  10. International Organization for Standardization. ISO/IEC 9899-2011: Programming languages - C. ISO Working Group 14 (2012)

    Google Scholar 

  11. Klein, G., Kolanski, R., Boyton, A.: Mechanised separation algebra. In: Beringer, L., Felty, A. (eds.) ITP 2012. LNCS, vol. 7406, pp. 332–337. Springer, Heidelberg (2012)

    Chapter  Google Scholar 

  12. Krebbers, R.: Aliasing restrictions of C11 formalized in Coq. In: Gonthier, G., Norrish, M. (eds.) CPP 2013. LNCS, vol. 8307, pp. 50–65. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  13. Krebbers, R.: An operational and axiomatic semantics for non-determinism and sequence points in C. In: POPL, pp. 101–112 (2014)

    Google Scholar 

  14. Krebbers, R., Wiedijk, F.: A Formalization of the C99 Standard in HOL, Isabelle and Coq. In: Davenport, J.H., Farmer, W.M., Urban, J., Rabe, F. (eds.) MKM 2011 and Calculemus 2011. LNCS, vol. 6824, pp. 301–303. Springer, Heidelberg (2011)

    Chapter  Google Scholar 

  15. Krebbers, R., Wiedijk, F.: Separation logic for non-local control flow and block scope variables. In: Pfenning, F. (ed.) FOSSACS 2013 (ETAPS 2013). LNCS, vol. 7794, pp. 257–272. Springer, Heidelberg (2013)

    Chapter  Google Scholar 

  16. Leroy, X.: Formal verification of a realistic compiler. CACM 52(7), 107–115 (2009)

    Article  Google Scholar 

  17. Leroy, X., Appel, A.W., Blazy, S., Stewart, G.: The CompCert memory model, Version 2. Research report RR-7987, INRIA (2012)

    Google Scholar 

  18. O’Hearn, P.W.: Resources, concurrency and local reasoning. In: Gardner, P., Yoshida, N. (eds.) CONCUR 2004. LNCS, vol. 3170, pp. 49–67. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  19. O’Hearn, P.W., Reynolds, J.C., Yang, H.: Local reasoning about programs that alter data structures. In: Fribourg, L. (ed.) CSL 2001 and EACSL 2001. LNCS, vol. 2142, pp. 1–19. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  20. Sozeau, M.: A new look at generalized rewriting in type theory. J. Formal Reasoning 2(1), 41–62 (2010)

    MathSciNet  Google Scholar 

Download references

Acknowledgments

I thank Freek Wiedijk and the anonymous referees for their helpful comments. This work is financed by NWO.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Robbert Krebbers .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2014 Springer International Publishing Switzerland

About this paper

Cite this paper

Krebbers, R. (2014). Separation Algebras for C Verification in Coq. In: Giannakopoulou, D., Kroening, D. (eds) Verified Software: Theories, Tools and Experiments. VSTTE 2014. Lecture Notes in Computer Science(), vol 8471. Springer, Cham. https://doi.org/10.1007/978-3-319-12154-3_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-12154-3_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-12153-6

  • Online ISBN: 978-3-319-12154-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics