M5: a chunk split keeps the invariant (the contract's start) #
insertAround x y z on the linked core succeeds, writes tags that pass their guards, and the top
structure with the job's path copy completed satisfies the invariant, with the job at its start.
Room for an insertion event #
Between jobs #
The split's tables have room #
theorem
OrderMaintenance.Proof.Top.start_room
{s : TS}
{cl : List ℕ}
{ord : ℕ → List ℕ}
{dr n0 : ℕ → ℕ}
(hI : InvJ s cl ord dr n0 none)
(hTP : TopParams s.P)
{x T : ℕ}
(hx : x ∈ cl)
(hT : T ∈ cinT s x)
(y z : ℕ)
:
∃ (A : List (ℕ × ℕ)) (le : ℕ) (Bs : List (ℕ × ℕ)),
(nd s T).table = A ++ (x, le) :: Bs ∧ x ∉ List.map (fun (x : ℕ × ℕ) => x.1) A ∧ ((nd s T).draining = true → (Model.lookup (nd s T).side x).isSome = true) ∧ roomLo A le true < roomHi s.P.beta Bs le true ∧ roomLo A le false < roomHi s.P.beta Bs le false ∧ 2 ≤ gapB s.P.beta (n0 T) (dr T) ∧ GapsGe s.P.beta (gapB s.P.beta (n0 T) (dr T) / 2)
(List.map (fun (x : ℕ × ℕ) => x.2)
(A ++ (y, (roomLo A le true + roomHi s.P.beta Bs le true - 1) / 2) :: (x, le) :: (z, (roomLo A le false + roomHi s.P.beta Bs le false - 1) / 2) :: Bs))
The tables of the split chunk have room on both sides of it.
Views of the state after the split #
theorem
OrderMaintenance.Proof.Top.InsFrame.overflowOf
{s : Model.Core}
{x f1x i1 : ℕ}
{t : TS}
(F : InsFrame s x f1x i1 t)
(u : ℕ)
:
theorem
OrderMaintenance.Proof.Top.InsFrame.table
{s : Model.Core}
{x f1x i1 : ℕ}
{t : TS}
(F : InsFrame s x f1x i1 t)
(u : ℕ)
:
theorem
OrderMaintenance.Proof.Top.InsFrame.ghostN
{s : Model.Core}
{x f1x i1 : ℕ}
{t : TS}
(F : InsFrame s x f1x i1 t)
(u : ℕ)
: