WORD_SHIFT_ss : ssfrag
STRUCTURE
SYNOPSIS
Simplification fragment for words.
DESCRIPTION
The fragment WORD_SHIFT_ss does some basic simplifications for the operations: << (left shift), >> (arithmetic right shift), >>> (logical right shift), #>> (rotate right) and #<< (rotate left). More simplification is possible when used in combination with wordsLib.SIZES_ss.
EXAMPLE
- SIMP_CONV (std_ss++WORD_SHIFT_ss) [] ``a << 2 << 3 + a >> 3 >> 2 + a >>> 1 >>> 2 + a #<< 1 #<< 2``
<<HOL message: inventing new type variable names: 'a>>
> val it =
    |- a << 2 << 3 + a >> 3 >> 2 + a >>> 1 >>> 2 + a #<< 1 #<< 2 =
       a << 5 + a >> 5 + a >>> 3 + a #<< 3 : thm

- SIMP_CONV (std_ss++WORD_SHIFT_ss) [] ``a >> 0 + 0w << n + a #<< 2 #>> 2``
<<HOL message: inventing new type variable names: 'a>>
> val it = |- a >> 0 + 0w << n + a #<< 2 #>> 2 = a + 0w + a : thm

More simplification is possible when the word length is known.

- SIMP_CONV (std_ss++SIZES_ss++WORD_SHIFT_ss) [] ``a << 4 + (a #<< 6) : word4``
> val it = |- a << 4 = 0w + a #<< 2 : thm
COMMENTS
When the word length is known the fragment WORD_ss simplifies #<< to #>>.
SEEALSO
HOL  Kananaskis-11