(** ** Properties of [agree_locs] *)
(** Preservation under assignment of machine register. *)

(* Specifications: *)
Lemma agree_locs_set_reg:
forall ls ls0 r v,
agree_locs ls ls0 ->
mreg_within_bounds b r ->
agree_locs (Locmap.set (R r) v ls) ls0.
Lemma caller_save_reg_within_bounds:
forall r,
is_callee_save r = false -> mreg_within_bounds b r.
Lemma agree_locs_set_pair:
forall ls0 p v ls,
agree_locs ls ls0 ->
forall_rpair (fun r => is_callee_save r = false) p ->
agree_locs (Locmap.setpair p v ls) ls0.
Lemma agree_locs_set_res:
forall ls0 res v ls,
agree_locs ls ls0 ->
(forall r, In r (params_of_builtin_res res) -> mreg_within_bounds b r) ->
agree_locs (Locmap.setres res v ls) ls0.
Lemma agree_locs_undef_regs:
forall ls0 regs ls,
agree_locs ls ls0 ->
(forall r, In r regs -> mreg_within_bounds b r) ->
agree_locs (LTL.undef_regs regs ls) ls0.
Lemma agree_locs_undef_locs_1:
forall ls0 regs ls,
agree_locs ls ls0 ->
(forall r, In r regs -> is_callee_save r = false) ->
agree_locs (LTL.undef_regs regs ls) ls0.
Lemma agree_locs_undef_locs:
forall ls0 regs ls,
agree_locs ls ls0 ->
existsb is_callee_save regs = false ->
agree_locs (LTL.undef_regs regs ls) ls0.