Definition juicy_mem_core (j: juicy_mem) : rmap := core (m_phi j).

(* Specifications: *)
Lemma components_join_joins {A} {JA: Join A}{PA: Perm_alg A}{TA: Trip_alg A}: forall a b c d, join a b c -> joins a d -> joins b d -> joins c d.
Lemma contents_cohere_join_sub: forall m phi phi', contents_cohere m phi -> join_sub phi' phi -> contents_cohere m phi'.
Lemma perm_of_sh_join_sub: forall (sh1 sh2: Share.t) p, perm_of_sh sh1 = Some p -> join_sub sh1 sh2 -> perm_order' (perm_of_sh sh2) p.
Lemma perm_order'_trans: forall p1 p2 p3, perm_order' (Some p1) p2 -> perm_order' (Some p2) p3 -> perm_order' (Some p1) p3.
Lemma preds_fmap_NoneP_approx: forall pp lev1 lev2, preds_fmap (approx lev1) (approx lev1) pp = NoneP -> preds_fmap (approx lev2) (approx lev2) pp = NoneP.
Lemma oracle_unage: forall (jm': juicy_mem) (w: rmap), age w (m_phi jm') -> exists jm, age jm jm' /\ m_phi jm = w.
Lemma writable_perm: forall b i jm, writable (b,i) (m_phi jm) -> Mem.perm (m_dry jm) b i Cur Writable.
Lemma valid_access_None: forall m ch b b' ofs ofs' p, Mem.valid_access m ch b ofs p -> adr_range (b, ofs) (size_chunk ch) (b', ofs') -> access_at m (b', ofs') Cur = None -> False.
Lemma core_load_getN: forall ch v b ofs bl phi m, contents_cohere m phi -> (core_load' ch (b, ofs) v bl)%pred phi -> bl = Mem.getN (size_chunk_nat ch) ofs (PMap.get b (Mem.mem_contents m)).
Lemma core_load_valid: forall ch v b ofs m phi, (core_load ch (b, ofs) v)%pred phi -> access_cohere m phi -> Mem.valid_access m ch b ofs Readable.
Lemma core_load_load': forall ch b ofs v m, core_load ch (b, ofs) v (m_phi m) -> Mem.load ch (m_dry m) b ofs = Some v.
Lemma Zminus_lem: forall z1 z2, z1 <= z2 -> nat_of_Z (z2 - z1) = O -> z1=z2.
Lemma nat_of_Z_lem1: forall n z, S n = nat_of_Z z -> n = nat_of_Z (z - 1).
Lemma nat_of_Z_lem2: forall n z1 z2, S n = nat_of_Z (z1 - z2) -> n = nat_of_Z (z1 - z2 - 1).
Lemma nth_getN: forall m b ofs ofs' z, ofs <= ofs' < ofs + z -> z >= 0 -> contents_at m (b, ofs') = nth (nat_of_Z (ofs' - ofs)) (Mem.getN (nat_of_Z z) ofs (PMap.get b (Mem.mem_contents m))) Undef.
Lemma mapsto_valid_access: forall ch v sh b ofs jm, (address_mapsto ch v sh (b, ofs) * TT)%pred (m_phi jm) -> Mem.valid_access (m_dry jm) ch b ofs Readable.
Lemma mapsto_valid_access_wr: forall ch v sh (wsh: writable0_share sh) b ofs jm, (address_mapsto ch v sh (b, ofs) * TT)%pred (m_phi jm) -> Mem.valid_access (m_dry jm) ch b ofs Writable.