M6: startDrain at Level M #
The program builds the side list of v first (in place), so until its last step its state is
Level F's stage with v's side list already set: φ X = X with side v := side. Every stage after
the side list touches other nodes or other fields, so it commutes with φ, and the last step sets
side v := side anyway.
Level F's state with v's side list already set.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Steps #
Stage 1: the two new nodes #
Allocate the two drain targets at the source node's height.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 2: v1, v2 around v in every table holding v #
Level F after the insertions into the first j tables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The drain-start state after updating the first j enclosing tables.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Insert both drain targets around the source in one enclosing table.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Insert both drain targets into every table containing the source.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 3: the tables of v1, v2 #
drainEntries' test for entry e of v's table.
Equations
- OrderMaintenance.Impl.entOK t v e = (OrderMaintenance.Proof.Top.sH t v == 1 || (t.nodes.getX v).children.contains e || (t.nodes.getX e).first != OrderMaintenance.Model.NIL)
Instances For
q := entry e is a drain entry on side sd (locals v h e sd).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Decide whether a table entry belongs to the selected side of the drain.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What selS reads agrees with Level F's state t.
Instances For
The entries of v's table that go to the new node on side sd.
Equations
- OrderMaintenance.Impl.selP t v side sd e = (OrderMaintenance.Impl.entOK t v e && OrderMaintenance.Model.lookup side e == some sd)
Instances For
Filter a node's table entries by the requested drain side.
Equations
- OrderMaintenance.Impl.part t v side sd = List.filter (OrderMaintenance.Impl.selP t v side sd) (List.map (fun (x : ℕ × ℕ) => x.1) (t.nodes.getX v).table)
Instances For
Count one table entry when it belongs to the selected drain side.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Append a selected table entry with its evenly spaced target label.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The table of a new node w: the drain entries of side sd, evenly labelled.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Count selected entries, recording the exact counter value and preserved registers.
A new node w takes v's tables and its share of v's entries (side sd).
Equations
Instances For
Build the left and right target tables from their selected drain entries.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 4: the entries learn their new tables #
Record one newly built table in an entry's containing-table list.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Record the new table membership of every entry in one drain target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Register the containing-table memberships of both drain targets.
Equations
Instances For
Stages 5, 6: the children of v1, v2 #
Test whether a live child has the currently selected drain side.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Set an entry's live parent, using the chunk-parent array at height one.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Transfer one selected child, repair its live parent, and accumulate its weight.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The children on side sd, with their parent and weight updated for the new node u.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What chS produces (Level F's sd8 / sd10 step).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Setting a parent commutes with replacing the children of another node.
The child-selection loop, preserving its parent-update and register invariants.
Transfer and weigh the children assigned to each drain target.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 7: the parent of v takes v1, v2 in place of v #
Replace the source node by its two targets in the live parent's child list.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Level F after the parent's children (s11 of sdS).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Stage 8: v becomes a ghost #
Turn the source into a draining ghost and clear its live child list.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What v becomes.
Equations
- One or more equations did not get rendered due to their size.
Instances For
startDrain #
Detect a nonleaf cut that leaves no child on its left side.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Construct a drain's side assignment, targets, tables, links and ghost source.
Equations
- One or more equations did not get rendered due to their size.
Instances For
startDrain v at Level M (local v).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The cost bound of startDrain, in the lengths of the lists it walks.
Equations
- One or more equations did not get rendered due to their size.
Instances For
startDrain v with too few children or an empty cut above height one changes nothing.