Inductive threadHalted': forall {tid0 ms},
containsThread(resources:=LockInvsAndResources) ms tid0 -> Prop:=
| thread_halted':
forall tp c tid0 i
(cnt: containsThread tp tid0),
forall
(Hthread: getThreadC cnt = Krun c)
(Hcant: halted the_sem c i),
threadHalted' cnt.
Definition threadHalted: forall {tid0 ms},
containsThread ms tid0 -> Prop:= @threadHalted'.

Lemma syncstep_equal_halted:
forall b i tp m cnti cmpt tp' m' tr,
@syncStep b i tp m cnti cmpt tp' m' tr ->
forall j cnt cnt',
(@threadHalted j tp cnt) <->
(@threadHalted j tp' cnt').