def read_entry

bendtorch-core@0.1.0.0 · src/tensor/gather_PROOF.bend:296

import bendtorch-core@0.1.0.0/src/tensor/gather_PROOF.bend as GatherPROOF
import Base
import bendtorch-core@0.1.0.0/src/storage/model.bend as Model
import bendtorch-core@0.1.0.0/src/storage/refinement.bend as Refinement
import bendtorch-core@0.1.0.0/src/shape/plan_proofs.bend as Plans
import bendtorch-core@0.1.0.0/src/tensor/parallel_proofs.bend as Generic

296# The entry read is the one the index array holds there.
297def read_entry(+di: Nat, -I: Array<U32>, +e: Nat, +j: U32,
298  -read: {Model.observe(U32, di, I, Refinement.route(di, U32.from_nat(e))) == Some{j} : Maybe<&2, U32>},
299  -index_valid: Model.Balanced(U32, di, I)) ->
300  Generic.Fact<{Refinement.second(U32, Array.get(U32, I, U32.from_nat(e))) == j : U32}>:
301  Generic.Fact{Plans.some_injective(U32, Refinement.second(U32, Array.get(U32, I, U32.from_nat(e))), j,
302    Equal.trans(Maybe<&2, U32>, Some{Refinement.second(U32, Array.get(U32, I, U32.from_nat(e)))},
303      Model.observe(U32, di, I, Refinement.route(di, U32.from_nat(e))), Some{j},
304      Refinement.law_get_refines(U32, di, I, U32.from_nat(e), index_valid), read))}

Uses (14)

Used by (1)