Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-wzw2p Total loading time: 0 Render date: 2024-05-15T07:27:08.388Z Has data issue: false hasContentIssue false

4 - Soundness of Hoare logic

from I - Generic separation logic

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

A program logic is sound when, if you can prove some specification (such as a Hoare triple {P} c {Q}) about a program c, then when c actually executes it will obey that specification.

What does it mean to “actually execute”? If c is written in a source language L, then we can formally specify an operational semantics for L. Then we can give a formal model for the program logic in terms of the operational semantics, and formally prove the soundness of all the inference rules of the logic.

Then one is left trying to believe that the operational semantics accurately characterizes the execution of the language L. But many source languages do not directly execute; they are compiled into lower-level languages or machine language that executes it its own operational semantics. Fortunately, at this point in the 21st century we can rely on formal compiler correctness proofs, that execution in the operational semantics of the source language corresponds to execution in the operational semantics of the machine language. And the machine languages tend to be well specified; machine language is already a formal language, and it is even possible to formally prove that the logic gates of a computer chip correctly implement the instruction set architecure (ISA), that is, the machine language.

So, we prove the program correct using the program logic, we prove the program logic sound with respect to the source-language operational semantics, and prove the compiler correct with respect to the source- and machine-language semantics.

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.

  • Soundness of Hoare logic
  • 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.006
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.

  • Soundness of Hoare logic
  • 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.006
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.

  • Soundness of Hoare logic
  • 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.006
Available formats
×