src/tensor/permutation_mapping.bend checks
raw source on the hub · import bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend as Permutation_mapping
12 imports
import Base import ../shape/core.bend as Shape import ./layout.bend as Layout import ./lifecycle.bend as Lifecycle import ../storage/arith.bend as Arith import ../shape/coordinate_proofs.bend as Coordinates import ../shape/nat_proofs.bend as Nats import ./word_conversion.bend as WordConversion import ../shape/LAWS.bend as ShapeLaws import ../shape/PROOF.bend as ShapeProof import ./axis_spec.bend as Axis import ./axis_algebra.bend as AxisAlgebra
Definitions
def permutation_checked source · line 14 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> {True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool}
def and_left source · line 19 · raw
@a:Bool -> @-b:Bool -> @equal:{True{} == Bool.and(a, b) : Bool} -> {True{} == a : Bool}
def and_right source · line 26 · raw
@a:Bool -> @-b:Bool -> @equal:{True{} == Bool.and(a, b) : Bool} -> {True{} == b : Bool}
def reverse_go_cancel source · line 33 · raw
@+values:List<&2, U32> -> @+accumulator:List<&2, U32> -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words_go(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words_go(values, accumulator), []) == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words_go(accumulator, values) : List<&2, U32>}
def reverse_involution source · line 42 · raw
@+values:List<&2, U32> -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(values)) == values : List<&2, U32>}
def codec_decoded source · line 45 · raw
@+dimensions:List<&2, U32> -> @+index:U32 -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unflatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(dimensions), index)) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.digits(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(dimensions), U32.to_nat(index))) : List<&2, U32>}
def coordinate_fits source · line 61 · raw
@+dimensions:List<&2, U32> -> @+values:List<&2, U32> -> @valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimensions, values) -> 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/coordinate_proofs.Fits(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(dimensions), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values))
def codec_flattened source · line 78 · raw
@+dimensions:List<&2, U32> -> @+values:List<&2, U32> -> @+valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimensions, values) -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.flatten_words(dimensions, values, 0) == U32.from_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.offset(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(dimensions), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values))) : U32}
def mapping_reference source · line 83 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+index:U32 -> @mapping:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Mapping<input, axes, plan, index> -> {Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.source_index(input, axes, plan, index, mapping)} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reference_source(input, axes, plan, index) : Maybe<&2, U32>}
def flat_mathematical_bounded source · line 104 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @index:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.FlatIndex<shape> -> {Nat.is_lt(U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.index_value(shape, index)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape))) == True{} : Bool}
def decoded_coordinate source · line 113 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+index:U32 -> @+inside:{True{} == Nat.is_lt(U32.to_nat(index), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape)) : Bool} -> 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Coordinate(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape))
def decoded_indices source · line 118 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+index:U32 -> @+inside:{True{} == Nat.is_lt(U32.to_nat(index), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape)) : Bool} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.indices(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), decoded_coordinate(shape, index, inside)) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.digits(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), U32.to_nat(index)) : List<&2, Nat>}
def decoded_fit source · line 134 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+index:U32 -> @+inside:{True{} == Nat.is_lt(U32.to_nat(index), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape)) : Bool} -> {True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.fit(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.digits(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), U32.to_nat(index))) : Bool}
def decoded_word_fits source · line 140 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+index:U32 -> @+inside:{True{} == Nat.is_lt(U32.to_nat(index), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape)) : Bool} -> 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/coordinate_proofs.Fits(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.digits(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), U32.to_nat(index)))))
def element_counts_same source · line 149 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+target:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @same:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(target)) : Nat} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(input) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(target) : Nat}
def natural_equal_true source · line 156 · raw
@+left:Nat -> @+right:Nat -> @same:{left == right : Nat} -> {Nat.is_eq(left, right) == True{} : Bool}
def metadata_present source · line 160 · raw
@value:Maybe<&2, List<&2, U32>> -> Bool
def reordered_rank_bound source · line 167 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))), 4n)
def reordered_capacity_bound source · line 175 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.logical_numel(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))), 1048576n)
def reordered_construct_complete source · line 183 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/LAWS.built(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.construct(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)))) == Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))} : Maybe<&2, List<&2, U32>>}
def selected_construct_complete source · line 190 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+dimensions:List<&2, U32> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @same:{dimensions == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)) : List<&2, U32>} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/LAWS.built(dimensions, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.construct(dimensions)) == Some{dimensions} : Maybe<&2, List<&2, U32>>}
def reordered_elements_same source · line 198 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+output:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @preserved:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(output) == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)) : List<&2, U32>} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(input) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(output) : Nat}
def plan_counted_success source · line 210 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+output:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @+ordered:{Some{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(output)} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes) : Maybe<&2, List<&2, U32>>} -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<Nat.is_eq(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(output))> -> @same:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(input) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(output) : Nat} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.plan_counted(input, axes, output, valid, ordered, decision)) == True{} : Bool}
def plan_built_success source · line 224 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+dimensions:List<&2, U32> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @+selected:{Some{dimensions} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes) : Maybe<&2, List<&2, U32>>} -> @built:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.ConstructResult<dimensions> -> @complete:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/LAWS.built(dimensions, built) == Some{dimensions} : Maybe<&2, List<&2, U32>>} -> @+same:{dimensions == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)) : List<&2, U32>} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.plan_built(input, axes, dimensions, valid, selected, built)) == True{} : Bool}
def plan_selected_success source · line 243 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @selected:Maybe<&2, List<&2, U32>> -> @+same:{selected == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes) : Maybe<&2, List<&2, U32>>} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.plan_selected(input, axes, valid, selected, same)) == True{} : Bool}
def plan_decided_success source · line 265 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes)> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.plan_decided(input, axes, decision)) == True{} : Bool}
def plan_unique_success source · line 276 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unique(axes)> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.plan_unique(input, axes, decision)) == True{} : Bool}
def plan_bounded_success source · line 290 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bounded(axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank(input))> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.plan_bounded(input, axes, decision)) == True{} : Bool}
def plan_ranked_success source · line 304 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<Nat.is_eq(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(axes), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)))> -> @+valid:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.plan_ranked(input, axes, decision)) == True{} : Bool}
def words_valid_of source · line 318 · raw
@+dimensions:List<&2, U32> -> @+values:List<&2, U32> -> @fits:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/coordinate_proofs.Fits(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(dimensions), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values)) -> 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimensions, values)
def words_finish_success source · line 334 · raw
@-dimension:U32 -> @-dt:List<&2, U32> -> @-value:U32 -> @-vt:List<&2, U32> -> @bound:{True{} == U32.is_lt(value, dimension) : Bool} -> @result:Result<&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dt, vt)> -> @successful:{Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dt, vt), result) == True{} : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimension <> dt, value <> vt), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.words_finish(dimension, dt, value, vt, bound, result)) == True{} : Bool}
def words_decided_success source · line 345 · raw
@+dimension:U32 -> @+dt:List<&2, U32> -> @+value:U32 -> @+vt:List<&2, U32> -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<U32.is_lt(value, dimension)> -> @bound:{True{} == U32.is_lt(value, dimension) : Bool} -> @successful:{Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dt, vt), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.words_check(dt, vt)) == True{} : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimension <> dt, value <> vt), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.words_decided(dimension, dt, value, vt, unit => 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.words_check(dt, vt), decision)) == True{} : Bool}
def words_check_success source · line 357 · raw
@+dimensions:List<&2, U32> -> @+values:List<&2, U32> -> @valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimensions, values) -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimensions, values), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.words_check(dimensions, values)) == True{} : Bool}
def decoded_words_valid source · line 370 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+index:U32 -> @+inside:{True{} == Nat.is_lt(U32.to_nat(index), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape)) : Bool} -> 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unflatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape)), index)))
def coordinate_offset_bound source · line 378 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+values:List<&2, U32> -> @+valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), values) -> 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LT(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.offset(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape))
def coordinate_offset_exact source · line 387 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+values:List<&2, U32> -> @+valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), values) -> {U32.to_nat(U32.from_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.offset(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values)))) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.offset(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values)) : Nat}
def coordinate_flatten_exact source · line 396 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+values:List<&2, U32> -> @+valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), values) -> {U32.to_nat(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.flatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), values, 0)) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.offset(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values)) : Nat}
def words_valid_rank source · line 404 · raw
@+dimensions:List<&2, U32> -> @+values:List<&2, U32> -> @valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimensions, values) -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(values) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(dimensions) : Nat}
def words_fit_true source · line 417 · raw
@+dimensions:List<&2, U32> -> @+values:List<&2, U32> -> @+valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(dimensions, values) -> {True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.fit(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(dimensions), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(values)) : Bool}
def permutation_dimensions_order source · line 424 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)) == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)) : List<&2, U32>}
def shape_rank_bound source · line 432 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.LE(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape)), 4n)
def reverse_restored source · line 437 · raw
@-A:Data -> @-rank:Nat -> @-axes:List<&2, Nat> -> @-items:List<&2, A> -> @certificate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_algebra.ListFacts<A, rank, axes, items> -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(A, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(A, items, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.inverse_axes(rank, axes)), axes) == items : List<&2, A>}
def natural_coordinate_length source · line 442 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+coordinates:List<&2, U32> -> @length:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(coordinates) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat} -> {List.length(&2, Nat, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(coordinates)) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat}
def inverse_coordinate_length source · line 448 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+coordinates:List<&2, U32> -> @accepted:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @length:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(coordinates) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat} -> {List.length(&2, Nat, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(Nat, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(coordinates), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.inverse_axes(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)))) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat}
def inverse_coordinate_fit_certified source · line 460 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+coordinates:List<&2, U32> -> @+accepted:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @+length:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(coordinates) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat} -> @fitted:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.fit(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(coordinates)) : Bool} -> @certificate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_algebra.Facts<0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes)> -> {True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.fit(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, coordinates, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.inverse_axes(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))))) : Bool}
def inverse_coordinate_fit source · line 490 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+coordinates:List<&2, U32> -> @+accepted:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.bijective(input, axes) : Bool} -> @length:{0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(coordinates) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat} -> @fitted:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.fit(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(coordinates)) : Bool} -> {True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.fit(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.extents(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, coordinates, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.inverse_axes(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))))) : Bool}
def output_coordinate_rank source · line 498 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+coordinate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate)) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat}
def inverse_words_valid source · line 509 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+coordinate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+values:List<&2, U32> -> @inverse:{Some{values} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate), 0) : Maybe<&2, List<&2, U32>>} -> 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), values)
def coordinate_flatten_bounded source · line 531 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+values:List<&2, U32> -> @+valid:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), values) -> {True{} == U32.is_lt(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.flatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), values, 0), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape)) : Bool}
def checked_coordinate_flatten_bounded source · line 540 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @coordinate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<shape> -> {True{} == U32.is_lt(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.flatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(shape), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(shape, coordinate), 0), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape)) : Bool}
def word_same_refl source · line 545 · raw
@+width:Nat -> @+word:Word(width) -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.word_same(width, word, word) == True{} : Bool}
def word_value_same_refl source · line 556 · raw
@+value:U32 -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.word_value_same(value, value) == True{} : Bool}
def words_same_refl source · line 561 · raw
@+values:List<&2, U32> -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.words_same(values, values) == True{} : Bool}
def inverse_words_order source · line 570 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+coordinate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+values:List<&2, U32> -> @inverse:{Some{values} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate), 0) : Maybe<&2, List<&2, U32>>} -> {values == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.order(U32, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/axis_spec.inverse_axes(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.naturals(axes))) : List<&2, U32>}
def inverse_words_reordered source · line 582 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+coordinate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+values:List<&2, U32> -> @+inverse:{Some{values} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate), 0) : Maybe<&2, List<&2, U32>>} -> {0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(values, axes) == Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate)} : Maybe<&2, List<&2, U32>>}
def inverse_words_roundtrip source · line 610 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+coordinate:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+values:List<&2, U32> -> @inverse:{Some{values} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate), 0) : Maybe<&2, List<&2, U32>>} -> {True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.maybe_same(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(values, axes), Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), coordinate)}) : Bool}
def mapping_flat_success source · line 619 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+index:U32 -> @oi:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.FlatIndex<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @oc:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+ic:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<input> -> @requested:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.index_value(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oi) == index : U32} -> @decoded:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc) == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unflatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan))), index)) : List<&2, U32>} -> @inverse:{Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(input, ic)} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc), 0) : Maybe<&2, List<&2, U32>>} -> @roundtrip:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.maybe_same(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(input, ic), axes), Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc)}) : Bool} -> @+source_index:U32 -> @flat:{source_index == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.flatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(input, ic), 0) : U32} -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<U32.is_lt(source_index, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(input))> -> @bounded:{True{} == U32.is_lt(source_index, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(input)) : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Mapping<input, axes, plan, index>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.map_flat(input, axes, plan, index, oi, oc, ic, requested, decoded, inverse, roundtrip, source_index, flat, decision)) == True{} : Bool}
def mapping_roundtrip_success source · line 636 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+index:U32 -> @+oi:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.FlatIndex<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+oc:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+ic:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<input> -> @+requested:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.index_value(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oi) == index : U32} -> @+decoded:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc) == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unflatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan))), index)) : List<&2, U32>} -> @+inverse:{Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(input, ic)} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc), 0) : Maybe<&2, List<&2, U32>>} -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.maybe_same(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(input, ic), axes), Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc)})> -> @roundtrip:{True{} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.maybe_same(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reorder(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(input, ic), axes), Some{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc)}) : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Mapping<input, axes, plan, index>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.map_roundtrip(input, axes, plan, index, oi, oc, ic, requested, decoded, inverse, decision)) == True{} : Bool}
def mapping_input_success source · line 656 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+index:U32 -> @+oi:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.FlatIndex<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+oc:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+requested:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.index_value(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oi) == index : U32} -> @+decoded:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc) == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unflatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan))), index)) : List<&2, U32>} -> @+values:List<&2, U32> -> @+inverse:{Some{values} == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc), 0) : Maybe<&2, List<&2, U32>>} -> @checked:Result<&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), values)> -> @successful:{Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), values), checked) == True{} : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Mapping<input, axes, plan, index>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.map_input(input, axes, plan, index, oi, oc, requested, decoded, values, inverse, checked)) == True{} : Bool}
def mapping_inverse_success source · line 673 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+index:U32 -> @+oi:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.FlatIndex<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+oc:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.CheckedCoordinate<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+requested:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.index_value(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oi) == index : U32} -> @+decoded:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc) == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unflatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan))), index)) : List<&2, U32>} -> @result:Maybe<&2, List<&2, U32>> -> @+same:{result == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.inverse_coordinates(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input), axes, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.coordinate_values(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oc), 0) : Maybe<&2, List<&2, U32>>} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Mapping<input, axes, plan, index>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.map_inverse(input, axes, plan, index, oi, oc, requested, decoded, result, same)) == True{} : Bool}
def mapping_output_success source · line 694 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+index:U32 -> @+oi:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.FlatIndex<0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)> -> @+requested:{0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.index_value(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan), oi) == index : U32} -> @+values:List<&2, U32> -> @+decoded:{values == 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.unflatten_words(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.reverse_words(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan))), index)) : List<&2, U32>} -> @checked:Result<&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)), values)> -> @successful:{Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.WordsValid(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)), values), checked) == True{} : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Mapping<input, axes, plan, index>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.map_output(input, axes, plan, index, oi, requested, values, decoded, checked)) == True{} : Bool}
def mapping_decided_success source · line 708 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> @+index:U32 -> @decision:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.BoolCase<U32.is_lt(index, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan)))> -> @inside:{True{} == U32.is_lt(index, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan))) : Bool} -> {Result.is_done(&2, &2, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Error, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Mapping<input, axes, plan, index>, 0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.map_decided(input, axes, plan, index, decision)) == True{} : Bool}
def cursor_word_exact source · line 728 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+cursor:Nat -> @within:{Nat.is_le(cursor, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape)) == True{} : Bool} -> {U32.to_nat(U32.from_nat(cursor)) == cursor : Nat}
def cursor_index_bounded source · line 735 · raw
@+shape:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+cursor:Nat -> @+inside:{True{} == Nat.is_lt(cursor, 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.elements(shape)) : Bool} -> {True{} == U32.is_lt(U32.from_nat(cursor), 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.count(shape)) : Bool}
def permutation_output_rank source · line 745 · raw
@+input:0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.Shape -> @+axes:List<&2, U32> -> @+plan:0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.Plan<input, axes> -> {0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/tensor/layout.output(input, axes, plan))) == 0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.rank_dimensions(0x1689e5deb278c16abd3bd45eac101ef3/src/shape/core.dimensions(input)) : Nat}