(** 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 alloc_regs_valid: forall al s1 s2 map rl i, map_valid map s1 -> alloc_regs map al s1 = OK rl s2 i -> regs_valid rl s2.