def h.split_other

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

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/hmap.bend as M

3138def h.split_other(
3139  ~K: Data, ~V: Data, ~hash: K -> U32, ~eq: K -> K -> Bool,
3140  ~sound: @x: K -> @y: K -> {eq(x, y) == True{} : Bool} -> {x == y : K},
3141  n: Nat, +mask: U32, +o: U32, +es: List<&2, M.Entry<K, V>>, +h2: U32, +k2: K, +k: K, +v: V,
3142  +hs: {Laws.hmap_hashed(~K, ~V, ~hash, es, o) == True{} : Bool},
3143  +nk: {eq(k, k2) == False{} : Bool}
3144) -> {h.G(~K, ~V, ~eq, n, mask, h.S(~K, ~V, ~eq, n, mask, o, es, h2, k2, v), hash(k), k)
3145      == h.R(~K, ~V, ~hash, ~eq, o, es, k) : Maybe<&2, V>}:
3146  match n:
3147    case 0n:
3148      Equal.trans(Maybe<&2, V>, h.EG(~K, ~V, ~eq, M.HMap.entries.put(~K, ~V, ~eq, es, k2, v), k),
3149        h.EG(~K, ~V, ~eq, es, k), h.R(~K, ~V, ~hash, ~eq, o, es, k),
3150        h.eg_put_other(~K, ~V, ~eq, ~sound, es, k2, k, v, nk),
3151        h.r_eg(~K, ~V, ~hash, ~eq, ~sound, o, es, k, hs))
3152    case 1n+(+p):
3153      h.split_other.b(~K, ~V, ~hash, ~eq, ~sound, p, mask, o, es, h2, k2, k, v, hs, nk,
3154        U32.is_eq((o .&. mask : U32), (h2 .&. mask : U32)), U32.is_eq((o .&. mask : U32), 0), {==},
3155        h.split_other(~K, ~V, ~hash, ~eq, ~sound, p, (mask << 1n : U32), o, es, h2, k2, k, v, hs, nk))

Uses (19)

Used by (1)