(** A compilation environment (mapping) is valid in a given state if
  the registers associated with Cminor local variables and let-bound variables
  are valid in the state. *)

Definition map_valid (m: mapping) (s: state) : Prop :=
  forall r, reg_in_map m r -> reg_valid r s.

Lemma add_letvar_valid: forall map s r, map_valid map s -> reg_valid r s -> map_valid (add_letvar map r) s.