(** ** Locations *)
(** Locations are just the disjoint union of machine registers and activation record slots. *)
Inductive loc : Type :=
| R (r: mreg)
| S (sl: slot) (pos: Z) (ty: typ).
Module Loc.
Definition type (l: loc) : typ :=
match l with
| R r => mreg_type r
| S sl pos ty => ty
end.

(* Specifications: *)
Lemma eq: forall (p q: loc), {p = q} + {p <> q}.
Lemma diff_not_eq:
forall l1 l2, diff l1 l2 -> l1 <> l2.
Lemma diff_sym:
forall l1 l2, diff l1 l2 -> diff l2 l1.