Next Obligation.
intros; intro; intros.
destruct H0 as [sh [rsh ?]]; exists sh, rsh.
apply (age1_YES a a'); auto.
Qed.
Next Obligation.     intros; intro; intros. auto.
Qed.
Program Definition core_load' (ch: memory_chunk) (l: address) (v: val) (bl: list memval)
: pred rmap :=
!!(length bl = size_chunk_nat ch /\ decode_val ch bl = v /\ (align_chunk ch | snd l)) &&
allp (jam (adr_range_dec l (size_chunk ch))
(fun l' phi => exists sh, exists rsh, phi @ l'
= YES sh rsh (VAL (nth (nat_of_Z (snd l' - snd l)) bl Undef)) NoneP)
(fun _ _ => True)).
Next Obligation.
intros; intro; intros.
destruct H0 as [sh [rsh ?]]; exists sh, rsh.
apply (age1_YES a a'); auto.
Qed.
Next Obligation.     intros; intro; intros. auto.
Qed.

(* Specifications: *)
Lemma VALspec_range_0: forall sh loc, VALspec_range 0 sh loc = emp.
Hint Resolve VALspec_range_0: normalize.
Lemma nonlock_permission_bytes_0: forall sh a, nonlock_permission_bytes sh a 0 = emp.
Lemma nonlock_permission_bytes_not_nonunit: forall sh p n,
~ nonunit sh ->
nonlock_permission_bytes sh p n |-- emp.
Lemma is_resource_pred_YES_VAL sh:
is_resource_pred
(fun l' => EX  v: memval, yesat NoneP (VAL v) sh l')
(fun r _ n => (exists b0 rsh, r = YES sh rsh (VAL b0)
(SomeP (ConstType unit) (fun _ => tt)))).
Lemma nonlock_permission_bytes_split2:
forall (n m r: Z) (sh: Share.t) (b: block) (ofs: Z),
r = n + m -> n >= 0 -> m >= 0 ->
nonlock_permission_bytes sh (b, ofs) r =
nonlock_permission_bytes sh (b, ofs) n *
nonlock_permission_bytes sh (b, ofs + n) m.
Lemma VALspec_range_VALspec:
forall (n : Z) (v : val) (sh : Share.t) (l : address) (i : Z),
0 <= i < n ->
VALspec_range n sh l
|-- VALspec sh (adr_add l i) * TT.
Lemma VALspec_range_overlap': forall sh p1 p2 n1 n2,
adr_range p1 n1 p2 ->
n2 > 0 ->
VALspec_range n1 sh p1 * VALspec_range n2 sh p2 |-- FF.
Lemma address_mapsto_overlap':
forall sh ch1 v1 ch2 v2 a1 a2,
adr_range a1 (size_chunk ch1) a2 ->
address_mapsto ch1 v1 sh a1 * address_mapsto ch2 v2 sh a2 |-- FF.
Lemma VALspec_range_overlap: forall sh l1 n1 l2 n2,
range_overlap l1 n1 l2 n2 ->
VALspec_range n1 sh l1 * VALspec_range n2 sh l2 |-- FF.
Lemma address_mapsto_overlap: forall sh l1 ch1 v1 l2 ch2 v2,
range_overlap l1 (size_chunk ch1) l2 (size_chunk ch2) ->
address_mapsto ch1 v1 sh l1 * address_mapsto ch2 v2 sh l2 |-- FF.
Lemma share_joins_self: forall sh: share, joins sh sh -> nonunit sh -> False.
Lemma nonlock_permission_bytes_overlap:
forall sh n1 n2 p1 p2,
nonunit sh ->
range_overlap p1 n1 p2 n2 ->
nonlock_permission_bytes sh p1 n1 * nonlock_permission_bytes sh p2 n2 |-- FF.
Lemma address_mapsto_value_cohere':
forall ch v1 v2 sh1 sh2 a r
(Hmaps1 : address_mapsto ch v1 sh1 a r)
(Hmaps2 : address_mapsto ch v2 sh2 a r), v1=v2.
Lemma address_mapsto_value_cohere:
forall ch v1 v2 sh1 sh2 a,
address_mapsto ch v1 sh1 a * address_mapsto ch v2 sh2 a |-- !! (v1=v2).