(** * Injections on X86 cores*)
From mathcomp.ssreflect Require Import ssreflect ssrbool ssrnat ssrfun eqtype seq fintype finfun.
Set Implicit Arguments.
(*NOTE: because of redefinition of [val], these imports must appear after Ssreflect eqtype.*)
Set Bullet Behavior "Strict Subproofs".
(** ** Well defined X86 cores *)
Module X86WD.
Section X86WD.
Variable f: memren.
Definition regset_wd rs : Prop :=
forall r, valid_val f (Pregmap.get r rs).
Definition core_wd c : Prop :=
match c with State rs _ => regset_wd rs end.
Definition ge_wd (the_ge: genv) : Prop :=
(forall b, Maps.PTree.get b (genv_defs the_ge) ->
f b) /\
(forall id ofs v, Senv.symbol_address the_ge id ofs = v ->
valid_val f v).
End X86WD.

Lemma core_wd_domain :
forall f1 f2 m rs
(Hwd: core_wd f1 rs)
(Hdomain1: domain_memren f1 m)
(Hdomain2: domain_memren f2 m),
core_wd f2 rs.