(*Require Import VST.concurrency.cl_step_lemmas. Require Import VST.concurrency.resource_decay_lemmas. Require Import VST.concurrency.resource_decay_join.*)
Set Bullet Behavior "Strict Subproofs".
(* typically given by lock_coherence: *)

Lemma valid_access_restrPermMap ge m i tp Phi b ofs ophi
(compat : mem_compatible_with tp m Phi)
(lock_coh : lock_coherence'(ge := ge) tp Phi m compat)
(cnti : containsThread tp i)
(Efind : AMap.find (elt:=option rmap) (b, Ptrofs.unsigned ofs) (lset tp) = Some ophi)
(align : (4 | snd (b, Ptrofs.unsigned ofs)))
(Hlt' : permMapLt
(setPermBlock (Some Writable) b (Ptrofs.intval ofs) (juice2Perm_locks (getThreadR cnti) m) LKSIZE_nat)
(getMaxPerm m)) :
valid_access (restrPermMap Hlt') Mint32 b (Ptrofs.intval ofs) Writable.