Definition same_except_cur (m m' : Mem.mem) :=
Mem.mem_contents m = Mem.mem_contents m' /\
max_access_at m = max_access_at m' /\
Mem.nextblock m = Mem.nextblock m'.

(* Specifications: *)
Lemma mem_cohere_same_except_cur m m' phi :
same_except_cur m m' ->
mem_cohere' m phi ->
mem_cohere' m' phi.
Lemma mem_compatible_with_same_except_cur (tp : jstate ge) m m' phi :
same_except_cur m m' ->
mem_compatible_with tp m phi ->
mem_compatible_with tp m' phi.
Lemma resource_at_joins phi1 phi2 loc :
joins phi1 phi2 -> joins (phi1 @ loc) (phi2 @ loc).
Lemma juicyRestrict_Max b ofs phi m (coh : access_cohere' m phi):
(Mem.mem_access (juicyRestrict coh)) !! b ofs Max =
(Mem.mem_access m) !! b ofs Max.
Lemma juicyRestrict_Cur b ofs phi m (coh : access_cohere' m phi):
(Mem.mem_access (juicyRestrict coh)) !! b ofs Cur =
perm_of_res (phi @ (b, ofs)).
Lemma same_perm_spec m1 m2 :
Mem.perm m1 = Mem.perm m2 <->
(forall k x, access_at m1 x k = access_at m2 x k).
Lemma PTree_xmap_ext (A B : Type) (f f' : positive -> A -> B) t :
(forall a, f a = f' a) ->
PTree.xmap f t = PTree.xmap f' t.
Lemma juicyRestrictCur_ext m phi phi'
(coh : access_cohere' m phi)
(coh' : access_cohere' m phi')
(same : forall loc, perm_of_res (phi @ loc) = perm_of_res (phi' @ loc)) :
Mem.mem_access (juicyRestrict coh) =
Mem.mem_access (juicyRestrict coh').
Lemma PTree_xmap_self A f (m : PTree.t A) i :
(forall p a, m ! p = Some a -> f (PTree.prev_append i p) a = a) ->
PTree.xmap f m i = m.
Lemma PTree_map_self (A : Type) (f : positive -> A -> A) t :
(forall b a, t ! b = Some a -> f b a = a) ->
PTree.map f t = t.
Lemma juicyRestrictCur_unchanged m phi
(coh : access_cohere' m phi)
(pres : forall loc, perm_of_res (phi @ loc) = access_at m loc Cur) :
Mem.mem_access (juicyRestrict coh) = Mem.mem_access m.
Lemma ZIndexed_index_surj p : { z : Z | ZIndexed.index z = p }.
Lemma self_join_pshare_false (psh psh' : pshare) : ~sepalg.join psh psh psh'.
Lemma approx_eq_app_pred {P1 P2 : mpred} x n :
level x < n ->
@approx n P1 = approx n P2 ->
app_pred P1 x ->
app_pred P2 x.
Lemma exclusive_approx R n : exclusive_mpred R -> exclusive_mpred (approx n R).
Lemma exclusive_joins_false R phi1 phi2 :
exclusive_mpred R ->
app_pred R phi1 ->
app_pred R phi2 ->
joins phi1 phi2 ->
False.
Lemma weak_exclusive_joins_false R phi phi1 phi2 :
level phi = level phi1 ->
app_pred (weak_exclusive_mpred R) phi ->
app_pred R phi1 ->
app_pred R phi2 ->
joins phi1 phi2 ->
False.