NLAlib.Ops.Routine.Meets.writes_ofRel
Library · theorem
A routine that meets the specification read off a block relation B and draws its window runs, at separated operands whose readable blocks are in the domain, as a call of an operation with the relation B: the position advances by the window and the written blocks satisfy the relation at the window of the tape. This is the form in which an operation contract with several admitted layouts of its operands is derived from one routine for each layout.
NLAlib.Ops.Routine.Meets.writes_ofRel {Op Tst K : Type} {R : Ops.Routine Op Tst}
{I : Ops.Interp Op Tst K} {B : Ops.BlockRel K} {ok : List ℕ → Prop}
(h : R.Meets I (Ops.Routine.Spec.ofRel B ok)) {d : List ℕ} {args : List (ℕ × ℕ)} {τ : Ops.Tape K}
{m : Ops.Mem K} {xs : List (List K)} (hnd : d.length = R.nd) (hlen : args.length = R.arity)
(hl : m.Live args) (hsep : R.SeparatedAt d args)
(hr : m.readBlocks (R.readArgs (R.operands d args)) (R.readLens d) = some xs) (hok : ok d)
(hdom : B.dom d xs (τ.window B.stream m.pos (B.win d)))
(hroom : m.Room (R.writeArgs (R.operands d args)) (R.writeLens d))
(hdraws : R.draws d = some (B.win d)) (hrep : R.allReported = true := by rfl)
(hcontig : R.contiguous = true := by rfl) :
Ops.Writes Ops.Mode.total I τ R.body (Ops.Env.frame d (R.env (R.operands d args)))
(Ops.Fp.blocks (R.writeArgs (R.operands d args)) (R.writeLens d))
(fun m' ↦
m'.pos = m.pos + B.win d ∧
∃ ys,
m'.readBlocks (R.writeArgs (R.operands d args)) (R.writeLens d) = some ys ∧
B.rel d xs (τ.window B.stream m.pos (B.win d)) ys)
mImport NLAlib.Ops.RoutineLink.