Split moves and group removal #
Split moves #
The label of the element moved to the left sibling.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The label of the element moved to the right sibling.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Transfers one element from the source group count to the destination group count.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The state after moving the first element of p to its left sibling.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The state after moving the last element of p to its right sibling.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What a successful left move needs: p alive and non-empty, the left sibling lighter and
adjacent, and room for a pushed label.
- live : LiveG s p
Instances For
Conditions for moving right: a live nonempty source, adjacent lighter sibling and label room.
- live : LiveG s p
Instances For
groupSplitStep after a successful move into a sibling in the same chunk.
Finishes a group split by clearing its state and source pointer.
Equations
Instances For
Unlinks an emptied source group and returns its siblings to the quiet state.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Runs of adjacent groups #
Moving element e from the front of p's run to the end of the adjacent l's run.
Moving element e from the back of p's run to the front of the adjacent r's run.
The records after a move #
GInvE across a move #
The family members of a splitting group other than p are not in p's family.
Group removal #
Removing an emptied group keeps GInv. Its siblings become quiet groups of the right
size.
The drive loop #
The drive loop: groupBudget split steps of p, stopping when p is removed.
Closing a drive: the family of p satisfies G1 again, and nothing else was exempt.
The drive's invariant after j moves of p's split. a, b, c are the sizes of l,
p, r before the drive.
Instances For
Empty-source removal bounds follow from the drive's total size and balance invariant.
The drive ended by removing p.
- ef : EFrame s t
Instances For
The extra invariant X survives the steps of a drive.
- moveL (t : Model.Core) (A' : Abs) (gh : GGh) : INV t A' → A'.elist = L → GInvE t L gh δ p → MoveLOK t p → gSt t p = Model.St.splitting → X t → X (moveLState t p)
- moveR (t : Model.Core) (A' : Abs) (gh : GGh) : INV t A' → A'.elist = L → GInvE t L gh δ p → MoveROK t p → gSt t p = Model.St.splitting → X t → X (moveRState t p)
- rem (t : Model.Core) (A' : Abs) (gh : GGh) : INV t A' → A'.elist = L → GInvE t L gh δ p → LiveG t p → gSt t p = Model.St.splitting → gF t p = Model.NIL → gSz t (gLl t p) < t.P.G → gSz t (gRr t p) < t.P.G → gmin t.P ≤ gSz t (gLl t p) → gmin t.P ≤ gSz t (gRr t p) → gC t p = c → X t → Y (removeState t p)
Instances For
Overflow label bounds supply every guard for a left move into the lighter sibling.
Overflow label bounds supply every guard for a right move into the strictly lighter sibling.
Lemma G1 for one drive. Driving the family of p after at most one undriven insertion
into it ends with GInv (no undriven insertion): either p has made groupBudget moves and
the family
satisfies G1 again, or p was removed and its siblings are quiet groups of the right size.
The group phase of background #
Room for the labels of a split start (Lemma C3 provides it).
Equations
- One or more equations did not get rendered due to their size.
Instances For
What the extra invariant must survive in the group phase.
- split (s : Model.Core) (A : Abs) (gh : GGh) (g labL labR : ℕ) : INV s A → A.elist = L → (GInv s L gh fun (b : ℕ) => if b = g then 1 else 0) → LiveG s g → gSt s g = Model.St.quiet → gSz s g = s.P.G → EStateM.run (Model.labBefore g) s = EStateM.Result.ok labL s → EStateM.run (Model.labAfter g) s = EStateM.Result.ok labR s → X s → X (splitState s g labL labR)
Instances For
The group phase. After an insertion into group g, the optional split start and the
drive of g's family succeed and restore GInv with no undriven insertion.