def bs.below

bend-osdev-algo@0.1.0.0 · PROOF.bend:1111

import bend-osdev-algo@0.1.0.0/PROOF.bend as PROOF
import Base
import bend-osdev-algo@0.1.0.0/bsearch.bend as S

1111def bs.below(xs: List<&2, U32>, +key: U32, i: Nat, +x: U32, e: {List.get(&2, U32, xs, i) == Some{x} : Maybe<&2, U32>}, l: {Nat.is_lt(i, S.bsearch.lower_bound(xs, key)) == True{} : Bool}) -> {U32.is_lt(x, key) == True{} : Bool}:
1112  match xs i:
1113    case Nil{} _:
1114      Empty.absurd({U32.is_lt(x, key) == True{} : Bool}, absurd.ns32(x, e))
1115    case Con{+x0, t} 0n:
1116      %some_inj32(x0, x, e) : {U32.is_lt(_, key) == True{} : Bool}
1117      bs.step0(U32.is_lt(x0, key), S.bsearch.lower_bound(t, key), l)
1118    case Con{+x0, +t} 1n+ +ip:
1119      bs.below(t, key, ip, x, e, bs.step1(U32.is_lt(x0, key), S.bsearch.lower_bound(t, key), ip, l))

Uses (14)

Used by (2)