Hoare triples #
Hoare triples form the basis for compositional functional correctness proofs about monadic programs.
As usual, Triple x pre post epost holds iff the precondition pre entails the weakest
precondition wp x post epost of x : m α for the postcondition post and error
postcondition epost.
It is thus defined in terms of an instance WPMonad m Pred EPred.
A Hoare triple for reasoning about programs. A Hoare triple Triple x pre post epost
is a specification for x: if assertion pre holds before x, then postcondition post holds
after running x (and epost handles any errors).
- intro :: (
- le_wp : Lean.Order.PartialOrder.rel pre (wp x post epost)
The weakest precondition entailment witnessing the triple.
- )
Instances For
Hoare triple notation without exception postcondition (defaults to ⊥). An optional (m := …)
after the precondition ascribes the program to monad ….
Equations
- One or more equations did not get rendered due to their size.
Instances For
Hoare triple notation with a binder for the return value.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Hoare triple notation with an exception postcondition:
⦃ P ⦄ x ⦃ Q; E ⦄ := Triple x P Q E.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Hoare triple notation with a binder for the return value and an exception postcondition.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pretty-print Triple applications back as ⦃ … ⦄ notation.
Equations
- One or more equations did not get rendered due to their size.