Definition LKspec lock_size (R: pred rmap) : spec :=
fun (sh: Share.t) (l: AV.address)  =>
allp (jam (adr_range_dec l lock_size)
(fun l' => yesat (SomeP Mpred (fun _ => R)) (LK lock_size (snd l' - snd l)) sh l')
noat) && noghost.
(*Lenb: moved to veric/seplog.v Definition packPQ {A: rmaps.TypeTree} (P Q: forall ts, dependent_type_functor_rec ts (AssertTT A) (pred rmap)): forall ts, dependent_type_functor_rec ts (SpecTT A) (pred rmap) := fun ts a b => if b then P ts a else Q ts a. *)
Definition TTat (l: address) : pred rmap := TT.
(* Definition FUNspec (fml: funsig) cc (A: TypeTree) (P Q: forall ts, dependent_type_functor_rec ts (AssertTT A) (pred rmap)) (l: address): pred rmap := allp (jam (eq_dec l) (pureat (SomeP (SpecTT A) (packPQ P Q)) (FUN fml cc)) TTat).  Definition fun_assert (fml: funsig) cc (A: TypeTree) (P Q: forall ts, dependent_type_functor_rec ts (AssertTT A) (pred rmap)) (v: val)  : pred rmap := (EX b : block, !! (v = Vptr b Int.zero) && FUNspec fml cc A P Q (b, 0))%pred. *)
(***********)
(*Lenb: dead? Lemma ewand_lem1x: forall S P: mpred, S |-- P * TT -> S |-- P * (ewand P S).  Lemma address_mapsto_old_parametric: forall ch v, spec_parametric (fun l sh l' => yesat NoneP (VAL (nthbyte (snd l' - snd l) (encode_val ch v))) sh l').  Lemma VALspec_parametric: spec_parametric (fun l sh l' => EX v: memval,  yesat NoneP (VAL v) sh l').  Lemma LKspec_parametric lock_size: forall R: pred rmap, spec_parametric (fun l sh l' => yesat (SomeP Mpred (fun _ => R)) (LK lock_size (snd l' - snd l)) sh l').  (* Lemma FUNspec_parametric: forall fml cc A P Q, spec_parametric (fun l sh => yesat (SomeP (SpecTT A) (packPQ P Q)) (FUN fml cc) sh). *)
Definition val2address (v: val) : option AV.address :=
match v with Vptr b ofs => Some (b, Ptrofs.signed ofs) | _ => None end.

(* Specifications: *)
Lemma VALspec_readable:
forall l sh w,  (VALspec sh l * TT) %pred w -> readable l w.