Skip to main content

lemma_u16_setbit_bit_unchanged

Function lemma_u16_setbit_bit_unchanged 

Source
pub broadcast proof fn lemma_u16_setbit_bit_unchanged(word: u16, b: int, b2: int)
Expand description
requires
0 <= b < 16,
0 <= b2 < 16,
b != b2,
ensures
u16_bit_is_set(word | (1u16 << (b as usize)), b2) == u16_bit_is_set(word, b2),

Setting bit b leaves a different in-range bit b2 unchanged.