Documentation

LeanPool.OrderMaintenance.Proof.Cost.TopIface

The top structure, as an interface #

M4 uses the top structure through a contract: an invariant TI that depends only on the top structure's fields and the chunk list (TopSame), whose insertion job starts when a chunk is popped, and whose every step succeeds and decreases a measure μ ≤ J. M5 proves the contract (Lemmas T0–T5).

What the top structure may depend on.

Instances For
    theorem OrderMaintenance.Proof.TopSame.trans {a b c : Model.Core} (h1 : TopSame a b) (h2 : TopSame b c) :
    theorem OrderMaintenance.Proof.topSame_ins {s s2 : Model.Core} {x lab hh : ℕ} (hC : s2.C = (sizeState (Model.linkElem s x s.E.size lab hh) (gC s (eG s x))).C) (hP : s2.P = s.P) (ht : s2.nodes = s.nodes ∧ s2.path = s.path ∧ s2.cin = s.cin ∧ s2.lpar = s.lpar ∧ s2.resJob = s.resJob ∧ s2.prep = s.prep ∧ s2.ready = s.ready ∧ s2.firstChunk = s.firstChunk) :
    TopSame s s2

    The insertion's element link and size update leave the top structure alone.

    structure OrderMaintenance.Proof.TopContract (TI : Model.Core → Prop) (μ : Model.Core → ℕ) (J : ℕ) (cap : Model.Params → ℕ) :

    The top structure's contract. TI is its invariant (it may require INV-S), μ measures the work left in the running job, and the job of a chunk split needs at most J steps. Both depend only on what TopSame keeps. The structure has room for chunks below cap P.

    Instances For
      structure OrderMaintenance.Proof.TopContractP (TI : Model.Core → Prop) (μ : Model.Core → ℕ) (J cap : Model.Params → ℕ) :

      The contract with a parameter-dependent job bound (what M5 proves): a chunk split's job needs at most J P steps, P the core's parameters.

      Instances For

        TI at parameters P.

        Equations
        Instances For
          theorem OrderMaintenance.Proof.TopContractP.at {TI : Model.Core → Prop} {μ : Model.Core → ℕ} {J cap : Model.Params → ℕ} (h : TopContractP TI μ J cap) (P : Model.Params) :
          TopContract (TIat TI P) μ (J P) cap

          At fixed parameters, the job bound is a constant.