Documentation

LeanPool.OrderMaintenance.Proof.Correct.Init

Fresh cores and their deferred preparation #

NoErr m: m always succeeds. With Pres R m it gives the result and the relation. A fresh core (initState) satisfies INV-S with the single-element nesting; initCore and prepareStep only touch the top structure and tags afterwards.

Actions that always succeed #

A core computation succeeds from every initial state.

Equations
Instances For
    theorem OrderMaintenance.Proof.NoErr.bind {α β : Type} {m : Model.CM α} {f : α → Model.CM β} (hm : NoErr m) (hf : ∀ (a : α), NoErr (f a)) :
    NoErr (m >>= f)
    theorem OrderMaintenance.Proof.NoErr.ite {α : Type} {c : Prop} [Decidable c] {a b : Model.CM α} (ha : NoErr a) (hb : NoErr b) :
    NoErr (if c then a else b)
    theorem OrderMaintenance.Proof.NoErr.forIn_list {β γ : Type} (l : List γ) (b : β) {f : γ → β → Model.CM (ForInStep β)} (hf : ∀ (x : γ) (b : β), NoErr (f x b)) :
    NoErr (forIn l b f)
    theorem OrderMaintenance.Proof.NoErr.run {α : Type} {R : Model.Core → Model.Core → Prop} {m : Model.CM α} (hn : NoErr m) (hp : Pres R m) (s : Model.Core) :
    ∃ (a : α) (s' : Model.Core), EStateM.run m s = EStateM.Result.ok a s' ∧ R s s'

    Prove total success of a core computation by decomposing monadic primitives and loops.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      The fresh core #

      Abstract nesting of the initial sentinel-only core.

      Equations
      Instances For
        theorem OrderMaintenance.Proof.getX_two {α : Type} [Inhabited α] (a b : α) (i : ℕ) :
        #[a, b].getX i = if i = 0 then a else if i = 1 then b else default
        theorem OrderMaintenance.Proof.llist_one {nxt prv : ℕ → ℕ} (hn : nxt 1 = Model.NIL) (hp : prv 1 = Model.NIL) :
        LList nxt prv 1 [1]

        A fresh core satisfies INV-S with the sentinel alone.