def bucket_le

bend-collections-laws-math@1.0.0.0 · proofs/math/hash/hash.bend:45

import bend-collections-laws-math@1.0.0.0/proofs/math/hash/hash.bend as Hash
import Base
import bend-collections-laws-math@1.0.0.0/src/math/hash.bend as HS
import bend-collections-laws-math@1.0.0.0/proofs/lib/u32div.bend as UD

45# THEOREM: a bucket never exceeds the mask.
46def bucket_le(+w: U32, +mask: U32) -> {Nat.is_le(UD.v(HS.bucket(w, mask)), UD.v(mask)) == True{} : Bool}:
47  and_le32(U32.xor(U32.mul(w, HS.phi32()), U32.shrn(U32.mul(w, HS.phi32()), 16n)), mask)

Uses (10)

Used by (1)