def h.eg_none_hashed.c

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

import bend-kit-collections@0.1.4.1/PROOF.bend as PROOF
import Base
import bend-kit-collections@0.1.4.1/hmap.bend as M

2146# A bucket whose keys all hash to o holds no key hashing elsewhere.
2147def h.eg_none_hashed.c(
2148  ~K: Data, ~V: Data, ~hash: K -> U32, ~eq: K -> K -> Bool,
2149  ~sound: @x: K -> @y: K -> {eq(x, y) == True{} : Bool} -> {x == y : K},
2150  +key: K, +val: V, +rest: List<&2, M.Entry<K, V>>, +o: U32, +k: K,
2151  hk: {U32.is_eq(o, hash(k)) == False{} : Bool}, hh: {U32.is_eq(o, hash(key)) == True{} : Bool},
2152  b: Bool, eb: {b == eq(k, key) : Bool},
2153  ih: {M.HMap.entries.get(~K, ~V, ~eq, rest, k) == None{} : Maybe<&2, V>}
2154) -> {h.egc(~K, ~V, ~eq, b, val, rest, k) == None{} : Maybe<&2, V>}:
2155  match b:
2156    case True{}:
2157      h.tf({h.egc(~K, ~V, ~eq, True{}, val, rest, k) == None{} : Maybe<&2, V>}, U32.is_eq(o, hash(k)),
2158        rw(K, z => {U32.is_eq(o, hash(z)) == True{} : Bool}, k, key,
2159          sound(k, key, h.sb(True{}, eq(k, key), eb)), hh),
2160        hk)
2161    case False{}:
2162      ih

Uses (11)

Used by (1)