Section X86CoreErasure.
Variable the_program: Asm.program.
Variable Hsafe : Asm_core.safe_genv (@the_ge the_program).
Instance X86Sem : Semantics := @X86Context.X86Sem the_program Hsafe.
Definition reg_erasure (r:PregEq.t) (rs rs' : regset) : Prop :=
val_erasure (Pregmap.get r rs) (Pregmap.get r rs').
Definition regs_erasure rs rs' : Prop :=
forall r, reg_erasure r rs rs'.
Definition core_erasure c c' :=
match c, c' with
| State rs  _, State rs' _ =>
regs_erasure rs rs'
end.
(* Definition erasedPerm c := *)
(*   match c with *)
(*   | State _ mem => *)
(*     forall (b : block) (ofs : Z) (k : perm_kind), *)
(*       Mem.valid_block mem b -> (Mem.mem_access mem) !! b ofs k = Some Freeable *)
(*   end. *)
Proof with eauto with val_erasure.
intros rs r;
unfold reg_erasure...
Qed.
Hint Immediate regs_erasure_refl : regs_erasure.
Hint Immediate val_erasure_list_refl : val_erasure.
Proof with eauto with val_erasure regs_erasure.
destruct c; simpl.
repeat split...
Qed.
Hint Immediate core_erasure_refl: regs_erasure.
Hint Resolve regs_erasure_get regs_erasure_refl regs_erasure_set
: regs_erasure.
Notation the_ge := (@the_ge the_program).
(** ** Result about at_external, after_external and initial_core *)

Lemma erasure_initial_core:
forall h v arg v' arg' c m m' m2
(Hv: val_erasure v v')
(Harg: val_erasure arg arg')
(Hmem: mem_erasure m m')
(Hinit: initial_core semSem h m c m2 v [:: arg]),
exists c' m2',
initial_core semSem h m' c' m2' v' [:: arg'] /\
core_erasure c c' /\
mem_erasure m2 (erasePerm m2').