Section FineGrainedExecutions.
Context
{Sem : Semantics}
{initU : seq.seq nat}
{SemAx : CoreLanguage.SemAxioms}.
Existing Instance dryResources.
Existing Instance HybridFineMachine.scheduler.
Existing Instance OrdinalPool.OrdinalThreadPool.
Existing Instance DryHybridMachineSig.
Existing Instance FineDilMem.
Existing Instance dryFineMach.
(** A location that the machine has no access to (i.e. the permission is empty in all its resources) *)
Inductive deadLocation tp m b ofs : Prop :=
| Dead: forall
(Hvalid: Mem.valid_block m b)
(Hthreads: forall i (cnti: containsThread tp i),
(getThreadR cnti).1 !! b ofs = None /\ (getThreadR cnti).2 !! b ofs = None)
(Hresources: forall l pmap,
lockRes tp l = Some pmap ->
pmap.1 !! b ofs = None /\ pmap.2 !! b ofs = None),
deadLocation tp m b ofs.
(** ** Properties of specific stepss and executions *)

(** After a step that generates a [mklock] event at [address] addr, addr will be in the [lockRes] and thread i will have lock permission on addr*)
Lemma Mklock_lockRes:
forall i U tr tp m tp' m' addr
(Hstep: MachStep (i :: U, tr, tp) m
(U, tr ++ [:: external i (Events.mklock addr)], tp') m'),
lockRes tp' addr /\
forall (cnti': containsThread tp' i) ofs,
Intv.In ofs (addr.2, addr.2 + lksize.LKSIZE)%Z ->
((getThreadR cnti').2 !! (addr.1)) ofs = Some Writable.