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⟧.apply Q
of x : m α
for the postcondition Q
.
It is thus defined in terms of an instance WP m ps
.
def
Std.Do.Triple
{m : Type → Type u}
{ps : PostShape}
[WP m ps]
{α : Type}
(x : m α)
(P : Assertion ps)
(Q : PostCond α 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.