Theorem W, option (A), stage A2: the peak of a drain start (startDrain) #
All locals at width K, except the weight sums t, b, ws at K + 9 (ΓD).
chS_pkok: the weight of a new node, the sumwsof at most 511 child weights, written once: its value is the end state's (Fin, the weight bound of the job step's end state).stage56_pkok: the two new nodesv1 ≠ v2(newNodes_ne, from the push semantics); the secondchSwrites the weight only atv2, so the first write is the last one atv1.stage7_pk: the insertion positionr + 1, withr ≤ lcap children(findCall_le).startDrain_pkok: the drain start, fromdrainCut_pk,drainSide_pk,roomCall_pk,tableInsertCall_pk,tab_pkand the above.
Nothing here is used by Theorems A and B.
Runs #
theorem
OrderMaintenance.Impl.evalF_push_inv
{κ : Caps}
{s s' : Model.Core}
{L L' : Loc}
{n : ℕ}
{t : Tbl}
{x : Machine.Reg}
(h : evalF κ (Stm.push t x) s L = Res.ok s' L' n)
:
The drain start #
theorem
OrderMaintenance.Impl.PKok.seqF
{K KH W : ℕ}
{κ : Caps}
{Γ Γ' : Machine.Reg → ℕ}
{Q : Model.Core → Prop}
{c d : Stm}
{s : Model.Core}
{L : Loc}
(hc : PKok K KH κ Γ' W c s L)
(hF : Fin Q (c;; d) s L)
(hd :
∀ (s1 : Model.Core) (L1 : Loc) (n1 : ℕ),
evalF κ c s L = Res.ok s1 L1 n1 → Gd K KH κ Γ' s1 L1 → Fin Q d s1 L1 → PKok K KH κ Γ W d s1 L1)
:
Sequencing a PKok first statement, passing the end-state bound on.
theorem
OrderMaintenance.Impl.chS_pkok
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(hcap : κ.lcap LK.children < 512)
(hG : Gd K KH κ (ΓD K) s L)
(hF : Fin (FBat K KH κ (Fld.n NF.weight) (L "u")) chS s L)
:
The children of a new node and its weight (chS at u): the weight sum of at most 511
children, written once, bounded by the end state.
theorem
OrderMaintenance.Impl.stage56_pkok
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(hcap : κ.lcap LK.children < 512)
(hG : Gd K KH κ (ΓD K) s L)
(hne : L "v1" ≠ L "v2")
(hF : Fin (FB K KH κ (Fld.n NF.weight)) stage56S s L)
:
The children of the two new nodes (stage56S), the new nodes v1 ≠ v2.
theorem
OrderMaintenance.Impl.sdMain_pkok
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(hcap : κ.lcap LK.children < 512)
(hcapT : κ.lcap LK.table < 512)
(hG : Gd K KH κ (ΓD K) s L)
(hF : Fin (FB K KH κ (Fld.n NF.weight)) sdMain s L)
:
The main part of a drain start (sdMain).
theorem
OrderMaintenance.Impl.startDrain_pkok
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(hcap : κ.lcap LK.children < 512)
(hcapT : κ.lcap LK.table < 512)
(hG : Gd K KH κ (ΓD K) s L)
(hF : Fin (FB K KH κ (Fld.n NF.weight)) startDrainS s L)
:
PKok K KH κ (ΓD K) W startDrainS s L
A drain start (startDrainS), the new nodes' weights bounded by the end state.