def glue.bnd

bend-kit-collections@0.1.4.1 · PROOF.bend:1149

import bend-kit-collections@0.1.4.1/PROOF.bend as PROOF
import Base
import bend-kit-collections@0.1.4.1/LAWS.bend as Laws
import bend-kit-collections@0.1.4.1/omap.bend as O

1149def glue.bnd(
1150  ~K: Data, ~V: Data, ~cmp: K -> K -> Cmp, ~trans: Trans(~K, ~cmp),
1151  hi: O.OMap<K, V>, +lo: O.OMap<K, V>, +lb: Maybe<&2, K>, +ub: Maybe<&2, K>,
1152  +key: K,
1153  eka: {Laws.above(~K, ~cmp, lb, key) == True{} : Bool},
1154  ekb: {Laws.below(~K, ~cmp, ub, key) == True{} : Bool},
1155  el: {Laws.bounded(~K, ~V, ~cmp, lo, lb, Some{key}) == True{} : Bool},
1156  eh: {Laws.bounded(~K, ~V, ~cmp, hi, Some{key}, ub) == True{} : Bool}
1157) -> {Laws.bounded(~K, ~V, ~cmp, O.OMap.glue(K, V, lo, hi), lb, ub) == True{} : Bool}:
1158  match hi:
1159    case O.OTip{}:
1160      weaken_hi(~K, ~V, ~cmp, ~trans, lo, lb, key, ub, el, ekb)
1161    case O.OBin{s, +k, +v, +hl, +hh}:
1162      glue.fin.bnd(~K, ~V, ~cmp, ~trans, O.OMap.pop_min(K, V, hl, k, v, hh), lo, lb, ub, key,
1163        eka, el, pm.bnd(~K, ~V, ~cmp, ~trans, hl, Some{key}, ub, k, v, hh, eh))

Uses (13)

Used by (1)