M5: the top structure's invariant TopInv #
Shape(§4.5.1), for the state with the running job's path copy completed (finS);Timing: stored versus true weights (F1), and the drain timing of Lemma T3;Room: label room in every table (our replacement for Lemma T5's histories: a potential argument with a per-table count of insertion events);- the running job's position.
Constants (docs/PROOF.md §4.5.2), for h ≥ 1: W_h = 2aʰ, K_h = ⌊(W_h+2)/(s-2)⌋ + 1,
Π_h = W_h + 2 + 2K_h, τ_1 = a + 1, τ_h = aʰ + 1 + Π_{h-1}, λ_1 = a,
λ_h = aʰ + 1 - Π_{h-1}, γ_h = W_h + 1 - τ_h.
Constants #
Weight threshold for starting a drain at the given height.
Equations
- OrderMaintenance.Proof.Top.Wd P h = 2 * P.a ^ h
Instances For
Number of drain steps allowed by the height-dependent sweep budget.
Equations
- OrderMaintenance.Proof.Top.Kd P h = (OrderMaintenance.Proof.Top.Wd P h + 2) / (P.s - 2) + 1
Instances For
Potential allowance for insertions during a node drain.
Equations
Instances For
Upper weight threshold for a live node at the given height.
Equations
- OrderMaintenance.Proof.Top.taud P 0 = 0
- OrderMaintenance.Proof.Top.taud P 1 = P.a + 1
- OrderMaintenance.Proof.Top.taud P h.succ.succ = P.a ^ (h + 2) + 1 + OrderMaintenance.Proof.Top.Pid P (h + 1)
Instances For
Lower weight threshold for a released drain target.
Equations
- OrderMaintenance.Proof.Top.lamd P 0 = 0
- OrderMaintenance.Proof.Top.lamd P 1 = P.a
- OrderMaintenance.Proof.Top.lamd P h.succ.succ = P.a ^ (h + 2) + 1 - OrderMaintenance.Proof.Top.Pid P (h + 1)
Instances For
Weight slack freed by completing a drain at the given height.
Equations
Instances For
Entries of a fresh table of height h: children plus the ghosts between them
(T4's counting).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Insertion events a table of height h can see (from the potential of Room).
Equations
- One or more equations did not get rendered due to their size.
Instances For
Conditions on the parameters #
What the top structure's timing and label room need of the parameters (docs/PROOF.md
§4.5.3–4.5.5); topParams_proof checks them for the proof parameters.
A released target fits under the drain threshold (I6, in the form
λ_h ≥ 2 + 2K_h).Labels have room for every insertion event (our form of I7).
A drain's targets weigh less than a node about to drain at the height above (
Π_{h-1} ≤ W_h).Draining one level down frees room:
γ_h ≥ 1.Tables stay short: at most 160 entries (the machine's per-node list capacity).
Instances For
The copy phase #
The state after the remaining copy steps l, l+1, …, H.
Equations
- OrderMaintenance.Proof.Top.copyRest j H s l = if l ≤ H then OrderMaintenance.Proof.Top.copyRest j H (OrderMaintenance.Proof.Top.copyS s j l) (l + 1) else s
Instances For
The state with the path copy of the running job oj completed.
Equations
- OrderMaintenance.Proof.Top.finS s (some j) = match j.pc with | OrderMaintenance.Model.JobPc.copy l => OrderMaintenance.Proof.Top.copyRest j s.P.H s l | x => s
- OrderMaintenance.Proof.Top.finS s none = s
Instances For
The running job #
The nodes up from v along live parents.
Equations
Instances For
Where the job's weight increments resume.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Live nodes whose stored weight lags its true weight by 2, when job oj runs.
Equations
Instances For
The lowest height at which the running job has sweeps left (H + 1: none).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The sweeps the running job still owes ghost v.
Equations
- One or more equations did not get rendered due to their size.
- OrderMaintenance.Proof.Top.slack s none v = 0
Instances For
Weights and drain timing #
Funding jobs of ghost v so far.
Equations
- OrderMaintenance.Proof.Top.fundOf s cl v = (OrderMaintenance.Proof.Top.ew s cl v - (OrderMaintenance.Proof.Top.nd s v).weight) / 2
Instances For
Weight and progress inequalities ensuring scheduled drains finish in time.
(F1) stored weights.
- wA (v : ℕ) : liveN s v → (nd s v).livePar ≠ Model.NIL → srcOf s v = Model.NIL → (nd s v).weight ≤ Wd s.P (ht s v)
T3 (a).
- wB (v : ℕ) : ghostN s v → Wd s.P (ht s v) + 1 ≤ (nd s v).weight ∧ (nd s v).weight ≤ Wd s.P (ht s v) + 2
T3 (b): the frozen start weight of a drain.
Each funding job adds 2.
- wC (v : ℕ) : ghostN s v → (rng s cl v).length + (s.P.s - 2) * fundOf s cl v ≤ (nd s v).weight + slack s oj v
T3 (c).
Fresh targets are heavy (T0), and weights never decrease.
Targets are not chain nodes.
The chain nodes of the initial structure: node
u ≤ Hhas heightu.Every live node has a chunk below it.
Instances For
Label room #
Live entries of X present when X was created (e < X).
Equations
- OrderMaintenance.Proof.Top.oldLive s X = (List.filter (fun (e : ℕ) => decide (OrderMaintenance.Proof.Top.liveN s e) && decide (e < X)) (OrderMaintenance.Proof.Top.order s X)).length
Instances For
Label-gap potential sufficient for every insertion before a table is replaced.
Instances For
Table lengths. A table holds at most two entries per insertion event beyond its initial
ones, and so does its side list; and n0 + 2·dr ≤ 160 (so every table and side list, dead ones
included, has at most 160 entries: the machine's per-node list capacity).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The running job's position #
Where the running job is, in the state with its path copied.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The invariant #
The invariant of a top structure running job oj, whose path copy is complete.
- shape : Shape s cl ord
- time : Timing s cl oj
- room : Room s cl dr n0
Room for the chunks (the contract's capacity): nodes of height
H - 1never drain.- len : TabLen s dr n0
Instances For
The top structure's invariant (M5's TI).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The job measure #
Steps left for a walk that has heights h, h+1, …, H to visit.
Instances For
Steps left in job j.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The job measure (M5's μ).
Equations
- OrderMaintenance.Proof.Top.topMu s = match s.resJob with | some j => OrderMaintenance.Proof.Top.jobLeft (OrderMaintenance.Proof.Top.ts s) j | none => 0