Info logo
Encyclopedia

  

Hoare logic

Home :: Up
Google
www.fastload.org

Hoare logic

Hoare logic is a formal system[?] developed by the British computer scientist C. A. R. Hoare, and published in his 1969 paper "An axiomatic basis for computer programming". The purpose of the system is to provide a set of logical rules which one can use to reason about computer programs.

Let C be a line, or sequence of lines, in a computer program, and let P and Q be logical predicates such that if P is true before C is executed then Q will necessarily be true after C is executed. Then the following expression

{P} C {Q}

is an expression in Hoare logic, also known as a Hoare triple. Note that if C doesn't terminate, then there is no "after", so Q can be any statement at all.

See also:

Further reading


Placing this code on your page will help others

This article is licensed under the GNU Free Documentation License.
You may copy and modify it as long as the entire work (including additions) remains under this license.
To view or edit this article at Wikipedia, follow this link.