def cm
import bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire.bend as Lemireimport Base
import bend-collections-laws-math@1.0.0.0/spec/math/random/rand.bend as SR
357# #{x < N : and_bits(w, x, m) == k}
358def cm(+w: Nat, +m: Nat, +k: Nat, N: Nat) -> Nat:
359 match N:
360 case 0n:
361 0n
362 case 1n+ +x:
363 Nat.add(cm(w, m, k, x), b2n(Nat.is_eq(SR.and_bits(w, x, m), k)))
Uses (5)
Used by (7)
- bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire:cm0
- bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire:cm0k
- bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire:count_mask
- bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire:mask
- bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire:pairs
- …