Section ThreadPoolErasure.
Context {Sem: Semantics}
{CE: CoreErasure}.
Existing Instance OrdinalPool.OrdinalThreadPool.
Existing Instance DryHybridMachine.dryResources.
Existing Instance BareMachine.resources.
Existing Instance AsmContext.bareMach.
Existing Instance AsmContext.dryFineMach.
Notation containsThreadF := (@containsThread DryHybridMachine.dryResources Sem OrdinalPool.OrdinalThreadPool).
Notation containsThreadE := (@containsThread BareMachine.resources Sem OrdinalPool.OrdinalThreadPool).
Definition ctl_erasure c c' : Prop :=
match c, c' with
| Kinit vf arg, Kinit vf' arg' =>
val_erasure vf vf' /\ val_erasure arg arg'
| Krun c, Krun c' =>
core_erasure c c'
| Kblocked c, Kblocked c' =>
core_erasure c c'
| Kresume c arg, Kresume c' arg' =>
core_erasure c c' /\ arg = arg'
(*we don't use this and our semantics are strange*)
| _, _  => False
end.
Inductive threadPool_erasure tp tp' :=
| ErasedPool :
(forall i, containsThreadF tp i <-> containsThreadE tp' i) ->
(forall i (cnti: containsThreadF tp i)
(cnti': containsThreadE tp' i),
ctl_erasure (getThreadC cnti) (getThreadC cnti')) ->
threadPool_erasure tp tp'.

Lemma erasedPool_num_threads:
forall tp tp'
(HerasedPool: threadPool_erasure tp tp'),
OrdinalPool.num_threads tp = OrdinalPool.num_threads tp'.