The chunk count (docs/PROOF.md §4.4) #
Every pop takes a quiet chunk above θ out of the quiet set. It became quiet at a size e c ≤ c_max, so at least θ + 1 − c_max insertions went into it since. Hence the pops, and with them
the chunks (|C| = 2 + 2·pops), are bounded by the element count over θ + 1 − c_max.
The quiet chunks.
Equations
Instances For
The chunk-count invariant, with ghost sizes e at which quiet chunks became quiet.
Instances For
theorem
OrderMaintenance.Proof.CountInv.remove
{s : Model.Core}
{e : ℕ → ℕ}
{pops x : ℕ}
(h : CountInv s e pops)
(hx : x < s.C.size)
(hl : cLl s x < s.C.size)
(hr : cRr s x < s.C.size)
(hlx : cLl s x ≠ x)
(hrx : cRr s x ≠ x)
(hls : cSt s (cLl s x) = Model.St.overflow)
(hrs : cSt s (cRr s x) = Model.St.overflow)
(hszl : cSz s (cLl s x) ≤ cmax s.P)
(hszr : cSz s (cRr s x) ≤ cmax s.P)
:
A chunk removal: the siblings become quiet, with their sizes (at most c_max) as e.
theorem
OrderMaintenance.Proof.CountInv.pop
{s s' : Model.Core}
{e : ℕ → ℕ}
{pops x : ℕ}
(h : CountInv s e pops)
(R : ResSpec s s' x)
(hxL : LiveC s x)
(hxq : cSt s x = Model.St.quiet)
(hθ : s.P.theta < cSz s x)
(hcnt : s'.count = s.count)
:
A pop: the popped chunk (above θ) leaves the quiet set, and two chunks are added.