Definition sign_ext (n: Z) (x: nval) :=
match x with
| Nothing => Nothing
| I m => I (Int.or (Int.zero_ext n m) (Int.shl Int.one (Int.repr (n - 1))))
| All => I (Int.zero_ext n Int.mone)
end.

(* Specifications: *)
Lemma sign_ext_sound:
forall v w x n,
vagree v w (sign_ext n x) ->
0 < n < Int.zwordsize ->
vagree (Val.sign_ext n v) (Val.sign_ext n w) x.