def left_pair

bendtorch-core@0.1.0.0 · src/tensor/matmul_PROOF.bend:198

import bendtorch-core@0.1.0.0/src/tensor/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/core.bend as Core
import bendtorch-core@0.1.0.0/src/tensor/matmul.bend as Matrix
import bendtorch-core@0.1.0.0/src/tensor/matmul_LAWS.bend as Laws

198def left_pair(+fuel: Nat, +left: Shape.Shape, +right: Shape.Shape, -a: Core.Tensor<left>, b: Core.Tensor<right>,
199  ra: Core.Tensor<left>, result: Result<&2, &2, Core.Error, F32>,
200  +row: U32, +column: U32, +cursor: Nat, +accumulator: F32,
201  -rec: @a: Core.Tensor<left> -> @b: Core.Tensor<right> -> @+value: F32 ->
202    Laws.SourceDot<fuel, left, right, a, b, row, column, 1n+cursor, value, Matrix.natural_dot(fuel, left, right, a, b, row, column, 1n+cursor, value)>,
203  -exact_cursor: {U32.to_nat(U32.from_nat(cursor)) == cursor : Nat},
204  -meaning: @unit: Unit -> {Core.result_value(result) == Laws.coordinate_observe(left, a, [row, U32.from_nat(cursor)]) : Maybe<&2, F32>},
205  -left_kept: @+other: U32 -> {Core.checked_observe(left, ra, other) == Core.checked_observe(left, a, other) : Maybe<&2, F32>}) ->
206  Laws.SourceDot<1n+fuel, left, right, a, b, row, column, cursor, accumulator, Matrix.left_read(left, right,
207    a => b => value => Matrix.natural_dot(fuel, left, right, a, b, row, column, 1n+cursor, value), b, [U32.from_nat(cursor), column], accumulator, (ra, result))>:
208  match result:
209    case Fail{error}:
210      Laws.SourceDot{unit => Unit{}}
211    case Done{+lv}:
212      right_certificate(fuel, left, right, a, b, ra, row, column, cursor, accumulator, lv, rec, exact_cursor,
213        Equal.sym(Maybe<&2, F32>, Some{lv}, Laws.coordinate_observe(left, a, [row, U32.from_nat(cursor)]), meaning(Unit{})), left_kept,
214        coordinate_certificate(right, b, [U32.from_nat(cursor), column]))

Uses (22)

Used by (1)