(** * Instantiating the dry and bare machine for X86*)
Set Bullet Behavior "None".
Set Bullet Behavior "Strict Subproofs".
Module X86Context.
Section X86Context.
Context {the_program: Asm.program}.
Definition the_ge := Globalenvs.Genv.globalenv the_program.
Context {Hsafe : safe_genv the_ge}.
Instance X86Sem: Semantics:=
{ semG:= Asm.genv;
semC:= Asm.state;
semSem:= Asm_EvSem the_ge Hsafe;
the_ge := the_ge
}.
(*Import the Asm Hybrid Machine*)
(** *Coarse Asm Machine*)
Definition AsmHybridMachine    := @dryCoarseMach X86Sem.
Definition AsmConcurSem    := HybridMachineSig.HybridMachineSig.ConcurMachineSemantics
(HybridMachine:= AsmHybridMachine).
(** *Fine Asm Machine*)
Definition AsmFineHybridMachine    := @dryFineMach X86Sem.
Definition AsmFineConcurSem    := HybridMachineSig.HybridMachineSig.ConcurMachineSemantics
(HybridMachine:= AsmFineHybridMachine).
(** The initial state There are three, but all should be equivalent. *)
Definition Asm_initial_state := tpc_init(asmSem:=X86Sem).
Definition Asm_initial_state_fine := tpf_init(asmSem:=X86Sem).
Definition Asm_initial_state_bare := bare_init(asmSem:=X86Sem).
End X86Context.
End X86Context.
Module X86SEMAxioms.
X86Context Memory.
Section X86Context.
Context {initU: seq.seq nat}
{the_program: Asm.program}.
Notation the_ge := (@the_ge the_program).
Context {Hsafe : safe_genv the_ge}.
Instance X86Sem: Semantics := @X86Sem the_program Hsafe.

Lemma initial_core_unchanged_on :
forall (i : nat) (v : Values.val) (args : list Values.val) (c : semC) (m m' : mem) (b : Values.block) (ofs : Z),
initial_core semSem i m c m' v args ->
Mem.valid_block m b -> ~ Mem.perm m b ofs Cur Writable -> ZMap.get ofs (Mem.mem_contents m) !! b = ZMap.get ofs (Mem.mem_contents m') !! b /\
forall k, permission_at m b ofs k = permission_at m' b ofs k.