def facts_right
bendtorch-core@0.1.0.0 · src/tensor/contracts/matmul_proof.bend:61
import bendtorch-core@0.1.0.0/src/tensor/contracts/matmul_proof.bend as MatmulProof
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
61def facts_right(-left: Shape.Shape, +right: Shape.Shape, +rows: U32, +inner: U32,
62 le: {Shape.dimensions(left) == [rows, inner] : List<&2, U32>}, dimensions: List<&2, U32>,
63 same: {dimensions == Shape.dimensions(right) : List<&2, U32>}) ->
64 Facts(left, right, Matrix.plan_right(left, right, rows, inner, le, dimensions, same)):
65 match dimensions:
66 case +right_inner <> +columns <> Nil{}:
67 facts_compatible(left, right, rows, inner, right_inner, columns, le,
68 Equal.sym(List<&2, U32>, [right_inner, columns], Shape.dimensions(right), same),
69 Shape.bool_case(Nat.is_eq(U32.to_nat(inner), U32.to_nat(right_inner))))
70 case Nil{}:
71 Unit{}
72 case head <> Nil{}:
73 Unit{}
74 case first <> second <> third <> rest:
75 Unit{}