def ones

bend-collections-laws-math@1.0.0.0 · proofs/lib/word.bend:181

import bend-collections-laws-math@1.0.0.0/proofs/lib/word.bend as Word
import Base

181# every bit set
182def ones(+n: Nat, w: Word(n)) -> Bool:
183  match n w:
184    case 0n WNil{}:
185      True{}
186    case 1n+p WCon{x, t}:
187      Bool.and(x, ones(p, t))

Uses (6)

Used by (4)