Documentation

LeanPool.OrderMaintenance.Impl.TheoremsM

M6: Theorems A and B at Level M #

The machine program: initWS once (with K_B in local kb), then opS op for each operation. An operation's arguments are put in locals by opS; an order query leaves its answer in local r.

The bound on one operation's machine steps.

Equations
Instances For

    A machine state holding a wrapper state with the Level M invariant for Sp, and K_B.

    Equations
    Instances For
      theorem OrderMaintenance.Impl.reach_of {KB : ℕ} {om : Model.OrderMaintenance} {m : Machine.State} {Sp : Spec.State} (h : WEnc om m 0 ∨ WEnc om m 1) (hI : MInv om Sp) (hK : om.KB = KB) :
      Reach KB m Sp
      theorem OrderMaintenance.Impl.init_reach {m : Machine.State} {KB : ℕ} (hkb : m.loc "kb" = KB) (h4 : 4 ≤ KB) :

      Initialization.

      theorem OrderMaintenance.Impl.step_reach {KB : ℕ} {m : Machine.State} {Sp : Spec.State} (hR : Reach KB m Sp) {op : Spec.Op} (hv : Spec.Op.Valid Sp op) :
      Machine.wp (opS op) (fun (m' : Machine.State) (k : ℕ) => Reach KB m' (Spec.step Sp op).1 ∧ ansOf op m' = (Spec.step Sp op).2 ∧ k ≤ opB KB) m

      One operation: the specification's answer, the invariant again, at most opB K_B steps.

      The machine run over a sequence of operations: the answers and the cost of each operation (none if an operation fails or reaches an error).

      Equations
      Instances For
        theorem OrderMaintenance.Impl.run_reach {KB : ℕ} (ops : List Spec.Op) (Sp : Spec.State) (m : Machine.State) :
        Reach KB m Sp → Spec.Valid Sp ops → ∃ (cs : List ℕ), runM m ops = some (Spec.run Sp ops, cs) ∧ ∀ c ∈ cs, c ≤ opB KB
        theorem OrderMaintenance.Impl.theoremAB_M {m₀ : Machine.State} {KB : ℕ} (hkb : m₀.loc "kb" = KB) (h4 : 4 ≤ KB) (ops : List Spec.Op) (hv : Spec.Valid Spec.State.empty ops) :

        Theorems A and B at Level M. For K_B ≥ 4 (in local kb) and every valid operation sequence, the machine program returns exactly the specification's answers; initialization takes at most initB steps and each operation at most opB K_B steps.

        The constants #

        theorem OrderMaintenance.Impl.opB_four :
        opB 4 = 1133561742

        The constant of Theorem B for the proof parameters' K_B = 4.