Predicate transformers for arbitrary postcondition shapes #
This module defines the type PredTrans ps of predicate transformers for a given ps : PostShape.
PredTrans forms the semantic domain of the weakest precondition interpretation
WP in which we interpret monadic programs.
A predicate transformer x : PredTrans ps α is a function that takes a postcondition
Q : PostCond α ps and returns a precondition x.apply Q : Assertion ps, with the additional
monotonicity property that the precondition is stronger the stronger the postcondition is:
Q₁ ⊢ₚ Q₂ → x.apply Q₁ ⊢ₛ x.apply Q₂.
Since PredTrans itself forms a monad, we can interpret monadic programs by writing
a monad morphism into PredTrans; this is exactly what WP encodes.
This module defines interpretations of common monadic operations, such as get, throw,
liftM, etc.
Any predicate transformer that is conjunctive is also monotonic.
Equations
Instances For
The type of predicate transformers for a given ps : PostShape and return type α : Type.
A predicate transformer x : PredTrans ps α is a function that takes a postcondition
Q : PostCond α ps and returns a precondition x.apply Q : Assertion ps, with the additional
monotonicity property that the precondition is stronger the stronger the postcondition is:
Q₁ ⊢ₚ Q₂ → x.apply Q₁ ⊢ₛ x.apply Q₂.
- conjunctive : Conjunctive self.apply