def left_walk_bound
bendtorch-core@0.1.0.0 · src/tensor/elementwise_parallel_proof.bend:356
import bendtorch-core@0.1.0.0/src/tensor/elementwise_parallel_proof.bend as ElementwiseParallelProof
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/shape/flat.bend as Flat
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise
356def left_walk_bound(+plan: Shape.BroadcastPlan,
357 +map: Shape.Index<Shape.extents(Shape.left_shape(plan)), Shape.extents(Shape.right_shape(plan)), Shape.extents(Shape.output_shape(plan))>,
358 +value: Nat, +bound: {True{} == Nat.is_lt(value, Shape.elements(Shape.output_shape(plan))) : Bool}) ->
359 {True{} == Nat.is_lt(Elementwise.left_walk(Shape.extents(Shape.left_shape(plan)), Shape.extents(Shape.right_shape(plan)), Shape.extents(Shape.output_shape(plan)), map, value),
360 Shape.elements(Shape.left_shape(plan))) : Bool}:
361 match map:
362 case Shape.Indexed{rows, exact}:
363 Flat.left_bound(plan, rows, exact, value, bound)
364 case Shape.Unindexed{zero}:
365 Empty.absurd({True{} == Nat.is_lt(0n, Shape.elements(Shape.left_shape(plan))) : Bool}, Flat.hollow(Shape.output_shape(plan), value, zero, bound))