.
.
.
.
.
.
.
Proof.
)).
Proof.
intros.
apply PTree_Properties.fold_rec with (
P :=
fun c uf =>
branch_map_correct c uf).
extensionality *)
intros.
red;
intros.
rewrite <-
H.
apply H0.
base case *)
red;
intros;
simpl.
rewrite PTree.gempty.
apply U.repr_empty.
inductive case *)
intros m uf pc bb;
intros.
destruct uf as [
u f].
assert (
PC:
U.repr u pc =
pc).
generalize (
H1 pc).
rewrite H.
auto.
assert (
record_goto' (
u,
f)
pc bb = (
u,
f)
\/
exists s,
exists bb',
bb =
Lbranch s ::
bb' /\
record_goto' (
u,
f)
pc bb = (
U.union u pc s,
measure_edge u pc s f)).
unfold record_goto';
simpl.
destruct bb;
auto.
destruct i;
auto.
right.
exists s;
exists bb;
auto.
destruct H2 as [
B | [
s [
bb' [
EQ B]]]].
u and f are unchanged *)
rewrite B.
red.
intro pc'.
simpl.
rewrite PTree.gsspec.
destruct (
peq pc'
pc).
subst pc'.
destruct bb;
auto.
destruct i;
auto.
apply H1.
b is Lbranch s, u becomes union u pc s, f becomes measure_edge u pc s f *)
rewrite B.
red.
intro pc'.
simpl.
rewrite PTree.gsspec.
destruct (
peq pc'
pc).
subst pc'.
rewrite EQ.
The new instruction *)
rewrite (
U.repr_union_2 u pc s);
auto.
rewrite U.repr_union_3.
unfold measure_edge.
destruct (
peq (
U.repr u s)
pc).
auto.
right.
split.
auto.
rewrite PC.
rewrite peq_true.
omega.
An old instruction *)
assert (
U.repr u pc' =
pc' ->
U.repr (
U.union u pc s)
pc' =
pc').
intro.
rewrite <-
H2 at 2.
apply U.repr_union_1.
congruence.
generalize (
H1 pc').
simpl.
destruct (
m!
pc');
auto.
destruct b;
auto.
destruct i;
auto.
intros [
P | [
P Q]].
left;
auto.
right.
split.
apply U.sameclass_union_2.
auto.
unfold measure_edge.
destruct (
peq (
U.repr u s)
pc).
auto.
rewrite P.
destruct (
peq (
U.repr u s0)
pc).
omega.
auto.
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.