def source_decision
bendtorch-core@0.1.0.0 · src/tensor/reduction_PROOF.bend:591
import bendtorch-core@0.1.0.0/src/tensor/reduction_PROOF.bend as ReductionPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/lifecycle.bend as Lifecycle
import bendtorch-core@0.1.0.0/src/tensor/reduction.bend as Reduction
import bendtorch-core@0.1.0.0/src/tensor/reduction_LAWS.bend as Laws
591def source_decision(+fuel: Nat, -shape: Shape.Shape, tensor: Core.Tensor<shape>, +cursor: Nat, +accumulator: F32,
592 -rec: @tensor: Core.Tensor<shape> -> @+value: F32 -> Laws.SourceSum<fuel, shape, tensor, 1n+cursor, value,
593 Reduction.natural_sum_loop(fuel, shape, tensor, 1n+cursor, value)>,
594 decision: Shape.BoolCase<Nat.is_eq(U32.to_nat(U32.from_nat(cursor)), cursor)>) ->
595 Laws.SourceSum<1n+fuel, shape, tensor, cursor, accumulator, Reduction.sum_decided(shape,
596 tensor => value => Reduction.natural_sum_loop(fuel, shape, tensor, 1n+cursor, value), tensor, cursor, U32.from_nat(cursor), accumulator, decision)>:
597 match decision:
598 case Shape.BFalse{equal}:
599 Laws.SourceSum{unit => Unit{}}
600 case Shape.BTrue{equal}:
601 source_pair(fuel, shape, tensor, cursor, accumulator, rec,
602 Lifecycle.natural_equal(U32.to_nat(U32.from_nat(cursor)), cursor, equal),
603 Core.read_certificate(shape, tensor, U32.from_nat(cursor)), Core.source_read_model(shape, tensor, U32.from_nat(cursor)),
604 Core.source_read_keeps(shape, tensor, U32.from_nat(cursor)))