def weaken_hi

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

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

1043# A tree bounded above by a is bounded above by anything above a.
1044def weaken_hi(
1045  ~K: Data, ~V: Data, ~cmp: K -> K -> Cmp, ~trans: Trans(~K, ~cmp),
1046  t: O.OMap<K, V>, +lb: Maybe<&2, K>, +a: K, +ub: Maybe<&2, K>,
1047  +e: {Laws.bounded(~K, ~V, ~cmp, t, lb, Some{a}) == True{} : Bool},
1048  +eab: {Laws.below(~K, ~cmp, ub, a) == True{} : Bool}
1049) -> {Laws.bounded(~K, ~V, ~cmp, t, lb, ub) == True{} : Bool}:
1050  match t:
1051    case O.OTip{}:
1052      {==}
1053    case O.OBin{s, +k, +v, +lo, +hi}:
1054      bn.i(~K, ~V, ~cmp, lb, ub, k, v, lo, hi,
1055        bn.a(~K, ~V, ~cmp, lb, Some{a}, k, v, lo, hi, e),
1056        below_trans(~K, ~cmp, ~trans, ub, k, a,
1057          bn.b(~K, ~V, ~cmp, lb, Some{a}, k, v, lo, hi, e), eab),
1058        bn.l(~K, ~V, ~cmp, lb, Some{a}, k, v, lo, hi, e),
1059        weaken_hi(~K, ~V, ~cmp, ~trans, hi, Some{k}, a, ub,
1060          bn.h(~K, ~V, ~cmp, lb, Some{a}, k, v, lo, hi, e), eab))

Uses (13)

Used by (2)