def facts_1

bendtorch-core@0.1.0.0 · src/tensor/axis_algebra.bend:2122

import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra
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/axis_spec.bend as Axis

2122def facts_1(+axes: List<&2, Nat>, accepted: {True{} == Axis.valid(1n, axes) : Bool}) -> Facts<1n, axes>:
2123  match axes:
2124    case Nil{}:
2125      Empty.absurd(Facts<1n, Nil{}>, Shape.clash(accepted))
2126    case 0n <> Nil{}:
2127      Certified{{==}, {==}, {==}, A => items => length => lists_0(A, items, length),
2128        dims => length => product_0(dims, length), dims => coords => dl => cl => fit_0(dims, coords, dl, cl)}
2129    case (1n+p) <> Nil{}:
2130      Empty.absurd(Facts<1n, (1n+p) <> Nil{}>, Arith.lt_zero(p, Arith.and_left(Nat.is_lt(1n+p, 1n), Axis.bounded(Nil{}, 1n), Arith.and_left(Axis.bounded((1n+p) <> Nil{}, 1n), Axis.unique((1n+p) <> Nil{}), Equal.sym(Bool, True{}, Axis.valid(1n, (1n+p) <> Nil{}), accepted)))))
2131    case +a0 <> +a1 <> +tail:
2132      Empty.absurd(Facts<1n, a0 <> a1 <> tail>, Shape.clash(accepted))

Uses (16)

Used by (1)