def native_word_mask

stelliferous@0.0.2.0 · proofs/word_power_of_two.bend:155

import stelliferous@0.0.2.0/proofs/word_power_of_two.bend as WordPowerOfTwo
import Base

155def native_word_mask(+depth: Nat,+word: Word(32n),bound: {Cmp.is_lt(Word.cmp(32n,word,power(32n,
156        depth))) == True{} : Bool}) -> {U32.and(U32{word},U32.sub(U32{power(32n,depth)},1)) == U32{word} : U32}:
157  %Equal.sym(Word(32n),Word.sub(32n,power(32n,depth),power(32n,0n)),mask(32n,depth),Equal.trans(Word(32n),Word.sub(32n,power(32n,depth),
158        power(32n,0n)),Word.adc(32n,power(32n,depth),Word.zero(32n),True{},False{}),mask(32n,depth),subtract_one(32n,power(32n,depth)),
159      decrement_power(32n,depth))) : {U32{Word.and(32n,word,_)} == U32{word} : U32}
160  Equal.cong(Word(32n),U32,w => U32{w},Word.and(32n,word,mask(32n,depth)),word,mask_preserves_bounded(32n,depth,word,bound))

Uses (20)

Used by (1)