def past_frame

bendtorch-core@0.1.0.0 · src/tensor/transform_PROOF.bend:834

import bendtorch-core@0.1.0.0/src/tensor/transform_PROOF.bend as TransformPROOF
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

834def past_frame(-shape: Shape.Shape, -before: Core.Tensor<shape>, -after: Core.Tensor<shape>, +cursor: Nat, +other: Nat,
835  -converted: {U32.to_nat(U32.from_nat(cursor)) == cursor : Nat}, -prior_word: {U32.to_nat(U32.from_nat(other)) == other : Nat},
836  -prior_checked: Core.ObservationChecked(Core.Packed{shape, before}, U32.from_nat(other)),
837  -earlier: {Nat.is_lt(other, cursor) == True{} : Bool},
838  -frame: @+j: U32 -> @checked: Core.ObservationChecked(Core.Packed{shape, before}, j) ->
839    @different: {Nat.is_eq(U32.to_nat(U32.from_nat(cursor)), U32.to_nat(j)) == False{} : Bool} ->
840      Core.ObservationChecked(Core.Packed{shape, after}, j) &
841        {Core.checked_observe(shape, after, j) == Core.checked_observe(shape, before, j) : Maybe<&2, F32>}) ->
842  PastFrame<shape, before, after, other>:
843  PastFrame{
844    Pair.fst(Core.ObservationChecked(Core.Packed{shape, after}, U32.from_nat(other)),
845      {Core.checked_observe(shape, after, U32.from_nat(other)) == Core.checked_observe(shape, before, U32.from_nat(other)) : Maybe<&2, F32>},
846      frame(U32.from_nat(other))(prior_checked)(natural_words_different(cursor, other, converted, prior_word, earlier))),
847    Pair.snd(Core.ObservationChecked(Core.Packed{shape, after}, U32.from_nat(other)),
848      {Core.checked_observe(shape, after, U32.from_nat(other)) == Core.checked_observe(shape, before, U32.from_nat(other)) : Maybe<&2, F32>},
849      frame(U32.from_nat(other))(prior_checked)(natural_words_different(cursor, other, converted, prior_word, earlier)))}

Uses (19)

Used by (1)