NLAlib.Ops.writes_scalarBlock
Library · theorem
The block rule (total mode): a straight-line block of scalar instructions whose operations are functions of cells (ScalarCall, e.g. by IsScalar.scalarCall, at any tag or mixing tags) writes its output cells, and the memory after it is the memory before with the evaluated cells written. It needs room for the cells written and live input cells (the cells read hold words: that is the evaluation succeeding).
Only total mode: the catalog's scalar contracts are total, and a total contract says nothing of a call outside its precondition, so a liberal statement would need the room anyway. A block that contains catalog calls gets its liberal corollary by Writes.of_total, under the same hypotheses; one proof does not give both modes for free.
NLAlib.Ops.writes_scalarBlock {Op Tst K : Type} {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
{ρ : Ops.Env} {m : Ops.Mem K} {sem : Op → List K → Option K} {xs : List (Ops.ScalarIns Op)}
(hS : ∀ x ∈ xs, Ops.ScalarCall I x.op (sem x.op)) {ws : List ((ℕ × ℕ) × K)}
(hev : Ops.ScalarIns.evalBlock sem ρ xs m.store.cellFn = some ws)
(hroom : ∀ w ∈ ws, w.1.2 < m.store.len w.1.1) :
Ops.Writes Ops.Mode.total I τ (Ops.Stmt.scalarBlock xs) ρ (Ops.Fp.cells (List.map Prod.fst ws))
(fun m' ↦ m' = m.updCells ws) mImport NLAlib.Ops.Logic.Scalar.