NLA-lib Explorer

NLAlib.Ops.writes_call

Library · theorem

The call rule with a footprint, in every mode, for a contract in operand form with any number of output blocks: the call writes the output blocks and nothing else, the position advances by the window, and the outputs are read back (they are pairwise disjoint), related to the inputs read and to the window. Success needs live handles, readable inputs in the domain and room, under md.Needs; a successful liberal call gives the inputs read.

NLAlib.Ops.writes_call {Op Tst K : Type} {md : Ops.Mode} {I : Ops.Interp Op Tst K} {τ : Ops.Tape K}
  {ρ : Ops.Env} {m : Ops.Mem K} {o : Op} {R : Ops.BlockRel K}
  {adm : List ℕ → List (ℕ × ℕ) → List (ℕ × ℕ) → Prop} (hI : I.Satisfies md o (R.spec adm))
  {ds : List Ops.IExp} {ins outs : List Ops.Operand} {d : List ℕ} {a b : List (ℕ × ℕ)} {k : ℕ}
  {ls : List ℕ} (hd : Ops.IExp.evalList ρ.idx ds = some d)
  (ha : Ops.Operand.evalList ρ ins = some a) (hb : Ops.Operand.evalList ρ outs = some b)
  (hnd : d.length = R.nd) (hk : R.win d = k) (hls : R.outLens d = ls) (hadm : adm d a b)
  (hap : Ops.Fp.Apart b ls)
  (hpre :
    md.Needs
      (m.Live (a ++ b) ∧
        (∃ xs, m.readBlocks a (R.inLens d) = some xs ∧ R.dom d xs (τ.window R.stream m.pos k)) ∧
          m.Room b ls)) :
  Ops.Writes md I τ (Ops.Stmt.call o ds ins outs) ρ (Ops.Fp.blocks b ls)
    (fun m' ↦
      m'.pos = m.pos + k ∧
        ∃ xs ys,
          m.readBlocks a (R.inLens d) = some xs ∧
            m'.readBlocks b ls = some ys ∧ R.rel d xs (τ.window R.stream m.pos k) ys)
    m

Full source on GitHub

Import NLAlib.Ops.Logic.Writes.