ReduceParallelProof.cell_keeps: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend as ReduceParallelProof Lines 659-677 of bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend&start_line=659&end_line=677 import Base import bendtorch-core@0.1.0.0/src/storage/model.bend as Model import bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend as Parallel import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/autograd/reduce.bend as Reduce # Every cell hands the contribution array back. def cell_keeps(+d: Nat, A: Array, +rows: List<&2, Shape.Row>, +extents: List<&2, Nat>, +position: Nat, inside: Bool, -valid: Model.Balanced(F32, d, A)) -> Parallel.Fact<{Pair.snd(F32, Array & Unit, cell_of(rows, extents, position, A, inside)) == (A, Unit{}) : Array & Unit}>: match inside: case False{}: Parallel.Fact{{==}} case True{}: Parallel.Fact{{\{FiberRun: words => seen => total => kept => %Equal.sym(F32 & (Array & Unit), Reduce.keep(Reduce.fiber_of(rows, extents, position, A), Unit{}), (Pair.fst(F32, Array, Reduce.fiber_of(rows, extents, position, A)), (Pair.snd(F32, Array, Reduce.fiber_of(rows, extents, position, A)), Unit{})), keep_equal(Reduce.fiber_of(rows, extents, position, A), Unit{})) : {Pair.snd(F32, Array & Unit, _) == (A, Unit{}) : Array & Unit} Equal.cong(Array, Array & Unit, a => (a, Unit{}), Pair.snd(F32, Array, Reduce.fiber_of(rows, extents, position, A)), A, kept)} : FiberRun -> {Pair.snd(F32, Array & Unit, cell_of(rows, extents, position, A, True{})) == (A, Unit{}) : Array & Unit}}( {\{Parallel.Fact: p => p} : Parallel.Fact> -> FiberRun}( run_of(d, A, rows, extents, position, valid)))} Uses (22): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat 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=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce.bend&name=fiber_of https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce.bend&name=keep https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend&name=FiberRun https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend&name=cell_of https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend&name=keep_equal https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend&name=run_of https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend&name=visited_of https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Row 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/tensor/elementwise_parallel_proof.bend&name=Fact