NLA-lib Explorer

NLAlib.Ops.Interp.IsFn.satisfies_rel

Library · theorem

A functional operation satisfies a relational contract that its values satisfy. For witnesses and model primitives: the block function has the shape of the relation, and on blocks that were read its value has the declared lengths and is related to them.

NLAlib.Ops.Interp.IsFn.satisfies_rel {Op Tst K : Type} {I : Ops.Interp Op Tst K} {o : Op}
  {f : Ops.BlockFn K} {adm' : List ℕ → List (ℕ × ℕ) → List (ℕ × ℕ) → Prop}
  (h : I.IsFn Ops.Mode.total o f adm') {B : Ops.BlockRel K}
  {adm : List ℕ → List (ℕ × ℕ) → List (ℕ × ℕ) → Prop}
  (hadm : ∀ (d : List ℕ) (ins outs : List (ℕ × ℕ)), adm d ins outs → adm' d ins outs)
  (hnd : f.nd = B.nd) (hst : f.stream = B.stream) (hwin : ∀ (d : List ℕ), f.win d = B.win d)
  (hin : ∀ (d : List ℕ), f.inLens d = B.inLens d) (hout : ∀ (d : List ℕ), f.outLens d = B.outLens d)
  (hf :
    ∀ (d : List ℕ) (w : List K) (xs : List (List K)) (m : Ops.Mem K) (ins outs : List (ℕ × ℕ)),
      d.length = B.nd →
        w.length = B.win d →
          adm d ins outs →
            m.readBlocks ins (B.inLens d) = some xs →
              B.dom d xs w →
                ∃ ys,
                  f.fn d w xs = some ys ∧ List.map List.length ys = B.outLens d ∧ B.rel d xs w ys) :
  I.Satisfies Ops.Mode.total o (B.spec adm)

Full source on GitHub

Import NLAlib.Ops.Cert.