MatmulPROOF.plan_right_status: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend as MatmulPROOF Lines 1095-1117 of bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&start_line=1095&end_line=1117 import Base import bendtorch-core@0.1.0.0/src/shape/core.bend as Shape import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix import bendtorch-core@0.1.0.0/src/tensor/math_totality.bend as Totality def plan_right_status(dimensions: List<&2, U32>, +left: Shape.Shape, +right: Shape.Shape, +rows: U32, +inner: U32, -le: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>}, -same: {dimensions == Shape.dimensions(right) : List<&2, U32>}, -valid: Totality.MatrixInputs) -> PlanStatus: match dimensions: case +right_inner <> +columns <> Nil{}: PlanStatus{{\{Totality.MatrixBounds: compatible => supported => {\{PlanStatus: successful => successful} : PlanStatus, [right_inner, columns], Shape.dimensions(right), same), Shape.bool_case(Nat.is_eq(U32.to_nat(inner), U32.to_nat(right_inner))))> -> {Result.is_done(&2, &2, Matrix.Error, Matrix.Plan, Matrix.plan_right(left, right, rows, inner, le, [right_inner, columns], same)) == True{} : Bool}}( plan_compatible_status(left, right, rows, inner, right_inner, columns, Shape.bool_case(Nat.is_eq(U32.to_nat(inner), U32.to_nat(right_inner))), le, Equal.sym(List<&2, U32>, [right_inner, columns], Shape.dimensions(right), same), compatible, supported))} : Totality.MatrixBounds -> {Result.is_done(&2, &2, Matrix.Error, Matrix.Plan, Matrix.plan_right(left, right, rows, inner, le, [right_inner, columns], same)) == True{} : Bool}}( actual_admission(left, right, rows, inner, right_inner, columns, le, Equal.sym(List<&2, U32>, [right_inner, columns], Shape.dimensions(right), same), valid))} case Nil{}: PlanStatus{Empty.absurd({False{} == True{} : Bool}, right_rank_clash(left, right, Nil{}, same, {==}, {\{Totality.RankTwo: rank => rank} : Totality.RankTwo -> {Shape.rank_dimensions(Shape.dimensions(right)) == 2n : Nat}}(swapped_inputs(left, right, valid))))} case head <> Nil{}: PlanStatus{Empty.absurd({False{} == True{} : Bool}, right_rank_clash(left, right, [head], same, {==}, {\{Totality.RankTwo: rank => rank} : Totality.RankTwo -> {Shape.rank_dimensions(Shape.dimensions(right)) == 2n : Nat}}(swapped_inputs(left, right, valid))))} case first <> second <> third <> rest: PlanStatus{Empty.absurd({False{} == True{} : Bool}, right_rank_clash(left, right, first <> second <> third <> rest, same, {==}, {\{Totality.RankTwo: rank => rank} : Totality.RankTwo -> {Shape.rank_dimensions(Shape.dimensions(right)) == 2n : Nat}}(swapped_inputs(left, right, valid))))} Uses (25): 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.sym https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat 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=Base/base.bend&name=U32.to_nat 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=rank_dimensions https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/math_totality.bend&name=MatrixBounds https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/math_totality.bend&name=MatrixInputs https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/math_totality.bend&name=RankTwo https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=Plan https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=plan_compatible https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul.bend&name=plan_right https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&name=PlanStatus https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&name=actual_admission https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&name=plan_compatible_status https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&name=right_rank_clash https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/tensor/matmul_PROOF.bend&name=swapped_inputs