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_lift_c_state:
forall U U' tr tr' m st st' m',
@HybridMachineSig.HybridMachineSig.external_step
_ _ _ _ (@DryHybridMachineSig (@ClightMachine.DMS.DSem Clight_g)
OrdinalPool.OrdinalThreadPool)
scheduler U tr st m U' tr' st' m' ->
@HybridMachineSig.HybridMachineSig.external_step
_ _ _ _ (@DryHybridMachineSig (HybridSem (@Some nat 0%nat)) OrdinalPool.OrdinalThreadPool)
scheduler U tr (lift_c_state st) m U' tr' (lift_c_state st') m'.