NLA-lib Explorer

NLAlib.Ops.Impl.Satisfies.writes_blocks

Library · theorem

Use a proved implementation exactly like a relational primitive call: its declared outputs are read back, with the relation on the supplied input blocks and the frame on other cells. No client needs to unfold the contract's update equation or reconstruct writes by hand.

NLAlib.Ops.Impl.Satisfies.writes_blocks {Op Tst K : Type} {E : Ops.Impl Op Tst}
  {I : Ops.Interp Op Tst K} {md : Ops.Mode} {B : Ops.BlockRel K}
  {adm : List ℕ → List (ℕ × ℕ) → List (ℕ × ℕ) → Prop} (h : E.Satisfies I md (B.spec adm))
  {d : List ℕ} {ins outs : List (ℕ × ℕ)} {τ : Ops.Tape K} {m : Ops.Mem K} {xs : List (List K)}
  (hnd : d.length = B.nd) (hadm : adm d ins outs) (hlive : m.Live (ins ++ outs))
  (hr : m.readBlocks ins (B.inLens d) = some xs)
  (hdom : B.dom d xs (τ.window B.stream m.pos (B.win d))) (hroom : m.Room outs (B.outLens d))
  (hap : Ops.Fp.Apart outs (B.outLens d)) :
  Ops.Writes md I τ E.body (Ops.Env.frame d (ins ++ outs)) (Ops.Fp.blocks outs (B.outLens d))
    (fun m' ↦
      m'.pos = m.pos + B.win d ∧
        ∃ ys,
          m'.readBlocks outs (B.outLens d) = some ys ∧
            B.rel d xs (τ.window B.stream m.pos (B.win d)) ys)
    m

Full source on GitHub

Import NLAlib.Ops.Logic.Writes.