Hoare triples #
Hoare triples form the basis for compositional functional correctness proofs about monadic programs.
As usual, Triple x P Q holds iff the precondition P entails the weakest precondition
wp⟦x⟧ Q of x : m α for the postcondition Q.
It is thus defined in terms of an instance WP m ps.
A Hoare triple for reasoning about monadic programs.
A proof for Triple x P Q is a specification for x:
If assertion P holds before x, then postcondition Q holds after running x.
⦃P⦄ x ⦃Q⦄ is convenient syntax for Triple x P Q.
Instances For
A Hoare triple for reasoning about monadic programs.
A proof for Triple x P Q is a specification for x:
If assertion P holds before x, then postcondition Q holds after running x.
⦃P⦄ x ⦃Q⦄ is convenient syntax for Triple x P Q.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Conjunction for two Hoare triple specifications of a program x.
This theorem is useful for decomposing proofs, because unrelated facts about x can be proven
separately and then combined with this theorem.
Modus ponens for two Hoare triple specifications of a program x.
This theorem is useful for separating proofs. If h₁ : Triple x P₁ Q₁ proves a basic property about
x and h₂ : Triple x P₂ (Q₁ →ₚ Q₂) is an advanced proof for Q₂ that builds on the basic proof
for Q₁, then mp x h₁ h₂ is a proof for Q₂ about x.