(** ** Properties of shifts *)

(* Specifications: *)
Lemma bits_shl:
forall x y i,
0 <= i < zwordsize ->
testbit (shl x y) i =
if zlt i (unsigned y) then false else testbit x (i - unsigned y).
Lemma bits_shru:
forall x y i,
0 <= i < zwordsize ->
testbit (shru x y) i =
if zlt (i + unsigned y) zwordsize then testbit x (i + unsigned y) else false.
Lemma bits_shr:
forall x y i,
0 <= i < zwordsize ->
testbit (shr x y) i =
testbit x (if zlt (i + unsigned y) zwordsize then i + unsigned y else zwordsize - 1).
Lemma bits_shl:
forall x y i,
0 <= i < zwordsize ->
testbit (shl x y) i =
if zlt i (unsigned y) then false else testbit x (i - unsigned y).
Lemma bits_shru:
forall x y i,
0 <= i < zwordsize ->
testbit (shru x y) i =
if zlt (i + unsigned y) zwordsize then testbit x (i + unsigned y) else false.
Lemma bits_shr:
forall x y i,
0 <= i < zwordsize ->
testbit (shr x y) i =
testbit x (if zlt (i + unsigned y) zwordsize then i + unsigned y else zwordsize - 1).