M6: compiled code stays in its slot #
The compiled code of slot p stores only to the arrays 1000·p + code with code < 1000
(Stm.compile_arrs). So it leaves the other slot and the wrapper's arrays alone, and the
encoding of a core in another slot survives it (Enc.of_other).
The compiled code of slot p stores only to slot p.
theorem
OrderMaintenance.Impl.inSlot_disj
{p q : ℕ}
(hpq : p ≠ q)
{b : Machine.Arr}
(hp : InSlot p b)
(hq : InSlot q b)
:
theorem
OrderMaintenance.Impl.compile_frame
(p : ℕ)
(κ : Caps)
(c : Stm)
(s : Machine.State)
{b : Machine.Arr}
(hb : ¬InSlot p b)
:
Machine.Same b s (Machine.exec (Stm.compile p κ c) s).st
Running slot p's compiled code leaves every array outside slot p unchanged.
theorem
OrderMaintenance.Impl.Enc.of_same
{q : ℕ}
{κ : Caps}
{n : Model.Core}
{m m' : Machine.State}
(h : Enc q κ n m)
(hs : ∀ (b : ℕ), InSlot q b → Machine.Same b m m')
:
Enc q κ n m'
The encoding of a core in another slot depends only on that slot's arrays.
theorem
OrderMaintenance.Impl.Enc.of_other
{p q : ℕ}
(hpq : p ≠ q)
{κ κ' : Caps}
{n : Model.Core}
{m : Machine.State}
(h : Enc q κ' n m)
(c : Stm)
:
Enc q κ' n (Machine.exec (Stm.compile p κ c) m).st
A core in another slot survives the compiled code of slot p.