Aliasing Restrictions of C11 Formalized in Coq

  • Robbert Krebbers
Part of the Lecture Notes in Computer Science book series (LNCS, volume 8307)

Abstract

The C11 standard of the C programming language describes dynamic typing restrictions on memory operations to make more effective optimizations based on alias analysis possible. These restrictions are subtle due to the low-level nature of C, and have not been treated in a formal semantics before. We present an executable formal memory model for C that incorporates these restrictions, and at the same time describes required low-level operations.

Our memory model and essential properties of it have been fully formalized using the Coq proof assistant.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Affeldt, R., Marti, N.: Towards formal verification of TLS network packet processing written in C. In: PLPV, pp. 35–46 (2013)Google Scholar
  2. 2.
    Batty, M., Owens, S., Sarkar, S., Sewell, P., Weber, T.: Mathematizing C++ concurrency. In: POPL, pp. 55–66 (2011)Google Scholar
  3. 3.
    Ellison, C., Rosu, G.: An executable formal semantics of C with applications. In: POPL, pp. 533–544 (2012)Google Scholar
  4. 4.
    GNU. GCC, the GNU Compiler Collection (2011), http://gcc.gnu.org/
  5. 5.
    International Organization for Standardization. WG14 Defect Report Summary (2008), http://www.open-std.org/jtc1/sc22/wg14/www/docs/
  6. 6.
    International Organization for Standardization. ISO/IEC 9899-2011: Programming languages – C. ISO Working Group 14 (2012)Google Scholar
  7. 7.
    Krebbers, R.: An operational and axiomatic semantics for non-determinism and sequence points in C. To appear in: POPL 2014 (2013)Google Scholar
  8. 8.
    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.) Calculemus/MKM 2011. LNCS (LNAI), vol. 6824, pp. 301–303. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  9. 9.
    Krebbers, R., Wiedijk, F.: Separation Logic for Non-local Control Flow and Block Scope Variables. In: Pfenning, F. (ed.) FOSSACS 2013. LNCS, vol. 7794, pp. 257–272. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  10. 10.
    Leroy, X., Appel, A.W., Blazy, S., Stewart, G.: The CompCert Memory Model, Version 2. Research report RR-7987, INRIA (2012)Google Scholar
  11. 11.
    Leroy, X., Blazy, S.: Formal verification of a C-like memory model and its uses for verifying program transformations. JAR 41(1), 1–31 (2008)MathSciNetCrossRefMATHGoogle Scholar
  12. 12.
    Maclaren, N.: What is an Object in C Terms?, Mailing list message (2001), http://www.open-std.org/jtc1/sc22/wg14/9350
  13. 13.
    Nita, M., Grossman, D., Chambers, C.: A theory of platform-dependent low-level software. In: POPL, pp. 209–220 (2008)Google Scholar
  14. 14.
    Norrish, M.: C formalised in HOL. PhD thesis, University of Cambridge (1998)Google Scholar
  15. 15.
    Ramananandro, T., Dos Reis, G., Leroy, X.: Formal verification of object layout for C++ multiple inheritance. In: POPL, pp. 67–80 (2011)Google Scholar
  16. 16.
    Robert, V., Leroy, X.: A Formally-Verified Alias Analysis. In: Hawblitzel, C., Miller, D. (eds.) CPP 2012. LNCS, vol. 7679, pp. 11–26. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  17. 17.
    Rossie, J.G., Friedman, D.P.: An Algebraic Semantics of Subobjects. In: OOPSLA, pp. 187–199 (1995)Google Scholar
  18. 18.
    Tuch, H., Klein, G., Norrish, M.: Types, bytes, and separation logic. In: POPL, pp. 97–108 (2007)Google Scholar

Copyright information

© Springer International Publishing Switzerland 2013

Authors and Affiliations

  • Robbert Krebbers
    • 1
  1. 1.ICISRadboud University NijmegenThe Netherlands

Personalised recommendations