Fixpoint lockRes_data_permission_add_execution U
U' tr tpi mi tpj mj tr' laddr rmapj b ofs
(Hres: lockRes tpi laddr = None)
(Hres': lockRes tpj laddr = Some rmapj)
(Hexec: multi_step (U, tr, tpi) mi (U', tr ++ tr', tpj) mj)
(Hperm': Mem.perm_order'' (rmapj.1 !! b ofs) (Some Readable)) {struct U}:
exists v ev,
nth_error tr' v = Some ev /\ action ev = Release /\
location ev = Some (laddr, lksize.LKSIZE_nat)
with
lockRes_data_permission_increase_execution U {struct U}:
forall U' tr tpi mi tpj mj tr' laddr rmapi rmapj b ofs
(Hres: lockRes tpi laddr = Some rmapi)
(Hres': lockRes tpj laddr = Some rmapj)
(Hexec: multi_step (U, tr, tpi) mi (U', tr ++ tr', tpj) mj)
(Hperm: ~ Mem.perm_order'' (rmapi.1 !! b ofs) (Some Readable))
(Hperm': Mem.perm_order'' (rmapj.1 !! b ofs) (Some Readable)),
exists v ev,
nth_error tr' v = Some ev /\ action ev = Release /\
location ev = Some (laddr, lksize.LKSIZE_nat).
Fixpoint lockRes_lock_permission_add_execution U
U' tr tpi mi tpj mj tr' laddr rmapj b ofs
(Hres: lockRes tpi laddr = None)
(Hres': lockRes tpj laddr = Some rmapj)
(Hexec: multi_step (U, tr, tpi) mi (U', tr ++ tr', tpj) mj)
(Hperm': Mem.perm_order'' (rmapj.2 !! b ofs) (Some Readable)) {struct U}:
exists v ev,
nth_error tr' v = Some ev /\ action ev = Release /\
location ev = Some (laddr, lksize.LKSIZE_nat)
with
lockRes_lock_permission_increase_execution U {struct U}:
forall U' tr tpi mi tpj mj tr' laddr rmapi rmapj b ofs
(Hres: lockRes tpi laddr = Some rmapi)
(Hres': lockRes tpj laddr = Some rmapj)
(Hexec: multi_step (U, tr, tpi) mi (U', tr ++ tr', tpj) mj)
(Hperm: ~ Mem.perm_order'' (rmapi.2 !! b ofs) (Some Readable))
(Hperm': Mem.perm_order'' (rmapj.2 !! b ofs) (Some Readable)),
exists v ev,
nth_error tr' v = Some ev /\ action ev = Release /\
location ev = Some (laddr, lksize.LKSIZE_nat).

(* Specifications: *)
Lemma lockRes_permission_increase_execution:
forall U tr tpi mi U' tpj mj tr' laddr rmapi rmapj b ofs
(Hres: lockRes tpi laddr = Some rmapi)
(Hres': lockRes tpj laddr = Some rmapj)
(Hexec: multi_step (U, tr, tpi) mi (U', tr ++ tr', tpj) mj)
(Hperm: (~ Mem.perm_order'' (rmapi.1 !! b ofs) (Some Readable) /\
Mem.perm_order'' (rmapj.1 !! b ofs) (Some Readable)) \/
(~ Mem.perm_order'' (rmapi.2 !! b ofs) (Some Readable) /\
Mem.perm_order'' (rmapj.2 !! b ofs) (Some Readable))),
exists v ev,
nth_error tr' v = Some ev /\ action ev = Release /\
location ev = Some (laddr, lksize.LKSIZE_nat).
Lemma thread_spawn_step:
forall U tr tp m U' tp' m' tr' tidn
(cnt: ~ containsThread tp tidn)
(cnt': containsThread tp' tidn)
(Hstep: MachStep (U, tr, tp) m (U', tr ++ tr', tp') m'),
exists ev,
tr' = [:: ev] /\ action ev = Spawn.
Lemma thread_spawn_execution:
forall U tr tpi mi U' tr' tpj mj
tidn
(cnti: ~ containsThread tpi tidn)
(cntj: containsThread tpj tidn)
(Hexec: multi_step (U, tr, tpi) mi (U', tr ++ tr', tpj) mj),
exists tr_pre evu U'' U''' tp_pre m_pre tp_inc m_inc,
multi_step (U, tr, tpi) mi (U'', tr ++ tr_pre, tp_pre) m_pre /\
MachStep (U'', tr ++ tr_pre, tp_pre) m_pre
(U''', tr ++ tr_pre ++ [:: evu], tp_inc) m_inc /\
multi_step (U''', tr ++ tr_pre ++ [:: evu], tp_inc) m_inc
(U', tr ++ tr',tpj) mj /\
action evu = Spawn.