Proof.
Proof.
intros.
assert (
Mem.range_perm m2 b0 0 4
Max Writable).
{
unfold storemax in H0.
ex_match.
clear H0.
unfold Mem.range_perm in *.
intros.
apply r in H0.
inv H.
eapply mi_perm in H2;
eauto.
assert(
ofs + 0 =
ofs).
omega.
rewrite H in H2.
auto.
}
unfold storemax.
ex_match2;
try contradiction.
eexists;
split;
eauto.
split.
constructor.
{
unfold storemax in H0.
ex_match2.
inv H0.
inv H.
unfold Mem.perm in *;
simpl in *;
eauto.
}
{
unfold storemax in H0.
ex_match2.
inv H0.
inv H.
unfold Mem.perm in *;
simpl in *;
eauto.
}
mem_contents *)
unfold storemax in *;
ex_match2;
inv H0;
inv H.
unfold Mem.perm in *;
simpl in *.
intros.
rewrite !
PMap.gsspec.
destruct (
peq b4 b1).
subst b4.
block = b1, block = b2 *)
assert (
b5 =
b0)
by congruence.
subst b5.
assert (0 =
delta)
by congruence.
subst delta.
rewrite peq_true.
apply Mem.setN_inj with (
access :=
fun ofs =>
Mem.perm m1 b1 ofs Max Readable).
apply encode_val_inject;
auto.
intros.
eapply mi_memval;
eauto.
eauto with mem.
destruct (
peq b5 b0).
subst b5.
block <> b1, block = b2 *)
rewrite Mem.setN_other.
eapply mi_memval;
eauto.
eauto with mem.
rewrite encode_val_length.
rewrite <-
size_chunk_conv.
intros.
exploit H1;
eauto with mem.
intro.
destruct H6;
try contradiction.
omega.
eapply mi_memval;
eauto.
unfold storemax in *;
ex_match2;
inv H0;
inv H.
unfold Mem.perm in *;
simpl in *.
intros.
rewrite !
PMap.gsspec.
destruct (
peq b4 b1).
subst b4.
block = b1, block = b2 *)
assert (
b5 =
b0)
by congruence.
subst b5.
assert (0 =
delta)
by congruence.
subst delta.
rewrite peq_true.
apply Mem.setN_inj with (
access :=
fun ofs =>
Mem.perm m1 b1 ofs Max Readable).
apply encode_val_inject;
auto.
intros.
eapply VALINJ;
eauto.
eauto with mem.
destruct (
peq b5 b0).
subst b5.
block <> b1, block = b2 *)
rewrite Mem.setN_other.
eapply VALINJ;
eauto.
eauto with mem.
rewrite encode_val_length.
rewrite <-
size_chunk_conv.
intros.
exploit H1;
eauto with mem.
intro.
destruct H6;
try contradiction.
omega.
eapply VALINJ;
eauto.
Qed.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.
Proof.