(** Injections on registers *)

  Definition reg_ren f (r:PregEq.t) (rs rs' : regset) : Prop :=
    val_obs f (Pregmap.get r rs) (Pregmap.get r rs').Definition regset_ren f rs rs' : Prop :=
    forall r, reg_ren f r rs rs'.Definition core_inj f c c' :=
    match c, c' with State rs _, State rs' _ => regset_ren f rs rs' end.

(* Specifications: *)
Lemma get_reg_renC: forall f r rs rs', regset_ren f rs rs' -> rs' r = val_obsC f (rs r).
Lemma get_reg_ren: forall f r rs rs' v, regset_ren f rs rs' -> rs r = v -> exists v', rs' r = v' /\ val_obs f v v'.
Lemma val_obs_reg: forall f r rs rs', regset_ren f rs rs' -> val_obs f (rs r) (rs' r).
Lemma regset_ren_trans: forall f f' f'' rs rs' rs'', regset_ren f rs rs'' -> regset_ren f' rs rs' -> (forall b b' b'' : block, f b = Some b'' -> f' b = Some b' -> f'' b' = Some b'') -> regset_ren f'' rs' rs''.
Lemma regset_ren_id: forall f rs (Hregset_wd: regset_wd f rs) (Hf: forall b1 b2, f b1 = Some b2 -> b1 = b2), regset_ren f rs rs.
Lemma regset_ren_incr: forall f f' rs rs' (Hrs_ren: regset_ren f rs rs') (Hincr: ren_incr f f'), regset_ren f' rs rs'.
Lemma regset_ren_init: forall f v v' (Hval_obs: val_obs f v v'), regset_ren f (Pregmap.init v) (Pregmap.init v').
Lemma regset_ren_set_res: forall f br rs rs' v v' (Hrs_ren: regset_ren f rs rs') (Hval_obs: val_obs f v v'), regset_ren f (set_res br v rs) (set_res br v' rs').
Lemma gso_undef_regs: forall (rs : regset) r regs, ~ List.In r regs -> (undef_regs regs rs) r = rs r.
Lemma valid_val_ge_id: forall fg f b i (Hvalid: valid_val fg (Vptr b i)) (Hincr: ren_incr fg f) (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2), f b = Some b.
Lemma val_obs_symb: forall f fg g id i (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f) (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2), val_obs f (symbol_address g id i) (symbol_address g id i).
Lemma regset_ren_undef: forall f rs rs' regs (Hrs_ren: regset_ren f rs rs'), regset_ren f (undef_regs regs rs) (undef_regs regs rs').
Lemma ge_wd_incr : forall (f f' : memren) (g : genv), ge_wd f g -> ren_domain_incr f f' -> ge_wd f' g.
Lemma ge_wd_domain : forall (f f' : memren) (m : mem) (g : genv), ge_wd f g -> domain_memren f m -> domain_memren f' m -> ge_wd f' g.
Lemma get_extcall_arg_wd : forall f rs m l v (Hm : valid_mem m) (Hdom : domain_memren f m) (Hrs : regset_wd f rs) (Hv : get_extcall_arg rs m l = Some v), valid_val f v.
Lemma get_extcall_arguments_wd : forall f rs m l v (Hm : valid_mem m) (Hdom : domain_memren f m) (Hrs : regset_wd f rs) (Hv : get_extcall_arguments rs m l = Some v), valid_val_list f v.
Lemma at_external_wd : forall the_ge m (f : memren) c (ef : external_function) (args : seq val), valid_mem m -> domain_memren f m -> core_wd f c -> semantics.at_external (Asm_core_sem the_ge) c m = Some (ef, args) -> valid_val_list f args.
Lemma valid_val_hiword: forall f v, valid_val f v -> valid_val f (Val.hiword v).
Lemma valid_val_loword: forall f v, valid_val f v -> valid_val f (Val.loword v).
Lemma after_external_wd : forall the_ge m (c c' : state) (f : memren) (ef : external_function) (args : seq val) (ov : option val) (Hat_external: semantics.at_external (Asm_core_sem the_ge) c m = Some (ef, args)) (Hcore_wd: core_wd f c) (Hvalid_list: valid_val_list f args) (Hafter_external: semantics.after_external (Asm_core_sem the_ge) ov c m = Some c') (Hov: match ov with | Some v => valid_val f v | None => True end), core_wd f c'.
Lemma valid_val_nullptr : forall f, valid_val f Vnullptr.
Lemma make_arg_wd: forall f rs rs' m m' loc arg (Hrs_wd: regset_wd f rs) (Hmem_wd: valid_mem m) (Hdomain: domain_memren f m) (Hvalid_val: valid_val f arg) (Hmake_args: make_arg rs m loc arg = Some (rs', m')), regset_wd f rs' /\ valid_mem m' /\ domain_memren f m'.
Lemma make_arguments_wd: forall f rs rs' m m' loc args (Hrs_wd: regset_wd f rs) (Hmem_wd: valid_mem m) (Hdomain: domain_memren f m) (Hvalid_val: valid_val_list f args) (Hmake_args: make_arguments rs m loc args = Some (rs', m')), regset_wd f rs' /\ valid_mem m' /\ domain_memren f m'.
Lemma mem_valid_alloc: forall m m' b lo hi f (Hdomain: domain_memren f m) (Hvalid_mem: valid_mem m) (Halloc: Mem.alloc m lo hi = (m', b)), valid_mem m' /\ (exists f', ren_domain_incr f f' /\ domain_memren f' m').
Lemma initial_core_wd : forall the_ge m m' (f fg : memren) (vf : val) args (c_new : state) h, valid_mem m -> domain_memren f m -> initial_core (Asm_core_sem the_ge) h m c_new m' vf args -> valid_val_list f args -> ge_wd fg the_ge -> ren_domain_incr fg f -> valid_mem m' /\ (exists f', ren_domain_incr f f' /\ domain_memren f' m') /\ forall f', domain_memren f' m' -> core_wd f' c_new.
Lemma get_extcall_arg_inj : forall f rs rs' m m' l v, regset_ren f rs rs' -> mem_obs_eq f m m' -> get_extcall_arg rs m l = Some v -> exists v', get_extcall_arg rs' m' l = Some v' /\ val_obs f v v'.
Lemma get_extcall_arguments_inj : forall f rs rs' m m' l v, regset_ren f rs rs' -> mem_obs_eq f m m' -> get_extcall_arguments rs m l = Some v -> exists v', get_extcall_arguments rs' m' l = Some v' /\ val_obs_list f v v'.
Lemma get_extcall_arg_inj' : forall f rs rs' m m' l, regset_ren f rs rs' -> mem_obs_eq f m m' -> get_extcall_arg rs m l = None -> get_extcall_arg rs' m' l = None.
Lemma get_extcall_arguments_inj' : forall f rs rs' m m' l, regset_ren f rs rs' -> mem_obs_eq f m m' -> get_extcall_arguments rs m l = None -> get_extcall_arguments rs' m' l = None.
Lemma find_funct_ptr_inj : forall g (f fg : memren) b b' h (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f), find_funct_ptr g b = Some h -> f b = Some b' -> b' = b.
Lemma find_funct_ptr_inj' : forall g (f fg : memren) m m' b b' h (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f) (Hmem : mem_obs_eq f m m'), find_funct_ptr g b' = Some h -> f b = Some b' -> b' = b.
Lemma core_inj_ext : forall the_ge m m' c c' (f fg : memren) (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg the_ge) (Hincr: ren_incr fg f) (Hc : core_wd f c) (Hinj : core_inj f c c') (Hmem : mem_obs_eq f m m'), match semantics.at_external (Asm_core_sem the_ge) c m with | Some (ef, vs) => match semantics.at_external (Asm_core_sem the_ge) c' m' with | Some (ef', vs') => ef = ef' /\ val_obs_list f vs vs' | None => False end | None => match semantics.at_external (Asm_core_sem the_ge) c' m' with | Some _ => False | None => True end end.
Lemma core_inj_after_ext : forall the_ge c cc c' (ov1 : option val) m m' (f fg : memren) (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg the_ge) (Hincr: ren_incr fg f), core_inj f c c' -> mem_obs_eq f m m' -> match ov1 with | Some v1 => valid_val f v1 | None => True end -> semantics.after_external (Asm_core_sem the_ge) ov1 c m = Some cc -> exists (ov2 : option val) (cc' : state), semantics.after_external (Asm_core_sem the_ge) ov2 c' m' = Some cc' /\ core_inj f cc cc' /\ match ov1 with | Some v1 => match ov2 with | Some v2 => val_obs f v1 v2 | None => False end | None => match ov2 with | Some _ => False | None => True end end.
Lemma core_inj_halted : forall the_ge c c' (f : memren), core_inj f c c' -> forall v, halted (Asm_core_sem the_ge) c v <-> halted (Asm_core_sem the_ge) c' v.
Lemma val_obs_inj : forall f v v1 v2, val_obs f v v1 -> val_obs f v v2 -> v1 = v2.
Lemma val_obs_list_inj : forall f v v1 v2, val_obs_list f v v1 -> val_obs_list f v v2 -> v1 = v2.
Lemma make_arg_inj: forall (f : memren) (rs rs1 rs' : regset) (m m1 m' : mem) l (arg arg' : val) (Hrs: regset_ren f rs rs') (Hmem_obs_eq: mem_obs_eq f m m') (Hval_obs_list: val_obs f arg arg') (Hmake: make_arg rs m l arg = Some (rs1, m1)), exists rs1' m1', make_arg rs' m' l arg' = Some (rs1', m1') /\ regset_ren f rs1 rs1' /\ mem_obs_eq f m1 m1'.
Lemma make_arguments_inj: forall (f : memren) (l : seq (rpair Locations.loc)) (rs rs1 rs' : regset) (m m1 m' : mem) (arg arg' : seq val) (Hrs: regset_ren f rs rs') (Hmem_obs_eq: mem_obs_eq f m m') (Hval_obs_list: val_obs_list f arg arg') (Hmake: make_arguments rs m l arg = Some (rs1, m1)), exists rs1' m1', make_arguments rs' m' l arg' = Some (rs1', m1') /\ regset_ren f rs1 rs1' /\ mem_obs_eq f m1 m1'.
Lemma nextblock_storev : forall chunk (m1 : mem) (vptr v : val) (m2 : mem), Mem.storev chunk m1 vptr v = Some m2 -> Mem.nextblock m2 = Mem.nextblock m1.
Lemma core_inj_init : forall the_ge m1 m1' m2 vf vf' arg arg' c_new f fg h (Hge_wd: ge_wd fg the_ge) (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hincr: ren_incr fg f) (Harg: val_obs_list f arg arg') (Hvf: val_obs f vf vf') (Hmem_obs_eq: mem_obs_eq f m1 m1') (Hinit: initial_core (Asm_core_sem the_ge) h m1 c_new m2 vf arg), exists c_new' m2' f', initial_core (Asm_core_sem the_ge) h m1' c_new' m2' vf' arg' /\ core_inj f' c_new c_new' /\ mem_obs_eq f' m2 m2' /\ ren_incr f f' /\ ren_separated f f' m1 m1' /\ ((exists p, ((Mem.nextblock m2 = Mem.nextblock m1 + p)%positive /\ (Mem.nextblock m2' = Mem.nextblock m1' + p)%positive))) /\ (forall b, Mem.valid_block m2' b -> ~ Mem.valid_block m1' b -> let bz := ((Zpos b) - ((Zpos (Mem.nextblock m1')) - (Zpos (Mem.nextblock m1))))%Z in f' (Z.to_pos bz) = Some b /\ f (Z.to_pos bz) = None) /\ (Mem.nextblock m1 = Mem.nextblock m1' -> (forall b1 b2, f b1 = Some b2 -> b1 = b2) -> forall b1 b2, f' b1 = Some b2 -> b1 = b2) /\ (forall b2, (~exists b1, f' b1 = Some b2) -> forall ofs, permissions.permission_at m1' b2 ofs Cur = permissions.permission_at m2' b2 ofs Cur).
Lemma core_inj_id : forall c (f : memren), core_wd f c -> (forall b1 b2 : block, f b1 = Some b2 -> b1 = b2) -> core_inj f c c.
Lemma core_inj_trans : forall c c' c'' (f f' f'' : memren), core_inj f c c'' -> core_inj f' c c' -> (forall b b' b'' : block, f b = Some b'' -> f' b = Some b' -> f'' b' = Some b'') -> core_inj f'' c' c''.
Lemma find_funct_ptr_ren: forall (g : genv) b1 b2 ofs (f fg : memren) fn (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f) (Hobs_eq: val_obs f (Vptr b1 ofs) (Vptr b2 ofs)) (Hget: Genv.find_funct_ptr g b1 = Some fn), b1 = b2.
Lemma symb_val_obs: forall f fg g id ofs (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f), val_obs f (Senv.symbol_address g id ofs) (Senv.symbol_address g id ofs).
Lemma eval_builtin_arg_ren: forall (g : genv) (rs rs' : regset) (f fg: memren) (m m' : mem) (arg : builtin_arg preg) (varg : val) (Hmem_obs_eq: mem_obs_eq f m m') (Hrs_ren: regset_ren f rs rs') (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f) (Heval: eval_builtin_arg g rs (rs RSP) m arg varg), exists varg', eval_builtin_arg g rs' (rs' RSP) m' arg varg' /\ val_obs f varg varg'.
Lemma eval_builtin_args_ren: forall (g : genv) (rs rs' : regset) (f fg: memren) (m m' : mem) (args : seq (builtin_arg preg)) (vargs : seq val) (Hmem_obs_eq: mem_obs_eq f m m') (Hrs_ren: regset_ren f rs rs') (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f) (Heval: eval_builtin_args g rs (rs RSP) m args vargs), exists vargs', eval_builtin_args g rs' (rs' RSP) m' args vargs' /\ val_obs_list f vargs vargs'.
Lemma block_is_volatile_ren: forall g fg f b1 b2 (Hfg: forall b1 b2 : block, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f) (Hf: f b1 = Some b2) (Hinjective: forall b1 b1' b2, f b1 = Some b2 -> f b1' = Some b2 -> b1 = b1') (Hvolatile: Senv.block_is_volatile g b1 = false), Senv.block_is_volatile g b2 = false.
Lemma val_obs_addrmode32: forall f fg g (a : addrmode) rs rs' (Hrs_ren: regset_ren f rs rs') (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f), val_obs f (eval_addrmode32 g a rs) (eval_addrmode32 g a rs').
Lemma val_obs_addrmode64: forall f fg g (a : addrmode) rs rs' (Hrs_ren: regset_ren f rs rs') (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f), val_obs f (eval_addrmode64 g a rs) (eval_addrmode64 g a rs').
Lemma val_obs_addrmode: forall f fg g (a : addrmode) rs rs' (Hrs_ren: regset_ren f rs rs') (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f), val_obs f (eval_addrmode g a rs) (eval_addrmode g a rs').
Lemma compare_ints_ren: forall f v1 v2 v1' v2' rs rs' m m' (Hval_obs: val_obs f v1 v1') (Hval_obs': val_obs f v2 v2') (Hrs_ren: regset_ren f rs rs') (Hmem_obs_eq: mem_obs_eq f m m'), regset_ren f (compare_ints v1 v2 rs m) (compare_ints v1' v2' rs' m').
Lemma compare_longs_ren: forall f v1 v2 v1' v2' rs rs' m m' (Hval_obs: val_obs f v1 v1') (Hval_obs': val_obs f v2 v2') (Hrs_ren: regset_ren f rs rs') (Hmem_obs_eq: mem_obs_eq f m m'), regset_ren f (compare_longs v1 v2 rs m) (compare_longs v1' v2' rs' m').
Lemma compare_floats32_ren: forall f rs rs' v1 v2 v1' v2' (Hval_obs: val_obs f v1 v1') (Hval_obs': val_obs f v2 v2') (Hrs_ren: regset_ren f rs rs'), regset_ren f (compare_floats32 v1 v2 rs) (compare_floats32 v1' v2' rs').
Lemma compare_floats_ren: forall f rs rs' v1 v2 v1' v2' (Hval_obs: val_obs f v1 v1') (Hval_obs': val_obs f v2 v2') (Hrs_ren: regset_ren f rs rs'), regset_ren f (compare_floats v1 v2 rs) (compare_floats v1' v2' rs').
Lemma eval_testcond_ren: forall f (c : testcond) rs rs' (Hrs_ren: regset_ren f rs rs'), eval_testcond c rs = eval_testcond c rs'.
Lemma val_obs_testcond: forall f c rs rs' (Hrs_ren: regset_ren f rs rs'), val_obs f (Val.of_optbool (eval_testcond c rs)) (Val.of_optbool (eval_testcond c rs')).
Lemma exec_instr_ren: forall (g : genv) (fn : function) (i : instruction) (rs rs' rs2: regset) (m m' m2 : mem) (f fg: memren) (Hmem_obs_eq: mem_obs_eq f m m') (Hrs_eq: regset_ren f rs rs') (Hfg: forall b1 b2, fg b1 = Some b2 -> b1 = b2) (Hge_wd: ge_wd fg g) (Hincr: ren_incr fg f) (Hexec: exec_instr g fn i rs m = Next rs2 m2), exists f' rs2' m2', exec_instr g fn i rs' m' = Next rs2' m2' /\ regset_ren f' rs2 rs2' /\ mem_obs_eq f' m2 m2' /\ ren_incr f f' /\ ren_separated f f' m m' /\ ((exists p : positive, Mem.nextblock m2 = (Mem.nextblock m + p)%positive /\ Mem.nextblock m2' = (Mem.nextblock m' + p)%positive) \/ Mem.nextblock m2 = Mem.nextblock m /\ Mem.nextblock m2' = Mem.nextblock m') /\ (forall b0 : block, Mem.valid_block m2' b0 -> ~ Mem.valid_block m' b0 -> f' (Z.to_pos match (- Z.pos_sub (Mem.nextblock m') (Mem.nextblock m))%Z with | 0%Z => Z.pos b0 | Z.pos y' => Z.pos (b0 + y') | Z.neg y' => Z.pos_sub b0 y' end) = Some b0 /\ f (Z.to_pos match (- Z.pos_sub (Mem.nextblock m') (Mem.nextblock m))%Z with | 0%Z => Z.pos b0 | Z.pos y' => Z.pos (b0 + y') | Z.neg y' => Z.pos_sub b0 y' end) = None) /\ (Mem.nextblock m = Mem.nextblock m' -> (forall b1 b3 : block, f b1 = Some b3 -> b1 = b3) -> forall b1 b0 : block, f' b1 = Some b0 -> b1 = b0) /\ (forall b2 : block, ~ (exists b1 : block, f' b1 = Some b2) -> forall ofs : Z, permissions.permission_at m' b2 ofs Cur = permissions.permission_at m2' b2 ofs Cur).
Lemma extcall_arg_reg: forall f rs rs' m m' locs arg (Hrs_ren: regset_ren f rs rs') (Hobs_eq: mem_obs_eq f m m') (Harg: extcall_arg rs m locs arg), exists arg', extcall_arg rs' m' locs arg' /\ val_obs f arg arg'.
Lemma extcall_arg_pair_ren: forall f rs rs' m m' locs arg (Hrs_ren: regset_ren f rs rs') (Hobs_eq: mem_obs_eq f m m') (Harg: extcall_arg_pair rs m locs arg), exists arg', extcall_arg_pair rs' m' locs arg' /\ val_obs f arg arg'.
Lemma extcall_arguments_ren: forall f m m' ef args rs rs' (Hexternal: extcall_arguments rs m (ef_sig ef) args) (Hmem_obs_eq: mem_obs_eq f m m') (Hrs_ren: regset_ren f rs rs'), exists args', extcall_arguments rs' m' (ef_sig ef) args' /\ val_obs_list f args args'.
Lemma core_inj_wd: forall f c c', core_inj f c c' -> core_wd f c.
Lemma corestep_obs_eq: forall the_ge (Hsafe : safe_genv the_ge) (cc cf cc' : state) (mc mf mc' : mem) f fg, mem_obs_eq f mc mf -> core_inj f cc cf -> (forall b1 b2, fg b1 = Some b2 -> b1 = b2) -> ge_wd fg the_ge -> ren_incr fg f -> corestep (Asm_core_sem the_ge) cc mc cc' mc' -> exists (cf' : state) (mf' : mem) (f' : Renamings.memren), corestep (Asm_core_sem the_ge) cf mf cf' mf' /\ core_inj f' cc' cf' /\ mem_obs_eq f' mc' mf' /\ ren_incr f f' /\ ren_separated f f' mc mf /\ ((exists p : positive, Mem.nextblock mc' = (Mem.nextblock mc + p)%positive /\ Mem.nextblock mf' = (Mem.nextblock mf + p)%positive) \/ Mem.nextblock mc' = Mem.nextblock mc /\ Mem.nextblock mf' = Mem.nextblock mf) /\ (forall b : block, Mem.valid_block mf' b -> ~ Mem.valid_block mf b -> let bz := (Z.pos b - (Z.pos (Mem.nextblock mf) - Z.pos (Mem.nextblock mc)))%Z in f' (Z.to_pos bz) = Some b /\ f (Z.to_pos bz) = None) /\ (Mem.nextblock mc = Mem.nextblock mf -> (forall b1 b2 : block, f b1 = Some b2 -> b1 = b2) -> forall b1 b2 : block, f' b1 = Some b2 -> b1 = b2) /\ (forall b2 : block, ~ (exists b1 : block, f' b1 = Some b2) -> forall ofs : Z, permissions.permission_at mf b2 ofs Cur = permissions.permission_at mf' b2 ofs Cur).
Lemma extcall_arg_valid: forall f rs m locs arg (Hrs_wd: regset_wd f rs) (Hmem_wd : valid_mem m) (Hobs_eq: domain_memren f m) (Harg: extcall_arg rs m locs arg), valid_val f arg.
Lemma valid_val_longofwords: forall f hi lo, valid_val f hi -> valid_val f lo -> valid_val f (Val.longofwords hi lo).
Lemma extcall_arg_pair_valid: forall f rs m locs arg (Hrs_wd: regset_wd f rs) (Hmem_wd : valid_mem m) (Hobs_eq: domain_memren f m) (Harg: extcall_arg_pair rs m locs arg), valid_val f arg.
Lemma extcall_arguments_valid: forall f m ef args rs (Hexternal: extcall_arguments rs m (ef_sig ef) args) (Hrs_wd: regset_wd f rs) (Hmem_wd : valid_mem m) (Hobs_eq: domain_memren f m), valid_val_list f args.
Lemma free_wd_domain : forall (m m' : mem) b lo hi (f : memren), domain_memren f m -> Mem.free m b lo hi = Some m' -> valid_mem m -> valid_mem m' /\ domain_memren f m'.
Lemma exec_instr_wd: forall (g : genv) (fn : function) (i : instruction) (rs rs': regset) (m m' : mem) (f fg: memren) loader (Hmem_wd: valid_mem m) (Hrs_wd: regset_wd f rs) (Hge_wd: ge_wd fg g) (Hincr: ren_domain_incr fg f) (Hdomain: domain_memren f m) (Hexec: exec_instr g fn i rs m = Next rs' m'), valid_mem m' /\ (exists f' : memren, ren_domain_incr f f' /\ domain_memren f' m') /\ (forall f' : memren, domain_memren f' m' -> core_wd f' (State rs' loader)).
Lemma corestep_wd: forall the_ge (Hsafe : safe_genv the_ge) c m c' m' f fg (Hwd: core_wd f c) (Hmem_wd: valid_mem m) (Hge_wd: ge_wd fg the_ge) (Hincr: ren_domain_incr fg f) (Hdomain: domain_memren f m) (Hcorestep: corestep (Asm_core_sem the_ge) c m c' m'), valid_mem m' /\ (exists f', ren_domain_incr f f' /\ domain_memren f' m') /\ forall f', domain_memren f' m' -> core_wd f' c'.