Section SHIFT_AMOUNT.
Variable l: Z.
Hypothesis l_range: 0 <= l < 32.
Variable N: int.
Hypothesis N_eq: Int.unsigned N = two_p l.
Remark mk_amount_range:
forall n, Int.ltu (Int.zero_ext l n) N = true.
Remark mk_amount_eq:
forall n, Int.ltu n N = true -> Int.zero_ext l n = n.
End SHIFT_AMOUNT.
Program Definition mk_amount32 (n: int): amount32 :=
{| a32_amount := Int.zero_ext 5 n |}.
Next Obligation.
apply mk_amount_range. omega. reflexivity.
Qed.
Program Definition mk_amount64 (n: int): amount64 :=
{| a64_amount := Int.zero_ext 6 n |}.
Next Obligation.
apply mk_amount_range. omega. reflexivity.
Qed.
(** Recognition of move operations. *)
Definition is_move_operation
(A: Type) (op: operation) (args: list A) : option A :=
match op, args with
| Omove, arg :: nil => Some arg
| _, _ => None
end.

Lemma is_move_operation_correct:
forall (A: Type) (op: operation) (args: list A) (a: A),
is_move_operation op args = Some a ->
op = Omove /\ args = a :: nil.