def fit_10

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

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/tensor/axis_spec.bend as Axis

433def fit_10(+dims: List<&2, Nat>, +coords: List<&2, Nat>, dl: {List.length(&2, Nat, dims) == 2n : Nat}, cl: {List.length(&2, Nat, coords) == 2n : Nat}) -> {Shape.fit(Axis.order(Nat, dims, [1n, 0n]), Axis.order(Nat, coords, [1n, 0n])) == Shape.fit(dims, coords) : Bool}:
434  match dims:
435    case Nil{}:
436      Empty.absurd({Shape.fit(Axis.order(Nat, Nil{}, [1n, 0n]), Axis.order(Nat, coords, [1n, 0n])) == Shape.fit(Nil{}, coords) : Bool}, nat_clash(0n, 2n, dl, {==}))
437    case +d0 <> Nil{}:
438      Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> Nil{}, [1n, 0n]), Axis.order(Nat, coords, [1n, 0n])) == Shape.fit(d0 <> Nil{}, coords) : Bool}, nat_clash(1n, 2n, dl, {==}))
439    case +d0 <> +d1 <> Nil{}:
440      match coords:
441        case Nil{}:
442          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [1n, 0n]), Axis.order(Nat, Nil{}, [1n, 0n])) == Shape.fit(d0 <> d1 <> Nil{}, Nil{}) : Bool}, nat_clash(0n, 2n, cl, {==}))
443        case +c0 <> Nil{}:
444          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [1n, 0n]), Axis.order(Nat, c0 <> Nil{}, [1n, 0n])) == Shape.fit(d0 <> d1 <> Nil{}, c0 <> Nil{}) : Bool}, nat_clash(1n, 2n, cl, {==}))
445        case +c0 <> +c1 <> Nil{}:
446          Equal.trans(Bool, Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c0, d0), True{})), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), True{})), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), True{})), and_swap(Nat.is_lt(c1, d1), Nat.is_lt(c0, d0), True{}), {==})
447        case +c0 <> +c1 <> +c2 <> +ct:
448          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [1n, 0n]), Axis.order(Nat, c0 <> c1 <> c2 <> ct, [1n, 0n])) == Shape.fit(d0 <> d1 <> Nil{}, c0 <> c1 <> c2 <> ct) : Bool}, nat_clash(3n+List.length(&2, Nat, ct), 2n, cl, {==}))
449    case +d0 <> +d1 <> +d2 <> +dt:
450      Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> dt, [1n, 0n]), Axis.order(Nat, coords, [1n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> dt, coords) : Bool}, nat_clash(3n+List.length(&2, Nat, dt), 2n, dl, {==}))

Uses (12)

Used by (1)