Module Regmap := EMap(RegEq).
Definition regset := Regmap.t val.
Notation "a ## b" := (List.map a b) (at level 1).
Notation "a # b <- c" := (Regmap.set b c a) (at level 1, b at next level).
Fixpoint undef_regs (rl: list mreg) (rs: regset) {struct rl} : regset :=
match rl with
| nil => rs
| r1 :: rl' => Regmap.set r1 Vundef (undef_regs rl' rs)
end.

Lemma undef_regs_same:
forall r rl rs, In r rl -> undef_regs rl rs r = Vundef.