(** * Agreement between Mach registers and processor registers *)
Record agree (ms: Mach.regset) (sp: val) (rs: Asm.regset) : Prop := mkagree {
agree_sp: rs#SP = sp;
agree_sp_def: sp <> Vundef;
agree_mregs: forall r: mreg, Val.lessdef (ms r) (rs#(preg_of r))
}.

(* Specifications: *)
Lemma preg_val:
forall ms sp rs r, agree ms sp rs -> Val.lessdef (ms r) rs#(preg_of r).
Lemma preg_vals:
forall ms sp rs, agree ms sp rs ->
forall l, Val.lessdef_list (map ms l) (map rs (map preg_of l)).
Lemma sp_val:
forall ms sp rs, agree ms sp rs -> sp = rs#SP.
Lemma ireg_val:
forall ms sp rs r r',
agree ms sp rs ->
ireg_of r = OK r' ->
Val.lessdef (ms r) rs#r'.
Lemma freg_val:
forall ms sp rs r r',
agree ms sp rs ->
freg_of r = OK r' ->
Val.lessdef (ms r) (rs#r').
Lemma agree_exten:
forall ms sp rs rs',
agree ms sp rs ->
(forall r, data_preg r = true -> rs'#r = rs#r) ->
agree ms sp rs'.