M6: initialization as machine code #
initWS: the first core (capacity minimumCapacity = 64), built eagerly in slot 0, the
wrapper's scalars,
and the handle map of slot 0. It reaches Level F's OrderMaintenance.init in a constant number
of steps.
The eager construction keeps the empty rows #
theorem
OrderMaintenance.Impl.loop_runZ
{P : Model.Params}
(hPP : Proof.Top.topPP P)
(l : List ℕ)
(h : ℕ)
(s : Model.Core)
:
Proof.Top.Stage P h s →
PZ1 s →
1 ≤ h →
h ≤ P.H + 1 →
P.H + 2 - h ≤ l.length →
∃ (s' : Model.Core),
EStateM.run
(forIn l PUnit.unit fun (x : ℕ) (x_1 : PUnit.{1}) => do
let b ← Model.initStep
if b = true then pure (ForInStep.done PUnit.unit) else pure (ForInStep.yield PUnit.unit))
s = EStateM.Result.ok () s' ∧ Proof.Top.Final P s' ∧ PZ1 s'
theorem
OrderMaintenance.Impl.eager_M
{s s' : Model.Core}
(hPP : Proof.Top.topPP s.P)
(hN : 1 ≤ s.P.N)
(h : EStateM.run (Model.initCore false) s = EStateM.Result.ok () s')
:
An eagerly built core satisfies the capacity predicate.
An eagerly built core #
Compute parameters, allocate slot q, and initialize its core with lazy mode disabled.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
OrderMaintenance.Impl.eagerCore_ok
(q : ℕ)
{m : Machine.State}
{N : ℕ}
(hN : m.loc "nN" = N)
(hpos : 0 < N)
{n : Model.Core}
(hn : EStateM.run (Model.initCore false) { P := Proof.proofParams N } = EStateM.Result.ok () n)
:
Machine.wp (eagerCoreS q)
(fun (m' : Machine.State) (k : ℕ) =>
Enc q (capsOf (Proof.proofParams N)) n m' ∧ (∀ (b : ℕ), ¬InSlot q b → Machine.Same b m m') ∧ (∀ x ∉ pLocs, m'.loc x = m.loc x) ∧ k ≤ 4000 + ((Proof.proofParams N).H + 1) * 412)
m
An eagerly built core: slot q holds Level F's initCore false of the proof parameters.
Initialization #
The wrapper's arrays: the eight scalars, and the handle map of slot 0.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Initialization, with K_B in local kb.
Equations
- One or more equations did not get rendered due to their size.
Instances For
theorem
OrderMaintenance.Impl.initW_ok
{m : Machine.State}
{KB : ℕ}
(hkb : m.loc "kb" = KB)
(h4 : 4 ≤ KB)
:
∃ (om : Model.OrderMaintenance),
Model.OrderMaintenance.init Proof.proofParams KB = Except.ok om ∧ MInv om Spec.State.empty ∧ Machine.wp initWS (fun (m' : Machine.State) (k : ℕ) => WEnc om m' 0 ∧ k ≤ initB) m
Initialization at Level M: Level F's initial state, with the invariant, in slot 0, within
initB steps.