Documentation

LeanPool.OrderMaintenance.Proof.Cost.CSteps

Chunk-split steps, field by field #

What a chunk-split move (moveUnit with moveSizes) and chunk removal do, under the conditions that make their guards pass.

Running a chunk-split move #

Transfers the total size of the moved groups from the source chunk to the destination.

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

    The state after moving unit u from the front of x to the end of its left sibling.

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

      The state after moving unit u from the back of x to the front of its right sibling.

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

        The labels pushed at the end of the left sibling.

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

          The labels pushed at the front of the right sibling.

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

            Chunk removal #

            Marks an emptied chunk as dead while retaining its other fields.

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

              Finishes a chunk split by clearing its state and source pointer.

              Equations
              Instances For

                The state after removing the emptied chunk x: it is dead, its siblings are quiet.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem OrderMaintenance.Proof.removeChunk_ok {s : Model.Core} {x : ℕ} (hlr : cLl s x ≠ cRr s x) (hlx : cLl s x ≠ x) (hrx : cRr s x ≠ x) (hx : x < s.C.size) (hl : cSt s (cLl s x) = Model.St.overflow ∧ cSrc s (cLl s x) = x) (hr : cSt s (cRr s x) = Model.St.overflow ∧ cSrc s (cRr s x) = x) (hszl : cSz s (cLl s x) ≤ s.P.theta) (hszr : cSz s (cRr s x) ≤ s.P.theta) :
                  theorem OrderMaintenance.Proof.chunkSplitStep_remove {s : Model.Core} {x : ℕ} (he : cF s x = Model.NIL) (hlr : cLl s x ≠ cRr s x) (hlx : cLl s x ≠ x) (hrx : cRr s x ≠ x) (hx : x < s.C.size) (hl : cSt s (cLl s x) = Model.St.overflow ∧ cSrc s (cLl s x) = x) (hr : cSt s (cRr s x) = Model.St.overflow ∧ cSrc s (cRr s x) = x) (hszl : cSz s (cLl s x) ≤ s.P.theta) (hszr : cSz s (cRr s x) ≤ s.P.theta) :

                  The unit at an end of a chunk #

                  theorem OrderMaintenance.Proof.succOf_ne_head {h : ℕ} {t : List ℕ} (hnd : (h :: t).Nodup) (h0 : h ≠ Model.NIL) (a : ℕ) :
                  succOf (h :: t) a ≠ h
                  theorem OrderMaintenance.Proof.INV.not_before_first {s : Model.Core} {A : Abs} (hI : INV s A) {x a : ℕ} (hne : cF s x ≠ Model.NIL) (ha : a ∈ A.glist) (hac : gC s a = x) :
                  gN s a ≠ cF s x

                  No group of chunk x precedes its first group.

                  theorem OrderMaintenance.Proof.INV.not_after_last {s : Model.Core} {A : Abs} (hI : INV s A) {x : ℕ} (hne : cF s x ≠ Model.NIL) {a : ℕ} (hlast : gN s (cLs s x) = a) (ha0 : a ≠ Model.NIL) :
                  gC s a ≠ x

                  No group of chunk x follows its last group.

                  theorem OrderMaintenance.Proof.left_unit {s : Model.Core} {A : Abs} {gh : GGh} {δ : ℕ → ℕ} (hI : INV s A) (hG : GInv s A.elist gh δ) {x : ℕ} (hne : cF s x ≠ Model.NIL) :

                  The left unit of a non-empty chunk is its first group, quiet, or the whole family of which that group is the left sibling.

                  theorem OrderMaintenance.Proof.right_unit {s : Model.Core} {A : Abs} {gh : GGh} {δ : ℕ → ℕ} (hI : INV s A) (hG : GInv s A.elist gh δ) {x : ℕ} (hne : cF s x ≠ Model.NIL) :

                  The right unit of a non-empty chunk is its last group, quiet, or the whole family of which that group is the right sibling.

                  The records after a chunk-split move #

                  structure OrderMaintenance.Proof.CMoveSpec (s s' : Model.Core) (x dst : ℕ) (u labs : List ℕ) :

                  What a chunk-split move of unit u from x to dst does.

                  Instances For
                    theorem OrderMaintenance.Proof.cmoveSizes_C {t : Model.Core} {x dst : ℕ} {u : List ℕ} (hxd : x ≠ dst) (hx : x < t.C.size) (hd : dst < t.C.size) (c : ℕ) :
                    (cmoveSizes t x dst u).C.getX c = if c = x then have __src := t.C.getX c; { next := __src.next, prev := __src.prev, first := __src.first, last := __src.last, size := (t.C.getX c).size - (List.map (fun (g : ℕ) => gSz t g) u).sum, st := __src.st, src := __src.src, l := __src.l, r := __src.r, tag := __src.tag, alive := __src.alive } else if c = dst then have __src := t.C.getX c; { next := __src.next, prev := __src.prev, first := __src.first, last := __src.last, size := (t.C.getX c).size + (List.map (fun (g : ℕ) => gSz t g) u).sum, st := __src.st, src := __src.src, l := __src.l, r := __src.r, tag := __src.tag, alive := __src.alive } else t.C.getX c
                    theorem OrderMaintenance.Proof.cmoveL_spec {s : Model.Core} {x : ℕ} {u labs : List ℕ} (hxy : x ≠ cLl s x) (hx : x < s.C.size) (hy : cLl s x < s.C.size) (hnd : u.Nodup) (hlen : labs.length = u.length) (hsz : ∀ g ∈ u, g < s.Gs.size) :
                    CMoveSpec s (cmoveLState s x u labs) x (cLl s x) u labs
                    theorem OrderMaintenance.Proof.cmoveR_spec {s : Model.Core} {x : ℕ} {u labs : List ℕ} (hxz : x ≠ cRr s x) (hx : x < s.C.size) (hz : cRr s x < s.C.size) (hnd : u.Nodup) (hlen : labs.length = u.length) (hsz : ∀ g ∈ u, g < s.Gs.size) :
                    CMoveSpec s (cmoveRState s x u labs) x (cRr s x) u labs