Module ConcurCC_correct:= (Concurrent_correctness CC_correct Args).
(*USed to be start_stack*)
Definition Clight_init_state (p: Clight.program):=
Clight.initial_state p.
Definition Asm_init_state (p: Asm.program):=
Asm.initial_state  p.
Notation valid Sem:=
(valid dryResources Sem OrdinalPool.OrdinalThreadPool).
Definition opt_init_mem_source (p : Clight.program):=
(Genv.init_mem (Ctypes.program_of_program p)).
Definition opt_init_mem_target {F V} (tp:AST.program F V ):=
(Genv.init_mem tp).

(** for the initial state, it's enough to prove csafety for the valid schedules, we can derive safety for all others. *)
Lemma initial_csafe_all_schedule:
forall  prog asm_genv_safety tr c m r,
let SemTarget:= @X86Sem prog asm_genv_safety in
let tp:=OrdinalPool.mkPool (Krun c) r in
(forall U (n : nat),
(valid SemTarget) (tr, tp, m) U ->
HybridCoarseMachine.csafe
(ThreadPool:=threadPool.OrdinalPool.OrdinalThreadPool(Sem:=SemTarget))
(machineSig:= HybridMachine.DryHybridMachine.DryHybridMachineSig)
(U, nil,
OrdinalPool.mkPool
(Krun c) r) m n)  ->
forall U (n : nat),
HybridCoarseMachine.csafe
(ThreadPool:=threadPool.OrdinalPool.OrdinalThreadPool(Sem:=SemTarget))
(machineSig:= HybridMachine.DryHybridMachine.DryHybridMachineSig)
(U, nil,
OrdinalPool.mkPool (Krun c) r) m n.