def below_front

bendtorch-core@0.1.0.0 · src/autograd/reduce_replayed_proof.bend:422

import bendtorch-core@0.1.0.0/src/autograd/reduce_replayed_proof.bend as ReduceReplayedProof
import Base
import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
import bendtorch-core@0.1.0.0/src/autograd/reduce_parallel_proof.bend as ReduceParallel

422def below_front(+xs: List<&2, Nat>, +ys: List<&2, Nat>, +bound: Nat,
423  +h: {ReduceParallel.all_below(List.append(&2, Nat, xs, ys), bound) == True{} : Bool}) ->
424  {ReduceParallel.all_below(xs, bound) == True{} : Bool}:
425  match xs:
426    case Nil{}:
427      {==}
428    case +x <> +rest:
429      +here = Arith.and_left(Nat.is_lt(x, bound), ReduceParallel.all_below(List.append(&2, Nat, rest, ys), bound), h)
430      +later = Arith.and_right(Nat.is_lt(x, bound), ReduceParallel.all_below(List.append(&2, Nat, rest, ys), bound), h)
431      %Equal.sym(Bool, Nat.is_lt(x, bound), True{}, here) : {Bool.and(_, ReduceParallel.all_below(rest, bound)) == True{} : Bool}
432      below_front(rest, ys, bound, later)

Uses (10)

Used by (1)