WPMonad Instances #
The weakest precondition interpretation of the base monads and of the monad transformers.
A monad that throws carries the exception postcondition itself. A transformer stacks a product
layer on the exception postcondition of the monad below it, and EStack⟨⟩ closes the stack.
Pre-defined instances #
WPMonad Id Prop EStack⟨⟩— pure computations.WPMonad (StateT σ m) (σ → Pred) EPosts— stateful computations.WPMonad (ExceptT ε m) Pred ((ε → Pred) × EPosts)— computations with exceptions.WPMonad (OptionT m) Pred ((Unit → Pred) × EPosts)— computations with early termination.WPMonad (ReaderT ρ m) (ρ → Pred) EPosts— reader computations.WPMonad Option Prop (Unit → Prop)— concrete early termination.WPMonad (Except ε) Prop (ε → Prop)— concrete exception type.WPMonad (EStateM ε σ) (σ → Prop) (ε → σ → Prop)— concrete error-state monad.
@[instance_reducible]
instance Std.WP.ExceptT.wpInst {m : Type u → Type z} {EPosts : Type u_1} {ε α : Type u} {Pred : Type v} [Assertion Pred] [Assertion EPosts] [WP (m (Except ε α)) (Except ε α) Pred EPosts] :
ExceptT's WP interpretation: lift the base interpretation by adding an exception
postcondition layer.
Type Alias Instances #
WPMonad instances for concrete monads that are type aliases for transformer stacks.