PermutationMapping.plan_built_success: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend as PermutationMapping Lines 224-241 of bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend&start_line=224&end_line=241 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/layout.bend as Layout import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith import bendtorch-core@0.1.0.0/src/shape/LAWS.bend as ShapeLaws import bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend as Axis def plan_built_success(+input: Shape.Shape, +axes: List<&2, U32>, +dimensions: List<&2, U32>, +valid: {True{} == Layout.bijective(input, axes) : Bool}, +selected: {Some{dimensions} == Layout.reorder(Shape.dimensions(input), axes) : Maybe<&2, List<&2, U32>>}, built: Shape.ConstructResult, complete: {ShapeLaws.built(dimensions, built) == Some{dimensions} : Maybe<&2, List<&2, U32>>}, +same: {dimensions == Axis.order(U32, Shape.dimensions(input), Shape.naturals(axes)) : List<&2, U32>}) -> {Result.is_done(&2, &2, Layout.Error, Layout.Plan, Layout.plan_built(input, axes, dimensions, valid, selected, built)) == True{} : Bool}: match built: case Shape.SError{error}: Empty.absurd({False{} == True{} : Bool}, Arith.clash(Equal.cong(Maybe<&2, List<&2, U32>>, Bool, metadata_present, None{}, Some{dimensions}, complete))) case Shape.SBuilt{+output, +preserved}: plan_counted_success(input, axes, output, valid, Equal.trans(Maybe<&2, List<&2, U32>>, Some{Shape.dimensions(output)}, Some{dimensions}, Layout.reorder(Shape.dimensions(input), axes), Equal.cong(List<&2, U32>, Maybe<&2, List<&2, U32>>, values => Some{values}, Shape.dimensions(output), dimensions, preserved), selected), Shape.bool_case(Nat.is_eq(Shape.elements(input), Shape.elements(output))), reordered_elements_same(input, axes, output, valid, Equal.trans(List<&2, U32>, Shape.dimensions(output), dimensions, Axis.order(U32, Shape.dimensions(input), Shape.naturals(axes)), preserved, same))) Uses (26): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Empty.absurd https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.cong https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Equal.trans https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.is_eq https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result.is_done https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/LAWS.bend&name=built https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=ConstructResult https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=Shape https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=bool_case https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=elements https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/shape/core.bend&name=naturals https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/storage/arith.bend&name=clash https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/axis_spec.bend&name=order https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=bijective https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=plan_built https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/layout.bend&name=reorder https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend&name=metadata_present https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend&name=plan_counted_success https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/permutation_mapping.bend&name=reordered_elements_same