47613
|
1 |
(* Author: Tobias Nipkow *)
|
|
2 |
|
|
3 |
theory Abs_Int1
|
|
4 |
imports Abs_State
|
|
5 |
begin
|
|
6 |
|
|
7 |
lemma le_iff_le_annos_zip: "C1 \<sqsubseteq> C2 \<longleftrightarrow>
|
|
8 |
(\<forall> (a1,a2) \<in> set(zip (annos C1) (annos C2)). a1 \<sqsubseteq> a2) \<and> strip C1 = strip C2"
|
|
9 |
by(induct C1 C2 rule: le_acom.induct) (auto simp: size_annos_same2)
|
|
10 |
|
|
11 |
lemma le_iff_le_annos: "C1 \<sqsubseteq> C2 \<longleftrightarrow>
|
|
12 |
strip C1 = strip C2 \<and> (\<forall> i<size(annos C1). annos C1 ! i \<sqsubseteq> annos C2 ! i)"
|
|
13 |
by(auto simp add: le_iff_le_annos_zip set_zip) (metis size_annos_same2)
|
|
14 |
|
|
15 |
|
49396
|
16 |
lemma mono_fun_L[simp]: "F \<in> L X \<Longrightarrow> F \<sqsubseteq> G \<Longrightarrow> x : X \<Longrightarrow> fun F x \<sqsubseteq> fun G x"
|
|
17 |
by(simp add: mono_fun L_st_def)
|
47613
|
18 |
|
49396
|
19 |
lemma bot_in_L[simp]: "bot c \<in> L(vars c)"
|
|
20 |
by(simp add: L_acom_def bot_def)
|
47613
|
21 |
|
49396
|
22 |
lemma L_acom_simps[simp]: "SKIP {P} \<in> L X \<longleftrightarrow> P \<in> L X"
|
|
23 |
"(x ::= e {P}) \<in> L X \<longleftrightarrow> x : X \<and> vars e \<subseteq> X \<and> P \<in> L X"
|
|
24 |
"(C1;C2) \<in> L X \<longleftrightarrow> C1 \<in> L X \<and> C2 \<in> L X"
|
|
25 |
"(IF b THEN {P1} C1 ELSE {P2} C2 {Q}) \<in> L X \<longleftrightarrow>
|
|
26 |
vars b \<subseteq> X \<and> C1 \<in> L X \<and> C2 \<in> L X \<and> P1 \<in> L X \<and> P2 \<in> L X \<and> Q \<in> L X"
|
|
27 |
"({I} WHILE b DO {P} C {Q}) \<in> L X \<longleftrightarrow>
|
|
28 |
I \<in> L X \<and> vars b \<subseteq> X \<and> P \<in> L X \<and> C \<in> L X \<and> Q \<in> L X"
|
|
29 |
by(auto simp add: L_acom_def)
|
47613
|
30 |
|
49353
|
31 |
lemma post_in_annos: "post C : set(annos C)"
|
|
32 |
by(induction C) auto
|
|
33 |
|
49396
|
34 |
lemma post_in_L[simp]: "C \<in> L X \<Longrightarrow> post C \<in> L X"
|
|
35 |
by(simp add: L_acom_def post_in_annos)
|
47613
|
36 |
|
|
37 |
|
|
38 |
subsection "Computable Abstract Interpretation"
|
|
39 |
|
|
40 |
text{* Abstract interpretation over type @{text st} instead of
|
|
41 |
functions. *}
|
|
42 |
|
|
43 |
context Gamma
|
|
44 |
begin
|
|
45 |
|
|
46 |
fun aval' :: "aexp \<Rightarrow> 'av st \<Rightarrow> 'av" where
|
50896
|
47 |
"aval' (N i) S = num' i" |
|
47613
|
48 |
"aval' (V x) S = fun S x" |
|
|
49 |
"aval' (Plus a1 a2) S = plus' (aval' a1 S) (aval' a2 S)"
|
|
50 |
|
49497
|
51 |
lemma aval'_sound: "s : \<gamma>\<^isub>s S \<Longrightarrow> vars a \<subseteq> dom S \<Longrightarrow> aval a s : \<gamma>(aval' a S)"
|
47613
|
52 |
by (induction a) (auto simp: gamma_num' gamma_plus' \<gamma>_st_def)
|
|
53 |
|
|
54 |
end
|
|
55 |
|
|
56 |
text{* The for-clause (here and elsewhere) only serves the purpose of fixing
|
|
57 |
the name of the type parameter @{typ 'av} which would otherwise be renamed to
|
|
58 |
@{typ 'a}. *}
|
|
59 |
|
49396
|
60 |
locale Abs_Int = Gamma where \<gamma>=\<gamma> for \<gamma> :: "'av::semilattice \<Rightarrow> val set"
|
47613
|
61 |
begin
|
|
62 |
|
|
63 |
fun step' :: "'av st option \<Rightarrow> 'av st option acom \<Rightarrow> 'av st option acom" where
|
|
64 |
"step' S (SKIP {P}) = (SKIP {S})" |
|
|
65 |
"step' S (x ::= e {P}) =
|
|
66 |
x ::= e {case S of None \<Rightarrow> None | Some S \<Rightarrow> Some(update S x (aval' e S))}" |
|
|
67 |
"step' S (C1; C2) = step' S C1; step' (post C1) C2" |
|
49344
|
68 |
"step' S (IF b THEN {P1} C1 ELSE {P2} C2 {Q}) =
|
|
69 |
(IF b THEN {S} step' P1 C1 ELSE {S} step' P2 C2 {post C1 \<squnion> post C2})" |
|
|
70 |
"step' S ({I} WHILE b DO {P} C {Q}) =
|
|
71 |
{S \<squnion> post C} WHILE b DO {I} step' P C {I}"
|
47613
|
72 |
|
|
73 |
definition AI :: "com \<Rightarrow> 'av st option acom option" where
|
49464
|
74 |
"AI c = pfp (step' (top c)) (bot c)"
|
47613
|
75 |
|
|
76 |
|
|
77 |
lemma strip_step'[simp]: "strip(step' S C) = strip C"
|
|
78 |
by(induct C arbitrary: S) (simp_all add: Let_def)
|
|
79 |
|
|
80 |
|
|
81 |
text{* Soundness: *}
|
|
82 |
|
|
83 |
lemma in_gamma_update:
|
49497
|
84 |
"\<lbrakk> s : \<gamma>\<^isub>s S; i : \<gamma> a \<rbrakk> \<Longrightarrow> s(x := i) : \<gamma>\<^isub>s(update S x a)"
|
47613
|
85 |
by(simp add: \<gamma>_st_def)
|
|
86 |
|
50986
|
87 |
lemma step_step': "C \<in> L X \<Longrightarrow> S \<in> L X \<Longrightarrow> step (\<gamma>\<^isub>o S) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c (step' S C)"
|
|
88 |
proof(induction C arbitrary: S)
|
|
89 |
case SKIP thus ?case by auto
|
47613
|
90 |
next
|
|
91 |
case Assign thus ?case
|
50986
|
92 |
by (fastforce simp: L_st_def intro: aval'_sound in_gamma_update split: option.splits)
|
47613
|
93 |
next
|
50986
|
94 |
case Seq thus ?case by auto
|
47613
|
95 |
next
|
50986
|
96 |
case (If b p1 C1 p2 C2 P)
|
|
97 |
hence "post C1 \<sqsubseteq> post C1 \<squnion> post C2 \<and> post C2 \<sqsubseteq> post C1 \<squnion> post C2"
|
|
98 |
by(simp, metis post_in_L join_ge1 join_ge2)
|
|
99 |
thus ?case using If by (auto simp: mono_gamma_o)
|
47613
|
100 |
next
|
50986
|
101 |
case While thus ?case by (auto simp: mono_gamma_o)
|
47613
|
102 |
qed
|
|
103 |
|
49396
|
104 |
lemma step'_in_L[simp]:
|
|
105 |
"\<lbrakk> C \<in> L X; S \<in> L X \<rbrakk> \<Longrightarrow> (step' S C) \<in> L X"
|
47613
|
106 |
proof(induction C arbitrary: S)
|
|
107 |
case Assign thus ?case
|
49396
|
108 |
by(auto simp: L_st_def update_def split: option.splits)
|
47613
|
109 |
qed auto
|
|
110 |
|
50986
|
111 |
lemma AI_sound: "AI c = Some C \<Longrightarrow> CS c \<le> \<gamma>\<^isub>c C"
|
47613
|
112 |
proof(simp add: CS_def AI_def)
|
49464
|
113 |
assume 1: "pfp (step' (top c)) (bot c) = Some C"
|
49396
|
114 |
have "C \<in> L(vars c)"
|
49464
|
115 |
by(rule pfp_inv[where P = "%C. C \<in> L(vars c)", OF 1 _ bot_in_L])
|
49396
|
116 |
(erule step'_in_L[OF _ top_in_L])
|
50986
|
117 |
have pfp': "step' (top c) C \<sqsubseteq> C" by(rule pfp_pfp[OF 1])
|
|
118 |
have 2: "step (\<gamma>\<^isub>o(top c)) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c C"
|
|
119 |
proof(rule order_trans)
|
|
120 |
show "step (\<gamma>\<^isub>o (top c)) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c (step' (top c) C)"
|
|
121 |
by(rule step_step'[OF `C \<in> L(vars c)` top_in_L])
|
|
122 |
show "\<gamma>\<^isub>c (step' (top c) C) \<le> \<gamma>\<^isub>c C"
|
|
123 |
by(rule mono_gamma_c[OF pfp'])
|
47613
|
124 |
qed
|
50986
|
125 |
have 3: "strip (\<gamma>\<^isub>c C) = c" by(simp add: strip_pfp[OF _ 1])
|
|
126 |
have "lfp c (step (\<gamma>\<^isub>o(top c))) \<le> \<gamma>\<^isub>c C"
|
|
127 |
by(rule lfp_lowerbound[simplified,where f="step (\<gamma>\<^isub>o(top c))", OF 3 2])
|
|
128 |
thus "lfp c (step UNIV) \<le> \<gamma>\<^isub>c C" by simp
|
47613
|
129 |
qed
|
|
130 |
|
|
131 |
end
|
|
132 |
|
|
133 |
|
|
134 |
subsubsection "Monotonicity"
|
|
135 |
|
49396
|
136 |
lemma le_join_disj: "y \<in> L X \<Longrightarrow> (z::_::semilatticeL) \<in> L X \<Longrightarrow>
|
|
137 |
x \<sqsubseteq> y \<or> x \<sqsubseteq> z \<Longrightarrow> x \<sqsubseteq> y \<squnion> z"
|
47613
|
138 |
by (metis join_ge1 join_ge2 preord_class.le_trans)
|
|
139 |
|
|
140 |
locale Abs_Int_mono = Abs_Int +
|
|
141 |
assumes mono_plus': "a1 \<sqsubseteq> b1 \<Longrightarrow> a2 \<sqsubseteq> b2 \<Longrightarrow> plus' a1 a2 \<sqsubseteq> plus' b1 b2"
|
|
142 |
begin
|
|
143 |
|
49396
|
144 |
lemma mono_aval':
|
49402
|
145 |
"S1 \<sqsubseteq> S2 \<Longrightarrow> S1 \<in> L X \<Longrightarrow> S2 \<in> L X \<Longrightarrow> vars e \<subseteq> X \<Longrightarrow> aval' e S1 \<sqsubseteq> aval' e S2"
|
49396
|
146 |
by(induction e) (auto simp: le_st_def mono_plus' L_st_def)
|
47613
|
147 |
|
49396
|
148 |
theorem mono_step': "S1 \<in> L X \<Longrightarrow> S2 \<in> L X \<Longrightarrow> C1 \<in> L X \<Longrightarrow> C2 \<in> L X \<Longrightarrow>
|
47613
|
149 |
S1 \<sqsubseteq> S2 \<Longrightarrow> C1 \<sqsubseteq> C2 \<Longrightarrow> step' S1 C1 \<sqsubseteq> step' S2 C2"
|
|
150 |
apply(induction C1 C2 arbitrary: S1 S2 rule: le_acom.induct)
|
|
151 |
apply (auto simp: Let_def mono_aval' mono_post
|
49396
|
152 |
le_join_disj le_join_disj[OF post_in_L post_in_L]
|
47613
|
153 |
split: option.split)
|
|
154 |
done
|
|
155 |
|
49396
|
156 |
lemma mono_step'_top: "C \<in> L(vars c) \<Longrightarrow> C' \<in> L(vars c) \<Longrightarrow>
|
|
157 |
C \<sqsubseteq> C' \<Longrightarrow> step' (top c) C \<sqsubseteq> step' (top c) C'"
|
|
158 |
by (metis top_in_L mono_step' preord_class.le_refl)
|
47613
|
159 |
|
49464
|
160 |
lemma pfp_bot_least:
|
|
161 |
assumes "\<forall>x\<in>L(vars c)\<inter>{C. strip C = c}.\<forall>y\<in>L(vars c)\<inter>{C. strip C = c}.
|
|
162 |
x \<sqsubseteq> y \<longrightarrow> f x \<sqsubseteq> f y"
|
|
163 |
and "\<forall>C. C \<in> L(vars c)\<inter>{C. strip C = c} \<longrightarrow> f C \<in> L(vars c)\<inter>{C. strip C = c}"
|
|
164 |
and "f C' \<sqsubseteq> C'" "strip C' = c" "C' \<in> L(vars c)" "pfp f (bot c) = Some C"
|
|
165 |
shows "C \<sqsubseteq> C'"
|
|
166 |
apply(rule while_least[OF assms(1,2) _ _ assms(3) _ assms(6)[unfolded pfp_def]])
|
|
167 |
by (simp_all add: assms(4,5) bot_least)
|
|
168 |
|
|
169 |
lemma AI_least_pfp: assumes "AI c = Some C"
|
|
170 |
and "step' (top c) C' \<sqsubseteq> C'" "strip C' = c" "C' \<in> L(vars c)"
|
|
171 |
shows "C \<sqsubseteq> C'"
|
|
172 |
apply(rule pfp_bot_least[OF _ _ assms(2-4) assms(1)[unfolded AI_def]])
|
|
173 |
by (simp_all add: mono_step'_top)
|
|
174 |
|
47613
|
175 |
end
|
|
176 |
|
|
177 |
|
|
178 |
subsubsection "Termination"
|
|
179 |
|
|
180 |
abbreviation sqless (infix "\<sqsubset>" 50) where
|
|
181 |
"x \<sqsubset> y == x \<sqsubseteq> y \<and> \<not> y \<sqsubseteq> x"
|
|
182 |
|
|
183 |
lemma pfp_termination:
|
|
184 |
fixes x0 :: "'a::preord" and m :: "'a \<Rightarrow> nat"
|
|
185 |
assumes mono: "\<And>x y. I x \<Longrightarrow> I y \<Longrightarrow> x \<sqsubseteq> y \<Longrightarrow> f x \<sqsubseteq> f y"
|
|
186 |
and m: "\<And>x y. I x \<Longrightarrow> I y \<Longrightarrow> x \<sqsubset> y \<Longrightarrow> m x > m y"
|
|
187 |
and I: "\<And>x y. I x \<Longrightarrow> I(f x)" and "I x0" and "x0 \<sqsubseteq> f x0"
|
49464
|
188 |
shows "\<exists>x. pfp f x0 = Some x"
|
47613
|
189 |
proof(simp add: pfp_def, rule wf_while_option_Some[where P = "%x. I x & x \<sqsubseteq> f x"])
|
|
190 |
show "wf {(y,x). ((I x \<and> x \<sqsubseteq> f x) \<and> \<not> f x \<sqsubseteq> x) \<and> y = f x}"
|
|
191 |
by(rule wf_subset[OF wf_measure[of m]]) (auto simp: m I)
|
|
192 |
next
|
|
193 |
show "I x0 \<and> x0 \<sqsubseteq> f x0" using `I x0` `x0 \<sqsubseteq> f x0` by blast
|
|
194 |
next
|
|
195 |
fix x assume "I x \<and> x \<sqsubseteq> f x" thus "I(f x) \<and> f x \<sqsubseteq> f(f x)"
|
|
196 |
by (blast intro: I mono)
|
|
197 |
qed
|
|
198 |
|
|
199 |
|
49547
|
200 |
locale Measure1 =
|
|
201 |
fixes m :: "'av::preord \<Rightarrow> nat"
|
47613
|
202 |
fixes h :: "nat"
|
|
203 |
assumes m1: "x \<sqsubseteq> y \<Longrightarrow> m x \<ge> m y"
|
|
204 |
assumes h: "m x \<le> h"
|
|
205 |
begin
|
|
206 |
|
49547
|
207 |
definition m_s :: "'av st \<Rightarrow> nat" ("m\<^isub>s") where
|
|
208 |
"m_s S = (\<Sum> x \<in> dom S. m(fun S x))"
|
47613
|
209 |
|
49547
|
210 |
lemma m_s_h: "x \<in> L X \<Longrightarrow> finite X \<Longrightarrow> m_s x \<le> h * card X"
|
|
211 |
by(simp add: L_st_def m_s_def)
|
49431
|
212 |
(metis nat_mult_commute of_nat_id setsum_bounded[OF h])
|
|
213 |
|
49547
|
214 |
lemma m_s1: "S1 \<sqsubseteq> S2 \<Longrightarrow> m_s S1 \<ge> m_s S2"
|
|
215 |
proof(auto simp add: le_st_def m_s_def)
|
47613
|
216 |
assume "\<forall>x\<in>dom S2. fun S1 x \<sqsubseteq> fun S2 x"
|
|
217 |
hence "\<forall>x\<in>dom S2. m(fun S1 x) \<ge> m(fun S2 x)" by (metis m1)
|
|
218 |
thus "(\<Sum>x\<in>dom S2. m (fun S2 x)) \<le> (\<Sum>x\<in>dom S2. m (fun S1 x))"
|
|
219 |
by (metis setsum_mono)
|
|
220 |
qed
|
|
221 |
|
49432
|
222 |
definition m_o :: "nat \<Rightarrow> 'av st option \<Rightarrow> nat" ("m\<^isub>o") where
|
49547
|
223 |
"m_o d opt = (case opt of None \<Rightarrow> h*d+1 | Some S \<Rightarrow> m_s S)"
|
47613
|
224 |
|
49431
|
225 |
lemma m_o_h: "ost \<in> L X \<Longrightarrow> finite X \<Longrightarrow> m_o (card X) ost \<le> (h*card X + 1)"
|
49547
|
226 |
by(auto simp add: m_o_def m_s_h split: option.split dest!:m_s_h)
|
47613
|
227 |
|
49396
|
228 |
lemma m_o1: "finite X \<Longrightarrow> o1 \<in> L X \<Longrightarrow> o2 \<in> L X \<Longrightarrow>
|
47613
|
229 |
o1 \<sqsubseteq> o2 \<Longrightarrow> m_o (card X) o1 \<ge> m_o (card X) o2"
|
|
230 |
proof(induction o1 o2 rule: le_option.induct)
|
49547
|
231 |
case 1 thus ?case by (simp add: m_o_def)(metis m_s1)
|
47613
|
232 |
next
|
|
233 |
case 2 thus ?case
|
49547
|
234 |
by(simp add: L_option_def m_o_def le_SucI m_s_h split: option.splits)
|
47613
|
235 |
next
|
|
236 |
case 3 thus ?case by simp
|
|
237 |
qed
|
|
238 |
|
49432
|
239 |
definition m_c :: "'av st option acom \<Rightarrow> nat" ("m\<^isub>c") where
|
49431
|
240 |
"m_c C = (\<Sum>i<size(annos C). m_o (card(vars(strip C))) (annos C ! i))"
|
|
241 |
|
|
242 |
lemma m_c_h: assumes "C \<in> L(vars(strip C))"
|
|
243 |
shows "m_c C \<le> size(annos C) * (h * card(vars(strip C)) + 1)"
|
|
244 |
proof-
|
|
245 |
let ?X = "vars(strip C)" let ?n = "card ?X" let ?a = "size(annos C)"
|
|
246 |
{ fix i assume "i < ?a"
|
|
247 |
hence "annos C ! i \<in> L ?X" using assms by(simp add: L_acom_def)
|
|
248 |
note m_o_h[OF this finite_cvars]
|
|
249 |
} note 1 = this
|
|
250 |
have "m_c C = (\<Sum>i<?a. m_o ?n (annos C ! i))" by(simp add: m_c_def)
|
|
251 |
also have "\<dots> \<le> (\<Sum>i<?a. h * ?n + 1)"
|
|
252 |
apply(rule setsum_mono) using 1 by simp
|
|
253 |
also have "\<dots> = ?a * (h * ?n + 1)" by simp
|
|
254 |
finally show ?thesis .
|
|
255 |
qed
|
|
256 |
|
49547
|
257 |
end
|
|
258 |
|
|
259 |
locale Measure = Measure1 +
|
|
260 |
assumes m2: "x \<sqsubset> y \<Longrightarrow> m x > m y"
|
|
261 |
begin
|
|
262 |
|
|
263 |
lemma m_s2: "finite(dom S1) \<Longrightarrow> S1 \<sqsubset> S2 \<Longrightarrow> m_s S1 > m_s S2"
|
|
264 |
proof(auto simp add: le_st_def m_s_def)
|
|
265 |
assume "finite(dom S2)" and 0: "\<forall>x\<in>dom S2. fun S1 x \<sqsubseteq> fun S2 x"
|
|
266 |
hence 1: "\<forall>x\<in>dom S2. m(fun S1 x) \<ge> m(fun S2 x)" by (metis m1)
|
|
267 |
fix x assume "x \<in> dom S2" "\<not> fun S2 x \<sqsubseteq> fun S1 x"
|
|
268 |
hence 2: "\<exists>x\<in>dom S2. m(fun S1 x) > m(fun S2 x)" using 0 m2 by blast
|
|
269 |
from setsum_strict_mono_ex1[OF `finite(dom S2)` 1 2]
|
|
270 |
show "(\<Sum>x\<in>dom S2. m (fun S2 x)) < (\<Sum>x\<in>dom S2. m (fun S1 x))" .
|
|
271 |
qed
|
|
272 |
|
|
273 |
lemma m_o2: "finite X \<Longrightarrow> o1 \<in> L X \<Longrightarrow> o2 \<in> L X \<Longrightarrow>
|
|
274 |
o1 \<sqsubset> o2 \<Longrightarrow> m_o (card X) o1 > m_o (card X) o2"
|
|
275 |
proof(induction o1 o2 rule: le_option.induct)
|
|
276 |
case 1 thus ?case by (simp add: m_o_def L_st_def m_s2)
|
|
277 |
next
|
|
278 |
case 2 thus ?case
|
|
279 |
by(auto simp add: m_o_def le_imp_less_Suc m_s_h)
|
|
280 |
next
|
|
281 |
case 3 thus ?case by simp
|
|
282 |
qed
|
|
283 |
|
|
284 |
|
49396
|
285 |
lemma m_c2: "C1 \<in> L(vars(strip C1)) \<Longrightarrow> C2 \<in> L(vars(strip C2)) \<Longrightarrow>
|
|
286 |
C1 \<sqsubset> C2 \<Longrightarrow> m_c C1 > m_c C2"
|
|
287 |
proof(auto simp add: le_iff_le_annos m_c_def size_annos_same[of C1 C2] L_acom_def)
|
|
288 |
let ?X = "vars(strip C2)"
|
47613
|
289 |
let ?n = "card ?X"
|
49396
|
290 |
assume V1: "\<forall>a\<in>set(annos C1). a \<in> L ?X"
|
|
291 |
and V2: "\<forall>a\<in>set(annos C2). a \<in> L ?X"
|
|
292 |
and strip_eq: "strip C1 = strip C2"
|
|
293 |
and 0: "\<forall>i<size(annos C2). annos C1 ! i \<sqsubseteq> annos C2 ! i"
|
|
294 |
hence 1: "\<forall>i<size(annos C2). m_o ?n (annos C1 ! i) \<ge> m_o ?n (annos C2 ! i)"
|
47613
|
295 |
by (auto simp: all_set_conv_all_nth)
|
|
296 |
(metis finite_cvars m_o1 size_annos_same2)
|
49396
|
297 |
fix i assume "i < size(annos C2)" "\<not> annos C2 ! i \<sqsubseteq> annos C1 ! i"
|
|
298 |
hence "m_o ?n (annos C1 ! i) > m_o ?n (annos C2 ! i)" (is "?P i")
|
|
299 |
by(metis m_o2[OF finite_cvars] V1 V2 nth_mem size_annos_same[OF strip_eq] 0)
|
|
300 |
hence 2: "\<exists>i < size(annos C2). ?P i" using `i < size(annos C2)` by blast
|
|
301 |
show "(\<Sum>i<size(annos C2). m_o ?n (annos C2 ! i))
|
|
302 |
< (\<Sum>i<size(annos C2). m_o ?n (annos C1 ! i))"
|
47613
|
303 |
apply(rule setsum_strict_mono_ex1) using 1 2 by (auto)
|
|
304 |
qed
|
|
305 |
|
49547
|
306 |
end
|
|
307 |
|
|
308 |
locale Abs_Int_measure =
|
|
309 |
Abs_Int_mono where \<gamma>=\<gamma> + Measure where m=m
|
|
310 |
for \<gamma> :: "'av::semilattice \<Rightarrow> val set" and m :: "'av \<Rightarrow> nat"
|
|
311 |
begin
|
|
312 |
|
47613
|
313 |
lemma AI_Some_measure: "\<exists>C. AI c = Some C"
|
|
314 |
unfolding AI_def
|
49464
|
315 |
apply(rule pfp_termination[where I = "%C. strip C = c \<and> C \<in> L(vars c)"
|
47613
|
316 |
and m="m_c"])
|
49464
|
317 |
apply(simp_all add: m_c2 mono_step'_top bot_least)
|
47613
|
318 |
done
|
|
319 |
|
|
320 |
end
|
|
321 |
|
|
322 |
end
|