def mask_pow2u

bend-collections-laws-math@1.0.0.0 · proofs/lib/u32.bend:273

import bend-collections-laws-math@1.0.0.0/proofs/lib/u32.bend as U32
import Base
import bend-collections-laws-math@1.0.0.0/spec/lib/common.bend as SC

273def mask_pow2u(+x: U32, +d: Nat, +hd: {Nat.is_lt(d, 32n) == True{} : Bool}, +hx: {Nat.is_lt(U32.to_nat(x), SC.pow2(d)) == True{} : Bool}) -> {U32.and(x, U32.sub(pow2u(d), 1)) == x : U32}:
274  mask_word(x, U32.sub(pow2u(d), 1), d,
275    Equal.trans(Nat, U32.to_nat(U32.sub(pow2u(d), 1)), Nat.sub(U32.to_nat(pow2u(d)), 1n), Nat.sub(SC.pow2(d), 1n),
276      sub_nat(pow2u(d), 1, one_le_pow2u(d, hd)),
277      Equal.cong(Nat, Nat, v => Nat.sub(v, 1n), U32.to_nat(pow2u(d)), SC.pow2(d), pow2u_value(d, hd))),
278    hx)

Uses (16)

Used by (0)

No other definition uses this definition.