Skip to main content Accessibility help
×
Hostname: page-component-77c89778f8-vsgnj Total loading time: 0 Render date: 2024-07-18T19:28:45.647Z Has data issue: false hasContentIssue false

32 - The CompCert memory model

from IV - Operational semantics of CompCert

Published online by Cambridge University Press:  05 August 2014

Andrew W. Appel
Affiliation:
Princeton University, New Jersey
Robert Dockins
Affiliation:
Portland State University
Aquinas Hobor
Affiliation:
National University of Singapore
Lennart Beringer
Affiliation:
Princeton University, New Jersey
Josiah Dodds
Affiliation:
Princeton University, New Jersey
Gordon Stewart
Affiliation:
Princeton University, New Jersey
Sandrine Blazy
Affiliation:
Université de Rennes I, France
Xavier Leroy
Affiliation:
Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt
Get access

Summary

The imperative programming paradigm views programs as sequences of commands that update a memory state. A memory model specifies memory states and operations such as reads and writes. Such a memory model is a prerequisite to giving formal semantics to imperative programming languages, verifying properties of programs, and proving the correctness of program transformations.

For high-level, type-safe languages such as ML or the sequential fragment of Java, the memory model is simple and amounts to a finite map from abstract memory locations to the values they contain. At the other end of the complexity spectrum, we find memory models for shared-memory concurrent programs with data races and relaxed (non sequentially consistent) memory, where much effort is needed to capture the relaxations (e.g. reorderings of reads and writes) that are allowed and those that are guaranteed never to happen [1].

For CompCert we focus on memory models for the C language and for compiler intermediate languages, in the sequential case and with extensions to data race-free concurrency. C and our intermediate languages feature both low-level aspects such as pointers, pointer arithmetic, and nested objects, and high-level aspects such as separation and freshness guarantees. For instance, pointer arithmetic can result in aliasing or partial overlap between the memory areas referenced by two pointers; yet, it is guaranteed that the memory areas corresponding to two distinct variables or two successive calls to malloc are disjoint.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 2014

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • The CompCert memory model
  • Andrew W. Appel, Princeton University, New Jersey
  • Book: Program Logics for Certified Compilers
  • Online publication: 05 August 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781107256552.037
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • The CompCert memory model
  • Andrew W. Appel, Princeton University, New Jersey
  • Book: Program Logics for Certified Compilers
  • Online publication: 05 August 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781107256552.037
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • The CompCert memory model
  • Andrew W. Appel, Princeton University, New Jersey
  • Book: Program Logics for Certified Compilers
  • Online publication: 05 August 2014
  • Chapter DOI: https://doi.org/10.1017/CBO9781107256552.037
Available formats
×