Section TrivialSimulations.
Definition lift_state {resources Sem1 Sem2}
(f: @semC Sem1 -> @semC Sem2):
@OrdinalPool.t resources Sem1 ->
@OrdinalPool.t resources Sem2.
intros X; inv X.
econstructor; eauto.
intros h; specialize (pool h).
inv pool; [econstructor 1|
econstructor 2|
econstructor 3|
econstructor 4]; eauto.
Defined.
Definition lift_c_state:
@OrdinalPool.t dryResources (@ClightMachine.DMS.DSem Clight_g) ->
@OrdinalPool.t dryResources (HybridSem (@Some nat O)).
Admitted.
Notation scheduler:=HybridMachineSig.HybridMachineSig.HybridCoarseMachine.scheduler.
Local Ltac cat_find_and_replace_nil:=
match goal with
| [H: ?t = ?t ++ ?x |- _ ] =>
eapply threads_lemmas.app_eq_refl_nil in H;
subst x; try rewrite app_nil_r in *
| [H: seq.cat ?t ?y = ?t ++ ?x |- _ ] =>
rewrite Coqlib3.cat_app in H;
apply app_inv_head in H; subst x
end.

Lemma external_step_anytrace:
forall U U' tr1 tr_trail m st st' m',
@HybridMachineSig.HybridMachineSig.external_step
_ _ _ _ (@DryHybridMachineSig (@ClightMachine.DMS.DSem Clight_g)
OrdinalPool.OrdinalThreadPool)
scheduler U tr1 st m U' (tr1++tr_trail) st' m' ->
forall tr2,
@HybridMachineSig.HybridMachineSig.external_step
_ _ _ _ (@DryHybridMachineSig (@ClightMachine.DMS.DSem Clight_g)
OrdinalPool.OrdinalThreadPool)
scheduler U tr2 st m U' (tr2++tr_trail) st' m'.