(* TODO those definitions are also in sync_preds_defs, see if we can
include without changing the dep DAG too badly *)

(* The TT branch of the jam below might seem too weak, but we already
keep enough control over joining with other rmaps that it should be
enough *)

Definition LKspec_ext (R: pred rmap) lksize : spec :=
   fun (sh: Share.t) (l: AV.address)  =>
    allp (jam (adr_range_dec l lksize)
              (fun l' => yesat (SomeP rmaps.Mpred (fun _ => R)) (LK lksize (snd l' - snd l)) sh l')
              (fun _ => TT)).Definition LK_at R lksize sh :=
  LKspec_ext R lksize sh.

Lemma readable_part_glb: forall (sh sh0 : Share.t) (r : readable_share sh) (r0 : readable_share sh0), Share.glb Share.Rsh sh0 = Share.glb Share.Rsh sh -> readable_part (readable_glb r0) = readable_part (readable_glb r).