Ltac app_pred_unfold :=
match goal with
H : context[app_pred (exist ?F ?f ?p) ?phi] |- _ =>
change (app_pred (exist F f p) phi) with (f phi) in H; cbv beta in H
| |- context[app_pred (exist ?F ?f ?p) ?phi] =>
change (app_pred (exist F f p) phi) with (f phi); cbv beta
end.

(* Specifications: *)
Lemma mapsto_unfold sh z b ofs phi loc :
readable_share sh ->
app_pred (mapsto sh (Tpointer Tvoid noattr) (offset_val (size_chunk Mptr * z) (Vptr b ofs)) Vundef) phi ->
if adr_range_dec (b, Ptrofs.unsigned (Ptrofs.add ofs (Ptrofs.repr (size_chunk Mptr * z)))) (size_chunk Mptr) loc then
exists p v,
phi @ loc =
YES sh p (VAL v) NoneP
else
identity (phi @ loc).
Lemma data_at_unfold_readable CS sh b ofs phi length :
readable_share sh ->
app_pred (@data_at_ CS sh (Tarray (Tpointer Tvoid noattr) (Z.of_nat length) noattr) (Vptr b ofs)) phi ->
forall loc,
if adr_range_dec (b, Ptrofs.intval ofs) (size_chunk Mptr * Z.of_nat length)%Z loc then
exists p v,
phi @ loc =
YES
sh p (VAL v) NoneP
else
identity (phi @ loc).