def expected_reads

bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise_proof.bend:43

import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise_proof.bend as PointwiseProof
import Base
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed
import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise.bend as Pointwise

43def expected_reads(~P: Data, ~map: P -> Nat -> Nat, +plan: P, +count: Nat, +n: Nat, +index: U32, +word: F32) ->
44  {StorageLaws.expected(Pointwise.reads(~P, ~map, plan, count), n, index, word) == word : F32}:
45  match count:
46    case 0n:
47      {==}
48    case 1n+previous:
49      Equal.trans(F32,
50        StorageLaws.expected(Pointwise.reads(~P, ~map, plan, 1n+previous), n, index, word),
51        StorageLaws.expected(Pointwise.reads(~P, ~map, plan, previous), n, index, word), word,
52        Replayed.expected_snoc(Pointwise.reads(~P, ~map, plan, previous), StorageLaws.Read{U32.from_nat(map(plan, previous))}, n, index, word),
53        expected_reads(~P, ~map, plan, previous, n, index, word))

Uses (9)

Used by (1)