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'.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'.

(* Specifications: *)
Lemma erasedPool_contains: forall tp1 tp1' (HerasedPool: threadPool_erasure tp1 tp1') i, containsThread tp1 i <-> containsThread tp1' i.
Lemma erasedPool_num_threads: forall tp tp' (HerasedPool: threadPool_erasure tp tp'), OrdinalPool.num_threads tp = OrdinalPool.num_threads tp'.
Lemma ctl_erasure_refl: forall c, ctl_erasure c c.
Lemma erased_updLockSet: forall tp tp' addr addr' rmap rmap', threadPool_erasure tp tp' -> threadPool_erasure (updLockSet tp addr rmap) (updLockSet tp' addr' rmap').
Lemma erased_updThread: forall tp tp' i (cnti: containsThread tp i) (cnti': containsThread tp' i) c c' pmap, threadPool_erasure tp tp' -> ctl_erasure c c' -> threadPool_erasure (updThread cnti c pmap) (updThreadC cnti' c').
Lemma erased_updThread': forall tp tp' i (cnti: containsThread tp i) (cnti': containsThread tp' i) c c' pmap pmap', threadPool_erasure tp tp' -> ctl_erasure c c' -> threadPool_erasure (updThread cnti c pmap) (updThread cnti' c' pmap').
Lemma erased_updThreadC: forall tp tp' i (cnti: containsThread tp i) (cnti': containsThread tp' i) c c', threadPool_erasure tp tp' -> ctl_erasure c c' -> threadPool_erasure (updThreadC cnti c) (updThreadC cnti' c').
Lemma erased_addThread: forall tp tp' v arg v' arg' pmap pmap', threadPool_erasure tp tp' -> val_erasure v v' -> val_erasure arg arg' -> threadPool_erasure (addThread tp v arg pmap) (addThread tp' v' arg' pmap').
Lemma erased_remLockSet: forall tp tp' addr addr', threadPool_erasure tp tp' -> threadPool_erasure (remLockSet tp addr) (remLockSet tp' addr').