def lists_01

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

import bendtorch-core@0.1.0.0/src/tensor/axis_algebra.bend as AxisAlgebra
import Base

370def lists_01(-A: Data, +items: List<&2, A>, length: {List.length(&2, A, items) == 2n : Nat}) -> ListFacts<A, 2n, [0n, 1n], items>:
371  match items:
372    case Nil{}:
373      Empty.absurd(ListFacts<A, 2n, [0n, 1n], Nil{}>, nat_clash(0n, 2n, length, {==}))
374    case +x0 <> Nil{}:
375      Empty.absurd(ListFacts<A, 2n, [0n, 1n], x0 <> Nil{}>, nat_clash(1n, 2n, length, {==}))
376    case +x0 <> +x1 <> Nil{}:
377      Lists{{==}, {==}, {==}, {==}, {==}, {==}}
378    case +x0 <> +x1 <> +x2 <> +tail:
379      Empty.absurd(ListFacts<A, 2n, [0n, 1n], x0 <> x1 <> x2 <> tail>, nat_clash(3n+List.length(&2, A, tail), 2n, length, {==}))

Uses (6)

Used by (1)