def construction_complete

bendtorch-core@0.1.0.0 · src/shape/construct_proofs.bend:74

import bendtorch-core@0.1.0.0/src/shape/construct_proofs.bend as ConstructProofs
import Base
import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape
import bendtorch-core@0.1.0.0/src/shape/nat_proofs.bend as Nats
import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as Laws

74def construction_complete(+input: List<&2, U32>, +decision: Shape.BoolCase<Nat.is_le(Shape.rank_dimensions(input), 4n)>, rank_fits: {True{} == Nat.is_le(Shape.rank_dimensions(input), 4n) : Bool}, capacity_bound: Shape.LE(Shape.logical_numel(input), 1048576n)) -> {Laws.built(input, Shape.construct.ranked(input, decision)) == Some{input} : Maybe<&2, List<&2, U32>>}:
75  match decision:
76    case Shape.BFalse{equal}:
77      Empty.absurd({Laws.built(input, Shape.construct.ranked(input, Shape.BFalse{equal})) == Some{input} : Maybe<&2, List<&2, U32>>}, Nats.contradiction(Nat.is_le(Shape.rank_dimensions(input), 4n), rank_fits, equal))
78    case Shape.BTrue{equal}:
79      capacity_built(input, Shape.LE.from(Shape.rank_dimensions(input), 4n, equal), Shape.capacity(Shape.naturals(input)), capacity_complete(Shape.naturals(input), capacity_bound))

Uses (18)

Used by (2)