def cm

bend-collections-laws-math@1.0.0.0 · proofs/math/random/lemire.bend:357

import bend-collections-laws-math@1.0.0.0/proofs/math/random/lemire.bend as Lemire
import 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)