src/tensor/contracts/build_facts.bend checks
raw source on the hub · import bendtorch-core@0.1.0.0/src/tensor/contracts/build_facts.bend as Build_facts
16 imports
import Base import ../../shape/core.bend as Shape import ../../shape/index_proofs.bend as Index import ../../shape/nat_proofs.bend as Nats import ../../storage/model.bend as Model import ../../storage/main.bend as Storage import ../../storage/LAWS.bend as StorageLaws import ../../storage/array.bend as ArrayCore import ../../storage/refinement.bend as Refinement import ../../storage/api.bend as Api import ../../storage/arith.bend as Arith import ../../storage/route.bend as Route import ../lifecycle.bend as Lifecycle import ../word_conversion.bend as Conversion import ./replayed.bend as Replayed import ./binary_storage_proof.bend as Owned
Definitions
def lt_zero_false source · line 23 · raw
@+x:Nat -> {Nat.is_lt(x, 0n) == False{} : Bool}
def lt_self_succ source · line 30 · raw
@+k:Nat -> {Nat.is_lt(k, 1n+k) == True{} : Bool}
def lt_succ_right source · line 37 · raw
@+b:Nat -> @+k:Nat -> @h:{Nat.is_lt(b, k) == True{} : Bool} -> {Nat.is_lt(b, 1n+k) == True{} : Bool}
def above_false source · line 48 · raw
@+k:Nat -> @+b:Nat -> @h:{Nat.is_lt(k, b) == True{} : Bool} -> {Nat.is_lt(b, 1n+k) == False{} : Bool}
def lt_asym source · line 59 · raw
@+k:Nat -> @+b:Nat -> @h:{Nat.is_lt(k, b) == True{} : Bool} -> {Nat.is_lt(b, k) == False{} : Bool}
def below_true source · line 72 · raw
@+b:Nat -> @+k:Nat -> @h:{Nat.is_le(1n+b, k) == True{} : Bool} -> {Nat.is_lt(b, k) == True{} : Bool}
def lt_add_right source · line 83 · raw
@+a:Nat -> @+c:Nat -> @+b:Nat -> @h:{Nat.is_lt(a, c) == True{} : Bool} -> {Nat.is_lt(Nat.add(a, b), Nat.add(c, b)) == True{} : Bool}
def le_add_cong source · line 95 · raw
@+c:Nat -> @+x:Nat -> @+y:Nat -> @h:{Nat.is_le(x, y) == True{} : Bool} -> {Nat.is_le(Nat.add(c, x), Nat.add(c, y)) == True{} : Bool}
def le_trans source · line 103 · raw
@+a:Nat -> @+b:Nat -> @+c:Nat -> @ab:{Nat.is_le(a, b) == True{} : Bool} -> @bc:{Nat.is_le(b, c) == True{} : Bool} -> {Nat.is_le(a, c) == True{} : Bool}
def position_step source · line 115 · raw
@+capacity:Nat -> @+offset:Nat -> @+base:Nat -> {Nat.add(offset, Nat.add(capacity, base)) == Nat.add(Nat.add(capacity, offset), base) : Nat}
def add_zero_right source · line 120 · raw
@+number:Nat -> {Nat.add(number, 0n) == number : Nat}
def output_position source · line 129 · raw
@+depth:Nat -> @+length:Nat -> @+index:U32 -> @+valid:{0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.bounds(depth, length) == True{} : Bool} -> @+inside:{Nat.is_lt(U32.to_nat(index), length) == True{} : Bool} -> {Nat.add(0x1689e5deb278c16abd3bd45eac101ef3/src/storage/model.offset(depth, 0x1689e5deb278c16abd3bd45eac101ef3/src/storage/refinement.route(depth, index)), 0n) == U32.to_nat(index) : Nat}
def storage_shift source · line 144 · raw
@-shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @-s:0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.Storage -> @-t:0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.Storage -> @e:{s == t : 0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.Storage} -> @-R:(@st:0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.Storage -> @-k:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/lifecycle.logical_length(st) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape)) : Nat} -> Type) -> @h:(@-k:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/lifecycle.logical_length(s) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape)) : Nat} -> R(s, k)) -> @-k:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/lifecycle.logical_length(t) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape)) : Nat} -> R(t, k)
def input_lift source · line 153 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+fill:F32 -> @+ops:List<&2, 0x1689e5deb278c16abd3bd45eac101ef3/src/storage/LAWS.Op> -> @+nonzero:{Nat.is_lt(0n, U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape))) == True{} : Bool} -> @-Q:(@_:0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.Storage -> Type) -> @owned:(@+d:Nat -> @+fits:{0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.bounds(d, U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape))) == True{} : Bool} -> @-b:0x1689e5deb278c16abd3bd45eac101ef3/src/storage/model.Balanced(F32, d, 0x1689e5deb278c16abd3bd45eac101ef3/src/storage/api.arr(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/binary_storage_proof.norm(U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape)), ops, []), d, fill)) -> @-f:{0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.bounds(d, U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape))) == True{} : Bool} -> Q(0x1689e5deb278c16abd3bd45eac101ef3/src/storage/main.Owned{d, U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape)), 0x1689e5deb278c16abd3bd45eac101ef3/src/storage/api.arr(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/binary_storage_proof.norm(U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape)), ops, []), d, fill), b, f})) -> Q(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/contracts/replayed.storage(shape, fill, ops))A replayed tensor with a cell is an owned storage whose array is arr of
its normalized history.