Definition xor (v w: aval) :=
match v, w with
| I i1, I i2 => I (Int.xor i1 i2)
| I i, Uns p n | Uns p n, I i => uns p (Z.max n (usize i))
| Uns p1 n1, Uns p2 n2 => uns (plub p1 p2) (Z.max n1 n2)
| Sgn p1 n1, Sgn p2 n2 => sgn (plub p1 p2) (Z.max n1 n2)
| _, _ => ntop2 v w
end.

(* Specifications: *)
Lemma xor_sound:
forall v w x y, vmatch v x -> vmatch w y -> vmatch (Val.xor v w) (xor x y).