Hoare Tripple
A Hoare tripple is a statement
where
are tests on the state space and a program (= piece of code) acting on . We say the tripple is partially correct if, whenever
satisfies, and is applied to , the result (if it exists) satisfies . It is totally correct if any input satisfying does give a result when is applied ( terminates on ), and this result satisfies .
Recalling the factorial program , it appears that
is both partially and totally correct. Note taht neither
nor involves the varible ``i'', so its value is not relevant to the correctness.
We call the
in
the precondition and postcondition respectively.
Subsections
David Goodwin
2008-09-20