Formal Verification of a Memory Model for C-Like Imperative Languages

  • Sandrine Blazy
  • Xavier Leroy
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3785)


This paper presents a formal verification with the Coq proof assistant of a memory model for C-like imperative languages. This model defines the memory layout and the operations that manage the memory. The model has been specified at two levels of abstraction and implemented as part of an ongoing certification in Coq of a moderately-optimising C compiler. Many properties of the memory have been verified in the specification. They facilitate the definition of precise formal semantics of C pointers. A certified OCaml code implementing the memory model has been automatically extracted from the specifications.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    The Coq proof assistant,
  2. 2.
    Appel, A.W.: Foundational proof-carrying code. In: IEEE Symp. on Logic in Computer Science (LICS), Washington, DC, USA, p. 247 (June 2001)Google Scholar
  3. 3.
    Sampaio, A.: An algebraic approach to compiler design. AMAST series in computing, vol. 4. World Scientific, Singapore (1997)zbMATHCrossRefGoogle Scholar
  4. 4.
    Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development Coq’Art: The Calculus of Inductive Constructions. Springer, Heidelberg (2004)zbMATHGoogle Scholar
  5. 5.
    Bornat, R.: Proving pointer programs in Hoare logic. In: 5th Conf. on Mathematics of Program Construction, pp. 102–126. Springer, Heidelberg (2000)CrossRefGoogle Scholar
  6. 6.
    Cachera, D., Jensen, T., Pichardie, D., Rusu, V.: Extracting a Data Flow Analyser in Constructive Logic. In: Schmidt, D. (ed.) ESOP 2004. LNCS, vol. 2986, pp. 385–400. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  7. 7.
    Chrząszcz, J.: Modules in Type Theory with Generative Definitions. PhD thesis, Warsaw Univerity and University of Paris-Sud (January 2004)Google Scholar
  8. 8.
    Yu, D., Shao, Z.: Verification of safety properties for concurrent assembly code. In: Int. Conf. on Functional Programming (ICFP), Snowbird, USA, pp. 175–188 (September 2004)Google Scholar
  9. 9.
    Filliâtre, J.-C., Marché, C.: Multi-Prover Verification of C Programs. In: Davies, J., Schulte, W., Barnett, M. (eds.) ICFEM 2004. LNCS, vol. 3308, pp. 15–29. Springer, Heidelberg (2004)CrossRefGoogle Scholar
  10. 10.
    Goos, G., Zimmermann, W.: Verification of compilers. In: Correct System Design, Recent Insight and Advances, London, UK, pp. 201–230. Springer, Heidelberg (1999)Google Scholar
  11. 11.
    Watson, G.: Compilation by refinement for a practical assembly language. In: Dong, J.S., Woodcock, J. (eds.) ICFEM 2003. LNCS, vol. 2885, pp. 286–305. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  12. 12.
    Hamid, N., Shao, Z., Trifonov, V., Monnier, S., Ni, Z.: A syntactic approach to foundational proof-carrying code. Journal of Automated Reasoning 31(3-4), 191–229 (2003)zbMATHCrossRefGoogle Scholar
  13. 13.
    Leroy, X.: Formal certification of a compiler back-end, or: programming a compiler with a proof assistant (2005) (draft, submitted for publication)Google Scholar
  14. 14.
    Letouzey, P.: Programmation fonctionnelle certifiée – L’extraction de programmes dans l’assistant Coq. PhD thesis, Université Paris-Sud (July 2004)Google Scholar
  15. 15.
    Mehta, F., Nipkow, T.: Proving pointer programs in higher-order logic. In: Baader, F. (ed.) CADE 2003. LNCS (LNAI), vol. 2741, pp. 121–135. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  16. 16.
    Mijajlovic, I., Torp-Smith, N.: Refinement in separation context. In: Second workshop on semantics, program anlysis and computing analysis for memory management (SPACE), Venice, Italy (January 2004)Google Scholar
  17. 17.
    Necula, G.: Proof carrying code. In: Proc. of Principles Of Progamming Languages Conf, POPL (January 1997)Google Scholar
  18. 18.
    Necula, G.: Translation validation for an optimizing compiler. In: ACM SIGPLAN Conf. on Programming Language Design and Implementation (PLDI), pp. 83–95 (2000)Google Scholar
  19. 19.
    Pnueli, A., Siegel, M., Singerman, E.: Translation validation. In: Steffen, B. (ed.) TACAS 1998. LNCS, vol. 1384, pp. 151–166. Springer, Heidelberg (1998)CrossRefGoogle Scholar
  20. 20.
    Rinard, M., Marinov, D.: Credible compilation with pointers. In: Workshop on Run-Time Result Verification (RTRV), Trento, Italy (July 1999)Google Scholar
  21. 21.
    Rival, X.: Symbolic transfer function-based approaches to certified compilation. In: Principles Of Progamming Languages Conf. (POPL), pp. 1–13 (2004)Google Scholar
  22. 22.
    Shen, X.: Arvind, and L. Rudolph: Commit-reconcile & fences (CRF): a new memory model for architects and compiler writers. In: ISCA 1999: 26th symposium on Computer architecture, Washington, DC, USA, pp. 150–161 (1999)Google Scholar
  23. 23.
    Lerner, S., Millstein, T., Rice, E., Chambers, C.: Automated soundness proofs for dataflow analyses and transformations. In: Principles Of Progamming Languages Conf. (POPL), Long Beach, USA (2005)Google Scholar
  24. 24.
    Monnier, S.: Typed regions. In: workshop on semantics, program anlysis and computing analysis for memory management (SPACE), Venice, Italy (January 2004)Google Scholar
  25. 25.
    Tennent, R.D., Ghica, D.R.: Abstract models of storage. Higher-Order and Symbolic Computation 13(1/2), 119–129 (2000)zbMATHCrossRefGoogle Scholar
  26. 26.
    Walker, D.: Stacks, heaps and regions: one logic to bind them. In: Second workshop on semantics, program anlysis and computing analysis for memory management (SPACE), Venice, Italy (January 2004) (invited talk)Google Scholar
  27. 27.
    Hu, Y., Barrett, C., Goldberg, B., Pnueli, A.: Validating more loop optimizations. In: Workshop on Compiler Optimization Meets Compiler Verification (COCV), Edinburgh, UK (2005)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2005

Authors and Affiliations

  • Sandrine Blazy
    • 1
  • Xavier Leroy
    • 1
  1. 1.INRIA RocquencourtLe ChesnayFrance

Personalised recommendations