src/shape/construct_proofs.bend open laws/TODOs
raw source on the hub · import bendtorch-core@0.1.0.0/src/shape/construct_proofs.bend as Construct_proofs
4 imports
import Base import ./core.bend as Shape import ./nat_proofs.bend as Nats import ./LAWS.bend as Laws
Definitions
def within source · line 6 · raw
@-dims:List<&2, Nat> -> @capacity:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Capacity<dims> -> Bool
def bound_within source · line 13 · raw
@-dims:List<&2, Nat> -> @-size:Nat -> @-exact:{size == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.numel(dims) : Nat} -> @+decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<Nat.is_le(size, 1048576n)> -> @fits:{True{} == Nat.is_le(size, 1048576n) : Bool} -> {True{} == within(dims, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.capacity.bound(dims, size, exact, decision)) : Bool}
def scale_within source · line 20 · raw
@+head:Nat -> @-tail:List<&2, Nat> -> @+size:Nat -> @-exact:{size == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.numel(tail) : Nat} -> @+small:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<Bool.or(Nat.is_eq(size, 0n), Nat.is_le(head, 1048576n))> -> @fits_small:{True{} == Bool.or(Nat.is_eq(size, 0n), Nat.is_le(head, 1048576n)) : Bool} -> @fits_product:{True{} == Nat.is_le(Nat.mul(head, size), 1048576n) : Bool} -> {True{} == within(head <> tail, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.capacity.scale(head, tail, size, exact, small)) : Bool}
def scale_fits source · line 27 · raw
@+p:Nat -> @+size:Nat -> @bound:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(Nat.mul(1n+p, size), 1048576n) -> {True{} == Bool.or(Nat.is_eq(size, 0n), Nat.is_le(1n+p, 1048576n)) : Bool}
def zero_small source · line 34 · raw
@+size:Nat -> {True{} == Bool.or(Nat.is_eq(size, 0n), Nat.is_le(0n, 1048576n)) : Bool}
def zero_within source · line 41 · raw
@-tail:List<&2, Nat> -> @+rest:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Capacity<tail> -> {True{} == within(0n <> tail, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.capacity.step(0n, tail, rest)) : Bool}
def step_within source · line 48 · raw
@+p:Nat -> @+tail:List<&2, Nat> -> @+rest:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Capacity<tail> -> @ih:{True{} == within(tail, rest) : Bool} -> @bound:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(Nat.mul(1n+p, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.numel(tail)), 1048576n) -> {True{} == within((1n+p) <> tail, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.capacity.step(1n+p, tail, rest)) : Bool}
def capacity_complete source · line 56 · raw
@+dims:List<&2, Nat> -> @+bound:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.numel(dims), 1048576n) -> {True{} == within(dims, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.capacity(dims)) : Bool}
def capacity_built source · line 67 · raw
@+input:List<&2, U32> -> @rank_bound:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(input), 4n) -> @+capacity:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Capacity<0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(input)> -> @fits:{True{} == within(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(input), capacity) : Bool} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/LAWS.built(input, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.construct.capacity(input, rank_bound, capacity)) == Some{input} : Maybe<&2, List<&2, U32>>}
def construction_complete source · line 74 · raw
@+input:List<&2, U32> -> @+decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<Nat.is_le(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(input), 4n)> -> @rank_fits:{True{} == Nat.is_le(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(input), 4n) : Bool} -> @capacity_bound:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(input), 1048576n) -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/LAWS.built(input, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.construct.ranked(input, decision)) == Some{input} : Maybe<&2, List<&2, U32>>}