def index_inside
bendtorch-core@0.1.0.0 · src/tensor/matmul_PROOF.bend:670
import bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend as MatmulPROOF
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/tensor/word_conversion.bend as Conversion
670def index_inside(+shape: Shape.Shape, +position: Nat,
671 +bound: {True{} == Nat.is_lt(position, Shape.elements(shape)) : Bool}) ->
672 {Nat.is_lt(U32.to_nat(U32.from_nat(position)), Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool}:
673 %Equal.sym(Nat, U32.to_nat(U32.from_nat(position)), position,
674 Conversion.natural_word_exact(position, Shape.count(shape),
675 %Equal.sym(Nat, U32.to_nat(Shape.count(shape)), Shape.elements(shape), Conversion.shape_count_exact(shape)) : {Nat.is_le(position, _) == True{} : Bool}
676 inside_le(position, Shape.elements(shape), Equal.sym(Bool, True{}, Nat.is_lt(position, Shape.elements(shape)), bound)))) :
677 {Nat.is_lt(_, Shape.logical_numel(Shape.dimensions(shape))) == True{} : Bool}
678 %Shape.elements_exact(shape) : {Nat.is_lt(position, _) == True{} : Bool}
679 Equal.sym(Bool, True{}, Nat.is_lt(position, Shape.elements(shape)), bound)