Hoare Logic - Hoare Triple

The central feature of Hoare logic is the Hoare triple. A triple describes how the execution of a piece of code changes the state of the computation. A Hoare triple is of the form

where P and Q are assertions and C is a command. P is named the precondition and Q the postcondition: when the precondition is met, the command establishes the postcondition. Assertions are formulae in predicate logic.

Hoare logic provides axioms and inference rules for all the constructs of a simple imperative programming language. In addition to the rules for the simple language in Hoare's original paper, rules for other language constructs have been developed since then by Hoare and many other researchers. There are rules for concurrency, procedures, jumps, and pointers.

Read more about this topic:  Hoare Logic

Famous quotes containing the word triple:

    And DANTE searched the triple spheres,
    Moulding nature at his will,
    So shaped, so colored, swift or still,
    And, sculptor-like, his large design
    Etched on Alp and Apennine.
    Ralph Waldo Emerson (1803–1882)