The reservation, one iteration at a time #
The lower invariants (LowInv: INV-S, Lemmas G and C1–C3, the queue, the chunk count) survive the
top structure's steps, which change only top-structure fields and chunk tags.
The fields below the top structure, but for chunk tags and the queue.
Instances For
theorem
OrderMaintenance.Proof.LowSame.topRel
{s s' : Model.Core}
(h : LowSame s s')
(hpq :
s'.pqHead = s.pqHead ∧ s'.pqNext = s.pqNext ∧ s'.pqPrev = s.pqPrev ∧ s'.pqWhere = s.pqWhere ∧ s'.nbNext = s.nbNext ∧ s'.nbPrev = s.nbPrev ∧ s'.pqHi = s.pqHi ∧ s'.pqLo = s.pqLo)
(hr :
s'.tail = s.tail ∧ s'.firstGroup = s.firstGroup ∧ s'.firstChunk = s.firstChunk ∧ s'.freeG = s.freeG ∧ s'.fallbacks = s.fallbacks ∧ s'.ready = s.ready)
:
TopRel s s'
theorem
OrderMaintenance.Proof.LowInv.transfer
{s s' : Model.Core}
{L : List ℕ}
(h : LowInv s L)
(hS : LowSame s s')
(hI : ∃ (A : Abs), INV s' A ∧ A.elist = L)
(hpq : PQC s')
:
LowInv s' L
The lower invariants across a step below the top structure that changes only tags and the queue, given the queue invariant after it.
theorem
OrderMaintenance.Proof.gval_zero_of_empty
{s : Model.Core}
(h : PQC s)
(h0 : s.pqHi = 0)
(c : ℕ)
:
With an empty queue, every game value is 0.
theorem
OrderMaintenance.Proof.PQOnly.sameLinks
{s s' : Model.Core}
(h : PQOnly s s')
:
SameLinks s s'
theorem
OrderMaintenance.Proof.split_rest
{s s2 : Model.Core}
{x : ℕ}
{job : Model.Job}
(hT : TopRel (Model.linkChunkPair (push2 s) x s.C.size (s.C.size + 1)) s2)
:
The fields a chunk split start keeps.
theorem
OrderMaintenance.Proof.lowinv_pop
{t s2 : Model.Core}
{L : List ℕ}
{c : ℕ}
{job : Model.Job}
(h : LowInv t L)
(hGP : GParams t.P)
(hc : inQC t c = true)
(hT5 : cSz t c ≤ t.P.T)
(hs2 : TopRel (Model.linkChunkPair (push2 (delSt t c)) c (delSt t c).C.size ((delSt t c).C.size + 1)) s2)
(hrun :
EStateM.run (Model.splitChunkStart c) (delSt t c) = EStateM.Result.ok () (markState s2 c (delSt t c).C.size ((delSt t c).C.size + 1) job))
:
The lower invariants after a pop and the split start.