M6: the rebuild loop as machine code #
loopC p runs Level F's rebuildLoop om nxt (K_B + 1) K_B, with cur in slot p and nxt in
slot 1 - p. It is a for loop of K_B + 1 iterations; the local bud holds the budget, and an
iteration with no budget left does nothing. The swap sets the budget to 0, so the iterations after
it do nothing either (the parity has changed, but they only read bud).
What each iteration needs from the run (the preconditions of the core calls) is collected along
Level F's run by RLSafe.
Rules that forget the intermediate state #
The code #
A preparation step of nxt; r = whether it is ready.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Copy the element at the cursor into nxt if it is live, and advance the cursor.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The end of the rebuild: the swap, and no budget left.
Equations
Instances For
Spend one unit of budget.
Equations
- One or more equations did not get rendered due to their size.
Instances For
One iteration of the rebuild loop.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The rebuild loop: K_B + 1 iterations with budget K_B.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What the iterations need #
What a copy step needs: the cursor is an element of cur, and if it is live, nxt is in
service with the anchor tail, and the handle is below the counter.
Equations
- One or more equations did not get rendered due to their size.
Instances For
What the iterations of Level F's run need, along the run.
Equations
- One or more equations did not get rendered due to their size.
- OrderMaintenance.Impl.RLSafe om n 0 x✝ = True
Instances For
A preparation step #
A copy step #
The insertion bound of a core of the proof parameters (it depends only on the Ks).
Equations
Instances For
The last part of a copy step: the cursor moves to the successor.
One iteration #
The loop's invariant, f iterations from the end of a run with result R: the machine holds
a state of the run (with its budget in bud), or the run has ended in the swap (no budget).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The loop #
The rebuild loop: the machine ends holding Level F's result, in one slot or the other.
Starting a rebuild #
A new nxt in slot 1 - p, with a zero handle map of room enough.
The trigger: count ≥ N/2, or N > minimumCapacity and live < N/8 (locals cnt, nC,
lv).
Equations
- One or more equations did not get rendered due to their size.
Instances For
live + mirrored of the next capacity.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The next capacity, 4 · max na 16.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The capacity of the new handle map: nextHandle + (N − count) + N'.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Start a rebuild if cur is half full or too few of its elements are live.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The locals a rebuild start may change.
Equations
Instances For
The state after a rebuild start.
Equations
- One or more equations did not get rendered due to their size.