def advance_prefix
bendtorch-core@0.1.0.0 · src/tensor/matmul_PROOF.bend:341
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_LAWS.bend as Laws
341def advance_prefix(+inner: U32, +left: Shape.Shape, +right: Shape.Shape, -a: Core.Tensor<left>, -b: Core.Tensor<right>,
342 -before_a: Core.Tensor<left>, -before_b: Core.Tensor<right>, -after_a: Core.Tensor<left>, -after_b: Core.Tensor<right>,
343 +output: Shape.Shape, -before: Core.Tensor<output>, -after: Core.Tensor<output>, +cursor: Nat,
344 +row: U32, +column: U32, +coordinate: Shape.CheckedCoordinate<output>, +value: F32,
345 -decoded: {Shape.unflatten_checked(output, U32.from_nat(cursor)) == Done{coordinate} : Result<&2, &2, Shape.Error, Shape.CheckedCoordinate<output>>},
346 -coordinates: {Shape.coordinate_values(output, coordinate) == [row, column] : List<&2, U32>},
347 -word_exact: {U32.to_nat(U32.from_nat(cursor)) == cursor : Nat},
348 prefix: Laws.ProductPrefix<inner, left, right, a, b, output, before_a, before_b, before, cursor>,
349 dot: Laws.DotMeaning<U32.to_nat(inner), left, right, before_a, before_b, row, column, 0n, 0.0, after_a, after_b, value>,
350 update: Core.CheckedUpdateMeaning(output, before, U32.from_nat(cursor), value, (after, Done{Unit{}}))) ->
351 Laws.ProductPrefix<inner, left, right, a, b, output, after_a, after_b, after, 1n+cursor>:
352 Laws.ProductPrefix{left_prior, right_prior, cells} = prefix
353 Laws.DotMeaning{factors, logical, fold, left_kept, right_kept} = dot
354 (checked, pair) = update
355 (observed, frame) = pair
356 Laws.ProductPrefix{other => Equal.trans(Maybe<&2, F32>, Core.checked_observe(left, after_a, other),
357 Core.checked_observe(left, before_a, other), Core.checked_observe(left, a, other), left_kept(other), left_prior(other)),
358 other => Equal.trans(Maybe<&2, F32>, Core.checked_observe(right, after_b, other),
359 Core.checked_observe(right, before_b, other), Core.checked_observe(right, b, other), right_kept(other), right_prior(other)),
360 position => earlier => prefix_cell_case(inner, left, right, a, b, output, after, cursor, position,
361 Laws.ProductCell{row, column, coordinate, decoded, coordinates, word_exact, factors,
362 logical_dot_original(U32.to_nat(inner), left, right, a, b, before_a, before_b, row, column, 0n, factors, logical, left_prior, right_prior),
363 value, fold, checked, observed},
364 position => earlier => frame_cell(inner, left, right, a, b, output, before, after, cursor, position, cells(position, earlier), word_exact, earlier, frame),
365 earlier_split(position, cursor, earlier))}