Documentation

VCVio.ProgramLogic.Unary.Examples

Examples of ordered monads in program verification #

We define the following ordered monads:

def instPreorderId {r : Type u_1} [h : Preorder r] :
Equations
Instances For
    def MonoCont (r : Type v) [Preorder r] :
    Type u → Type (max u v)
    Equations
    Instances For

      Everything is rfl for this instance since the attached property is a Prop.

      instance MonoCont.instPreorder {r : Type u_1} {α : Type u_2} [h : Preorder r] :
      Equations
      def MonoContProp :
      Type u → Type u
      Equations
      Instances For
        @[simp]
        theorem MonoContProp_def :
        MonoContProp = fun (α : Type u_1) => { m : Cont Prop α // ∀ (p p' : αid Prop), (∀ (a : α), p ap' a)m pm p' }
        def MonoStateContProp (σ : Type u) :
        Type u_1 → Type (max u_1 u)

        The quotient of the state monad, where the preorder on σ → Prop is given pointwise, induced by the preorder (p ≤ q) ↔ (p → q) on Prop.

        Equations
        Instances For

          Dijkstra monad for free via monad transformers #

          def effectObserve (m : Type u → Type v) (α : Type u) :
          Equations
          Instances For

            Hoare triple will have the form {P} prog {Q}, where P Q : m α → Prop and prog : m α, defined as P prog → effectObserve prog Q.