(** Lemmas common to both parts of the progress/preservation simulation results *)

(* Specifications: *)
Lemma lock_coherence_align lset Phi m b ofs :
lock_coherence lset Phi m ->
AMap.find (elt:=option rmap) (b, ofs) lset <> None ->
(align_chunk Mint32 | ofs).
Lemma lset_valid_access ge m m_any (tp : jstate ge) Phi b ofs
(compat : mem_compatible_with tp m Phi) :
lock_coherence (lset tp) Phi m_any ->
AMap.find (elt:=option rmap) (b, ofs) (lset tp) <> None ->
Mem.valid_access (restrPermMap (mem_compatible_locks_ltwritable (mem_compatible_forget compat))) Mptr b ofs Writable.
Lemma mem_compatible_with_age ge {n} {tp : jstate ge} {m phi} :
mem_compatible_with tp m phi ->
mem_compatible_with (age_tp_to n tp) m (age_to n phi).
Lemma after_alloc_0 : forall b phi H, after_alloc 0 0 b phi H = phi.
Lemma PURE_SomeP_inj1 k A1 A2 pp1 pp2 : PURE k (SomeP A1 pp1) = PURE k (SomeP A2 pp2) -> A1 = A2.
Lemma PURE_SomeP_inj2 k A pp1 pp2 : PURE k (SomeP A pp1) = PURE k (SomeP A pp2) -> pp1 = pp2.
(* Most general lemma about preservation of matchfunspecs *)
Lemma pures_eq_matchfunspecs e Gamma Phi Phi' :
(level Phi' <= level Phi)%nat ->
pures_eq Phi Phi' ->
matchfunspecs e Gamma Phi ->
matchfunspecs e Gamma Phi'.
Lemma pures_eq_age_to phi n :
(level phi >= n)%nat ->
pures_eq phi (age_to n phi).
Lemma matchfunspecs_age_to e Gamma n Phi :
(n <= level Phi)%nat ->
matchfunspecs e Gamma Phi ->
matchfunspecs e Gamma (age_to n Phi).
Lemma age_pures_eq phi phi' : age phi phi' -> pures_eq phi phi'.
Lemma matchfunspecs_hered e Gamma :
hereditary age (matchfunspecs e Gamma).
Lemma resource_decay_pures_eq b phi phi' :
resource_decay b phi phi' ->
pures_eq phi phi'.
Lemma resource_decay_matchfunspecs e Gamma b Phi Phi' :
(level Phi' <= level Phi)%nat ->
resource_decay b Phi Phi' ->
matchfunspecs e Gamma Phi ->
matchfunspecs e Gamma Phi'.
Lemma funassert_pures_eq G rho phi1 phi2 :
(level phi1 >= level phi2)%nat ->
pures_eq phi1 phi2 ->
app_pred (funassert G rho) phi1 ->
app_pred (funassert G rho) phi2.
Lemma env_coherence_hered Z Jspec ge G :
hereditary age (@env_coherence Z Jspec ge G).
Lemma env_coherence_age_to Z Jspec ge G phi n :
@env_coherence Z Jspec ge G phi ->
@env_coherence Z Jspec ge G (age_to n phi).
Lemma env_coherence_pures_eq Z Jspec ge G phi phi' :
(level phi >= level phi')%nat ->
pures_eq phi phi' ->
@env_coherence Z Jspec ge G phi ->
@env_coherence Z Jspec ge G phi'.
Lemma env_coherence_resource_decay Z Jspec ge G b phi phi' :
(level phi >= level phi')%nat ->
resource_decay b phi phi' ->
@env_coherence Z Jspec ge G phi ->
@env_coherence Z Jspec ge G phi'.
Lemma restrPermMap_mem_contents p' m (Hlt: permMapLt p' (getMaxPerm m)):
Mem.mem_contents (restrPermMap Hlt) = Mem.mem_contents m.
Lemma islock_valid_access ge (tp : jstate ge) m b ofs p
(compat : mem_compatible tp m) :
(align_chunk Mptr | ofs) ->
lockRes tp (b, ofs) <> None ->
p <> Freeable ->
Mem.valid_access
(restrPermMap
(mem_compatible_locks_ltwritable compat))
Mptr b ofs p.
Lemma LockRes_age_content1 ge (js : jstate ge) n a :
lockRes (age_tp_to n js) a = option_map (option_map (age_to n)) (lockRes js a).
Lemma join_sub_to_joining {A} {J : Join A}
{_ : Perm_alg A} {_ : Sep_alg A} {_ : Canc_alg A} {_ : Disj_alg A}
(a b e : A) :
join_sub e a ->
join_sub e b ->
joins a b ->
identity e.
Lemma join_sub_join {A} {J : Join A}
{PA : Perm_alg A} {SA : Sep_alg A} {_ : Canc_alg A} {DA : Disj_alg A} {CA : Cross_alg A}
(a b c x : A) :
join a b c ->
join_sub a x ->
join_sub b x ->
join_sub c x.
Lemma Ejuicy_sem : forall ge, (@juicy_sem (Clight_newSem ge)) = juicy_core_sem (cl_core_sem ge).
Lemma level_jm_ ge m tp Phi (compat : mem_compatible_with tp m Phi)
i (cnti : containsThread tp i) :
level (jm_(ge := ge) cnti compat) = level Phi.