def lt_half

bendtorch-core@0.1.0.0 · src/storage/arith.bend:318

import bendtorch-core@0.1.0.0/src/storage/arith.bend as Arith
import Base
import bendtorch-core@0.1.0.0/src/storage/model.bend as Model

318def lt_half(+b: Bool, +x: Nat, +c: Nat, h: {Nat.is_lt(bit(b, x), Model.capacity(1n+c)) == True{} : Bool}) ->
319  {Nat.is_lt(x, Model.capacity(c)) == True{} : Bool}:
320  match b:
321    case False{}:
322      lt_dd(x, Model.capacity(c), lt_doubled(Nat.double(x), Model.capacity(c), h))
323    case True{}:
324      lt_sd(x, Model.capacity(c), lt_doubled(1n+Nat.double(x), Model.capacity(c), h))

Uses (9)

Used by (1)