def fit_2130

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

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

1631def fit_2130(+dims: List<&2, Nat>, +coords: List<&2, Nat>, dl: {List.length(&2, Nat, dims) == 4n : Nat}, cl: {List.length(&2, Nat, coords) == 4n : Nat}) -> {Shape.fit(Axis.order(Nat, dims, [2n, 1n, 3n, 0n]), Axis.order(Nat, coords, [2n, 1n, 3n, 0n])) == Shape.fit(dims, coords) : Bool}:
1632  match dims:
1633    case Nil{}:
1634      Empty.absurd({Shape.fit(Axis.order(Nat, Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, coords, [2n, 1n, 3n, 0n])) == Shape.fit(Nil{}, coords) : Bool}, nat_clash(0n, 4n, dl, {==}))
1635    case +d0 <> Nil{}:
1636      Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, coords, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> Nil{}, coords) : Bool}, nat_clash(1n, 4n, dl, {==}))
1637    case +d0 <> +d1 <> Nil{}:
1638      Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, coords, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> Nil{}, coords) : Bool}, nat_clash(2n, 4n, dl, {==}))
1639    case +d0 <> +d1 <> +d2 <> Nil{}:
1640      Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, coords, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> Nil{}, coords) : Bool}, nat_clash(3n, 4n, dl, {==}))
1641    case +d0 <> +d1 <> +d2 <> +d3 <> Nil{}:
1642      match coords:
1643        case Nil{}:
1644          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, Nil{}, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, Nil{}) : Bool}, nat_clash(0n, 4n, cl, {==}))
1645        case +c0 <> Nil{}:
1646          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, c0 <> Nil{}, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> Nil{}) : Bool}, nat_clash(1n, 4n, cl, {==}))
1647        case +c0 <> +c1 <> Nil{}:
1648          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, c0 <> c1 <> Nil{}, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> c1 <> Nil{}) : Bool}, nat_clash(2n, 4n, cl, {==}))
1649        case +c0 <> +c1 <> +c2 <> Nil{}:
1650          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, c0 <> c1 <> c2 <> Nil{}, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> c1 <> c2 <> Nil{}) : Bool}, nat_clash(3n, 4n, cl, {==}))
1651        case +c0 <> +c1 <> +c2 <> +c3 <> Nil{}:
1652          Equal.trans(Bool, Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), Bool.and(Nat.is_lt(c0, d0), True{})))), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})))), Equal.cong(Bool, Bool, value => Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), value)), Bool.and(Nat.is_lt(c3, d3), Bool.and(Nat.is_lt(c0, d0), True{})), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c3, d3), True{})), and_swap(Nat.is_lt(c3, d3), Nat.is_lt(c0, d0), True{})), Equal.trans(Bool, Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})))), Equal.cong(Bool, Bool, value => Bool.and(Nat.is_lt(c2, d2), value), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c3, d3), True{}))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{}))), and_swap(Nat.is_lt(c1, d1), Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c3, d3), True{}))), Equal.trans(Bool, Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})))), and_swap(Nat.is_lt(c2, d2), Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{}))), Equal.trans(Bool, Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})))), Bool.and(Nat.is_lt(c0, d0), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{})))), Equal.cong(Bool, Bool, value => Bool.and(Nat.is_lt(c0, d0), value), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{}))), Bool.and(Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c2, d2), Bool.and(Nat.is_lt(c3, d3), True{}))), and_swap(Nat.is_lt(c2, d2), Nat.is_lt(c1, d1), Bool.and(Nat.is_lt(c3, d3), True{}))), {==}))))
1653        case +c0 <> +c1 <> +c2 <> +c3 <> +c4 <> +ct:
1654          Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> Nil{}, [2n, 1n, 3n, 0n]), Axis.order(Nat, c0 <> c1 <> c2 <> c3 <> c4 <> ct, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> Nil{}, c0 <> c1 <> c2 <> c3 <> c4 <> ct) : Bool}, nat_clash(5n+List.length(&2, Nat, ct), 4n, cl, {==}))
1655    case +d0 <> +d1 <> +d2 <> +d3 <> +d4 <> +dt:
1656      Empty.absurd({Shape.fit(Axis.order(Nat, d0 <> d1 <> d2 <> d3 <> d4 <> dt, [2n, 1n, 3n, 0n]), Axis.order(Nat, coords, [2n, 1n, 3n, 0n])) == Shape.fit(d0 <> d1 <> d2 <> d3 <> d4 <> dt, coords) : Bool}, nat_clash(5n+List.length(&2, Nat, dt), 4n, dl, {==}))

Uses (13)

Used by (1)