def words_of

bendtorch-core@0.1.0.0 · src/tensor/reduction_PROOF.bend:427

import bendtorch-core@0.1.0.0/src/tensor/reduction_PROOF.bend as ReductionPROOF
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/reduction_LAWS.bend as Laws
import bendtorch-core@0.1.0.0/src/tensor/math_totality.bend as Totality
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith

427def words_of(-fuel: Nat, -shape: Shape.Shape, -tensor: Core.Tensor<shape>, result: Result<&2, &1, Core.Error, Core.Tensor<shape> & F32>,
428  meaning: Laws.LoopMeaning(fuel, shape, tensor, 0n, 0.0, result),
429  status: Totality.Status<Core.Error, Core.Tensor<shape> & F32, result>) -> Fact<Words<fuel, shape, tensor>>:
430  match result:
431    case Fail{error}:
432      Fact{{\{Totality.Status: successful => Empty.absurd(Words<fuel, shape, tensor>, Arith.clash(successful))} :
433        Totality.Status<Core.Error, Core.Tensor<shape> & F32, Fail{error}> -> Words<fuel, shape, tensor>}(status)}
434    case Done{pair}:
435      (retained, value) = pair
436      Laws.SumMeaning{values, logical, fold} = meaning
437      Fact{Words{values, logical}}

Uses (15)

Used by (1)