AxisAlgebra.bounded: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra Lines 121-129 of bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend&start_line=121&end_line=129 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis def bounded(+axes: List<&2, U32>, +rank: U32) -> {Layout.bounded(axes, rank) == Axis.bounded(Shape.naturals(axes), U32.to_nat(rank)) : Bool}: match axes: case Nil{}: {==} case +head <> +tail: %Arith.u32_lt(head, rank) : {Bool.and(_, Layout.bounded(tail, rank)) == Axis.bounded(Shape.naturals(head <> tail), U32.to_nat(rank)) : Bool} %Equal.sym(Bool, Layout.bounded(tail, rank), Axis.bounded(Shape.naturals(tail), U32.to_nat(rank)), bounded(tail, rank)) : {Bool.and(Nat.is_lt(U32.to_nat(head), U32.to_nat(rank)), _) == Axis.bounded(Shape.naturals(head <> tail), U32.to_nat(rank)) : Bool} {==} Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.and https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List 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=U32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32.to_nat https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=naturals https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/arith.bend&name=u32_lt https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend&name=bounded https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=bounded