Set Implicit Arguments.
(*Open Scope Z.*)
Set Implicit Arguments.
Definition is_true (b: bool) :=
match b with true => True | false => False end.
Definition force_val (v: option val) : val :=
match v with Some v' => v' | None => Vundef end.
Definition force_val1 (f: val -> option val) (v: val) := force_val (f v).
Definition force_val2 (f: val -> val -> option val) (v1 v2: val) := force_val (f v1 v2).
Arguments force_val1 f v /.
Arguments force_val2 f v1 v2 /.
Definition force_int (v: val) :=
match v with
| Vint i => i | _ => Int.zero
end.
Arguments force_int !v / .
Definition force_signed_int v := Int.signed (force_int v).
Arguments force_signed_int !v / .

(* Specifications: *)
Lemma force_Vint:  forall i, force_int (Vint i) = i.
Unset Implicit Arguments.
Lemma testbit_signed_neg:
forall i j n,
- two_p n <= Int.signed i < 0 ->
0 <= n <= j ->
j < Int.zwordsize ->
Int.testbit i j = true.
Lemma sign_ext_inrange:
forall n i, - two_p (n-1) <= Int.signed i <= two_p (n-1) - 1 ->
Int.sign_ext n i = i.
Lemma zero_ext_inrange:
forall n i, Int.unsigned i <= two_p n - 1 ->
Int.zero_ext n i = i.