Theorem W, option (A), stage A2: the peak of the construction of a core #
initState_pk: the centre labels2^(B − 1).initStep_pk: one stage of the chain above the first chunk: the table label2^(β − 1), the next heighth + 1 ≤ H + 1, and the tagtg + 2^(β−1)·2^((h−1)β) < 2^(hβ) ≤ 2^K, given the stage invarianttg < 2^((h−1)β)(as ininitStepP_mid).initLoop_pk,initCore_pk,prepP_pk: the loop of stages, the construction, and one preparation step.
Nothing here is used by Theorems A and B.
theorem
OrderMaintenance.Impl.PK.prepSetV
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
{Γ : Machine.Reg → ℕ}
{h b t : Exp}
{vh vb vt : ℕ}
(hG : Gd K KH κ Γ s L)
(hv : evList κ s L [h, b, t] = some [vh, vb, vt])
(hpk : pkList κ s L [h, b, t] < 2 ^ W)
(h1 : vh < 2 ^ K)
(h2 : vb < 2 ^ K)
(h3 : vt < 2 ^ K)
:
PK K KH κ Γ W (Stm.prepSet h b t) s L
prepSet with known values below 2^K.
theorem
OrderMaintenance.Impl.initStep_pk
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(hG : Gd K KH κ (ΓK K) s L)
(htag : ∀ (pr : Model.Prep), s.prep = some pr → pr.h ≤ s.P.H → pr.tag < 2 ^ ((pr.h - 1) * s.P.beta) ∧ 1 ≤ pr.h)
(hb1 : 1 ≤ s.P.beta)
:
One stage of the chain (initStep), given the stage invariant on the tag.
theorem
OrderMaintenance.Impl.PK.wr_centre
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
{Γ : Machine.Reg → ℕ}
{f : Fld}
{i : Exp}
{k : PF}
(hG : Gd K KH κ Γ s L)
(hi : Exp.OK Γ K KH W i)
(hk1 : 1 ≤ PF.get s.P k)
(hkK : PF.get s.P k ≤ K)
(hf : Fld.wd K KH f = K)
:
A write of the centre label 2^(B − 1) (B a parameter, 1 ≤ B ≤ K).
theorem
OrderMaintenance.Impl.initLoop_pk
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(I : ℕ → Model.Core → Prop)
(h0 : I 0 s)
(hstep :
∀ (j : ℕ) (t : Model.Core),
I j t →
j < s.P.H + 1 →
∃ (b : Bool) (t' : Model.Core) (L' : Loc) (n : ℕ),
(evalF κ initStepP.body t fun (x : Machine.Reg) => 0) = Res.ok t' L' n ∧ L' "done" = b2n b ∧ (b = false → I (j + 1) t') ∧ ((Gd K KH κ (ΓK K) t fun (x : Machine.Reg) => 0) →
PKok K KH κ (ΓK K) W initStepP.body t fun (x : Machine.Reg) => 0))
(hG : Gd K KH κ (ΓK K) s L)
:
The loop of stages, along a Level F invariant I (as in initLoopS_agree).
theorem
OrderMaintenance.Impl.initCore_pk
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(hG : Gd K KH κ (ΓK K) s L)
(hloop : ∀ (s1 : Model.Core) (L1 : Loc), Gd K KH κ (ΓK K) s1 L1 → PKok K KH κ (ΓK K) W initLoopS s1 L1)
:
The construction of a core (initCore), lazy (lz = 1) or eager (lz = 0, with the
loop of stages).
theorem
OrderMaintenance.Impl.prepP_pk
{K KH W : ℕ}
{κ : Caps}
{s : Model.Core}
{L : Loc}
(hC : CapsW K κ)
(hK : 8 ≤ K)
(hW : 2 * K + 4 ≤ W)
(hG : Gd K KH κ (ΓK K) s L)
(hstep :
(Gd K KH κ (ΓK K) s fun (x : Machine.Reg) => 0) → PKok K KH κ (ΓK K) W initStepP.body s fun (x : Machine.Reg) => 0)
:
A preparation step (prepareStep): one stage when the core is not ready.