NLA-lib Explorer

NLAlib.Ops.writes_indexLit

Library · theorem

A dimension literal writes its machine word in one cell and preserves the tape position. Only writable capacity is required; the cell need not be initialized.

NLAlib.Ops.writes_indexLit {K Op Tst : Type} {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
  {ρ : Ops.Env} {m : Ops.Mem K} [Ops.Has Ops.IndexOp Op] {M : Ops.Machine K}
  (hI : Ops.IsIndexLit M I) {e : Ops.IExp} {out : Ops.Operand} {n : ℕ} {z : ℕ × ℕ}
  (he : Ops.IExp.eval ρ.idx e = some n) (ho : Ops.Operand.eval ρ out = some z)
  (hz : z.2 < m.store.len z.1) :
  Ops.Writes Ops.Mode.total I τ (Ops.Stmt.call (Ops.Has.inj Ops.IndexOp.lit) [e] [] [out]) ρ
    (Ops.Store.inBlock z.1 z.2 1) (fun m' ↦ m'.pos = m.pos ∧ m'.store.get z.1 z.2 = some (M.lit ↑n))
    m

Full source on GitHub

Import NLAlib.Ops.Logic.IndexLiteral.