def append_snoc

bendtorch-core@0.1.0.0 · src/tensor/contracts/pointwise_proof.bend:23

import bendtorch-core@0.1.0.0/src/tensor/contracts/pointwise_proof.bend as PointwiseProof
import Base
import bendtorch-core@0.1.0.0/src/storage/LAWS.bend as StorageLaws
import bendtorch-core@0.1.0.0/src/tensor/contracts/replayed.bend as Replayed

23def append_snoc(+ops: List<&2, StorageLaws.Op>, +more: List<&2, StorageLaws.Op>, +last: StorageLaws.Op) ->
24  {List.append(&2, StorageLaws.Op, ops, Replayed.snoc(more, last)) ==
25    Replayed.snoc(List.append(&2, StorageLaws.Op, ops, more), last) : List<&2, StorageLaws.Op>}:
26  match ops:
27    case Nil{}:
28      {==}
29    case +op <> +rest:
30      Equal.cong(List<&2, StorageLaws.Op>, List<&2, StorageLaws.Op>, tail => op <> tail,
31        List.append(&2, StorageLaws.Op, rest, Replayed.snoc(more, last)),
32        Replayed.snoc(List.append(&2, StorageLaws.Op, rest, more), last), append_snoc(rest, more, last))

Uses (5)

Used by (4)