MatmulParallelProof.build_cells: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend as MatmulParallelProof Lines 238-270 of bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend&start_line=238&end_line=270 import Base import bendtorch-core@0.1.0.0/src/storage/model.bend as Model import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise import bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend as Parallel import bendtorch-core@0.1.0.0/src/tensor/parallel_proofs.bend as Generic # Whatever the split, every cell of the parallel build holds what CellIs # names: the generic law of `Parallel.build`, with the matmul cell. def build_cells(+depth: Nat, +splits: Nat, +dl: Nat, +dr: Nat, -A: Array, -B: Array, +inner: Nat, +columns: Nat, +count: Nat, +base: Nat, la: Array, ra: Array, -el: {la == A : Array}, -er: {ra == B : Array}, -left_valid: Model.Balanced(F32, dl, A), -right_valid: Model.Balanced(F32, dr, B)) -> Parallel.Fact: -split = {\{Parallel.Fact: q => q} : Parallel.Fact<({Pair.fst(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array} & {Pair.snd(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array})> -> {Pair.fst(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array} & {Pair.snd(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array}}( Parallel.split_equal(dl, dr, A, B, left_valid, right_valid)) -cells = {\{Generic.Fact: q => q} : Generic.Fact, ~Array, ~Matrix.cell_at, Matrix.dims(Matrix.Dims{inner, columns}), (A, B), depth, count, base, Matrix.build(depth, splits, inner, columns, count, base, la, ra))> -> Generic.Cells(~Matrix.Dims, ~Array, ~Array, ~Matrix.cell_at, Matrix.dims(Matrix.Dims{inner, columns}), (A, B), depth, count, base, Matrix.build(depth, splits, inner, columns, count, base, la, ra))}( Generic.build_cells(~Matrix.Dims, ~Matrix.Dims, ~Array, ~Array, ~Matrix.dims, ~Elementwise.split, ~Matrix.cell_at, Matrix.Dims{inner, columns}, (A, B), depth, splits, count, base, (la, ra), Parallel.pair_equal(la, ra, A, B, el, er), at => inside => {\{Parallel.Fact: q => q} : Parallel.Fact<({Pair.snd(F32, Array & Array, cell_of(inner, columns, at, A, B, inside)) == (A, B) : Array & Array})> -> {Pair.snd(F32, Array & Array, cell_of(inner, columns, at, A, B, inside)) == (A, B) : Array & Array}}( cell_keeps(dl, dr, A, B, inner, columns, at, inside, left_valid, right_valid)), Pair.fst({Pair.fst(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array}, {Pair.snd(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array}, split), Pair.snd({Pair.fst(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array}, {Pair.snd(Array & Array, Array & Array, Elementwise.split((A, B))) == (A, B) : Array & Array}, split))) Parallel.Fact{path => {\{Parallel.Fact: q => q} : Parallel.Fact -> CellSpec(dl, dr, A, B, inner, columns, Nat.add(Model.offset(depth, path), base), Nat.is_lt(Nat.add(Model.offset(depth, path), base), count), Model.observe(F32, depth, Matrix.build(depth, splits, inner, columns, count, base, la, ra), path))}( cell_spec(dl, dr, A, B, inner, columns, Nat.add(Model.offset(depth, path), base), Nat.is_lt(Nat.add(Model.offset(depth, path), base), count), Model.observe(F32, depth, Matrix.build(depth, splits, inner, columns, count, base, la, ra), path), cells(path), left_valid, right_valid))} Uses (28): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_lt https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair.fst https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair.snd https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=Balanced https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=observe https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/model.bend&name=offset https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise.bend&name=split https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend&name=Fact https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend&name=pair_equal https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend&name=split_equal https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=Dims https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=build https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=cell_at https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=dims https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend&name=CellSpec https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend&name=Cells https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend&name=cell_keeps https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend&name=cell_of https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_parallel_proof.bend&name=cell_spec https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/parallel_proofs.bend&name=Cells https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/parallel_proofs.bend&name=Fact https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/parallel_proofs.bend&name=build_cells