author | nipkow |
Sun, 10 Mar 2013 18:29:10 +0100 | |
changeset 51389 | 8a9f0503b1c0 |
parent 51359 | 00b45c7e831f |
child 51390 | 1dff81cf425b |
permissions | -rw-r--r-- |
47613 | 1 |
(* Author: Tobias Nipkow *) |
2 |
||
3 |
theory Abs_Int2 |
|
4 |
imports Abs_Int1 |
|
5 |
begin |
|
6 |
||
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
7 |
instantiation prod :: (order,order) order |
47613 | 8 |
begin |
9 |
||
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
10 |
definition "less_eq_prod p1 p2 = (fst p1 \<le> fst p2 \<and> snd p1 \<le> snd p2)" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
11 |
definition "less_prod p1 p2 = (p1 \<le> p2 \<and> \<not> p2 \<le> (p1::'a*'b))" |
47613 | 12 |
|
13 |
instance |
|
14 |
proof |
|
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
15 |
case goal1 show ?case by(rule less_prod_def) |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
16 |
next |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
17 |
case goal2 show ?case by(simp add: less_eq_prod_def) |
47613 | 18 |
next |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
19 |
case goal3 thus ?case unfolding less_eq_prod_def by(metis order_trans) |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
20 |
next |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
21 |
case goal4 thus ?case by(simp add: less_eq_prod_def)(metis eq_iff surjective_pairing) |
47613 | 22 |
qed |
23 |
||
24 |
end |
|
25 |
||
26 |
||
27 |
subsection "Backward Analysis of Expressions" |
|
28 |
||
51389 | 29 |
class lattice = semilattice + semilattice_inf + bot |
47613 | 30 |
|
31 |
locale Val_abs1_gamma = |
|
49396 | 32 |
Gamma where \<gamma> = \<gamma> for \<gamma> :: "'av::lattice \<Rightarrow> val set" + |
47613 | 33 |
assumes inter_gamma_subset_gamma_meet: |
34 |
"\<gamma> a1 \<inter> \<gamma> a2 \<subseteq> \<gamma>(a1 \<sqinter> a2)" |
|
49396 | 35 |
and gamma_bot[simp]: "\<gamma> \<bottom> = {}" |
47613 | 36 |
begin |
37 |
||
38 |
lemma in_gamma_meet: "x : \<gamma> a1 \<Longrightarrow> x : \<gamma> a2 \<Longrightarrow> x : \<gamma>(a1 \<sqinter> a2)" |
|
39 |
by (metis IntI inter_gamma_subset_gamma_meet set_mp) |
|
40 |
||
41 |
lemma gamma_meet[simp]: "\<gamma>(a1 \<sqinter> a2) = \<gamma> a1 \<inter> \<gamma> a2" |
|
51389 | 42 |
by(rule equalityI[OF _ inter_gamma_subset_gamma_meet]) |
43 |
(metis inf_le1 inf_le2 le_inf_iff mono_gamma) |
|
47613 | 44 |
|
45 |
end |
|
46 |
||
47 |
||
48 |
locale Val_abs1 = |
|
49 |
Val_abs1_gamma where \<gamma> = \<gamma> |
|
49396 | 50 |
for \<gamma> :: "'av::lattice \<Rightarrow> val set" + |
47613 | 51 |
fixes test_num' :: "val \<Rightarrow> 'av \<Rightarrow> bool" |
52 |
and filter_plus' :: "'av \<Rightarrow> 'av \<Rightarrow> 'av \<Rightarrow> 'av * 'av" |
|
53 |
and filter_less' :: "bool \<Rightarrow> 'av \<Rightarrow> 'av \<Rightarrow> 'av * 'av" |
|
51036 | 54 |
assumes test_num': "test_num' n a = (n : \<gamma> a)" |
47613 | 55 |
and filter_plus': "filter_plus' a a1 a2 = (b1,b2) \<Longrightarrow> |
51036 | 56 |
n1 : \<gamma> a1 \<Longrightarrow> n2 : \<gamma> a2 \<Longrightarrow> n1+n2 : \<gamma> a \<Longrightarrow> n1 : \<gamma> b1 \<and> n2 : \<gamma> b2" |
57 |
and filter_less': "filter_less' (n1<n2) a1 a2 = (b1,b2) \<Longrightarrow> |
|
58 |
n1 : \<gamma> a1 \<Longrightarrow> n2 : \<gamma> a2 \<Longrightarrow> n1 : \<gamma> b1 \<and> n2 : \<gamma> b2" |
|
47613 | 59 |
|
60 |
||
61 |
locale Abs_Int1 = |
|
49396 | 62 |
Val_abs1 where \<gamma> = \<gamma> for \<gamma> :: "'av::lattice \<Rightarrow> val set" |
47613 | 63 |
begin |
64 |
||
51389 | 65 |
lemma in_gamma_sup_UpI: |
49396 | 66 |
"S1 \<in> L X \<Longrightarrow> S2 \<in> L X \<Longrightarrow> s : \<gamma>\<^isub>o S1 \<or> s : \<gamma>\<^isub>o S2 \<Longrightarrow> s : \<gamma>\<^isub>o(S1 \<squnion> S2)" |
51389 | 67 |
by (metis (hide_lams, no_types) semilatticeL_class.sup_ge1 semilatticeL_class.sup_ge2 mono_gamma_o subsetD) |
47613 | 68 |
|
69 |
fun aval'' :: "aexp \<Rightarrow> 'av st option \<Rightarrow> 'av" where |
|
70 |
"aval'' e None = \<bottom>" | |
|
71 |
"aval'' e (Some sa) = aval' e sa" |
|
72 |
||
49396 | 73 |
lemma aval''_sound: "s : \<gamma>\<^isub>o S \<Longrightarrow> S \<in> L X \<Longrightarrow> vars a \<subseteq> X \<Longrightarrow> aval a s : \<gamma>(aval'' a S)" |
74 |
by(simp add: L_option_def L_st_def aval'_sound split: option.splits) |
|
47613 | 75 |
|
76 |
subsubsection "Backward analysis" |
|
77 |
||
78 |
fun afilter :: "aexp \<Rightarrow> 'av \<Rightarrow> 'av st option \<Rightarrow> 'av st option" where |
|
51036 | 79 |
"afilter (N n) a S = (if test_num' n a then S else None)" | |
47613 | 80 |
"afilter (V x) a S = (case S of None \<Rightarrow> None | Some S \<Rightarrow> |
81 |
let a' = fun S x \<sqinter> a in |
|
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
82 |
if a' = \<bottom> then None else Some(update S x a'))" | |
47613 | 83 |
"afilter (Plus e1 e2) a S = |
51036 | 84 |
(let (a1,a2) = filter_plus' a (aval'' e1 S) (aval'' e2 S) |
85 |
in afilter e1 a1 (afilter e2 a2 S))" |
|
47613 | 86 |
|
87 |
text{* The test for @{const bot} in the @{const V}-case is important: @{const |
|
88 |
bot} indicates that a variable has no possible values, i.e.\ that the current |
|
89 |
program point is unreachable. But then the abstract state should collapse to |
|
90 |
@{const None}. Put differently, we maintain the invariant that in an abstract |
|
91 |
state of the form @{term"Some s"}, all variables are mapped to non-@{const |
|
51389 | 92 |
bot} values. Otherwise the (pointwise) sup of two abstract states, one of |
47613 | 93 |
which contains @{const bot} values, may produce too large a result, thus |
94 |
making the analysis less precise. *} |
|
95 |
||
96 |
||
97 |
fun bfilter :: "bexp \<Rightarrow> bool \<Rightarrow> 'av st option \<Rightarrow> 'av st option" where |
|
98 |
"bfilter (Bc v) res S = (if v=res then S else None)" | |
|
99 |
"bfilter (Not b) res S = bfilter b (\<not> res) S" | |
|
100 |
"bfilter (And b1 b2) res S = |
|
101 |
(if res then bfilter b1 True (bfilter b2 True S) |
|
102 |
else bfilter b1 False S \<squnion> bfilter b2 False S)" | |
|
103 |
"bfilter (Less e1 e2) res S = |
|
51037 | 104 |
(let (a1,a2) = filter_less' res (aval'' e1 S) (aval'' e2 S) |
105 |
in afilter e1 a1 (afilter e2 a2 S))" |
|
47613 | 106 |
|
49396 | 107 |
lemma afilter_in_L: "S \<in> L X \<Longrightarrow> vars e \<subseteq> X \<Longrightarrow> afilter e a S \<in> L X" |
47613 | 108 |
by(induction e arbitrary: a S) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
109 |
(auto simp: Let_def L_st_def split: option.splits prod.split) |
47613 | 110 |
|
49396 | 111 |
lemma afilter_sound: "S \<in> L X \<Longrightarrow> vars e \<subseteq> X \<Longrightarrow> |
47613 | 112 |
s : \<gamma>\<^isub>o S \<Longrightarrow> aval e s : \<gamma> a \<Longrightarrow> s : \<gamma>\<^isub>o (afilter e a S)" |
113 |
proof(induction e arbitrary: a S) |
|
114 |
case N thus ?case by simp (metis test_num') |
|
115 |
next |
|
116 |
case (V x) |
|
49497 | 117 |
obtain S' where "S = Some S'" and "s : \<gamma>\<^isub>s S'" using `s : \<gamma>\<^isub>o S` |
47613 | 118 |
by(auto simp: in_gamma_option_iff) |
119 |
moreover hence "s x : \<gamma> (fun S' x)" |
|
49396 | 120 |
using V(1,2) by(simp add: \<gamma>_st_def L_st_def) |
47613 | 121 |
moreover have "s x : \<gamma> a" using V by simp |
122 |
ultimately show ?case using V(3) |
|
123 |
by(simp add: Let_def \<gamma>_st_def) |
|
49396 | 124 |
(metis mono_gamma emptyE in_gamma_meet gamma_bot subset_empty) |
47613 | 125 |
next |
126 |
case (Plus e1 e2) thus ?case |
|
127 |
using filter_plus'[OF _ aval''_sound[OF Plus.prems(3)] aval''_sound[OF Plus.prems(3)]] |
|
49396 | 128 |
by (auto simp: afilter_in_L split: prod.split) |
47613 | 129 |
qed |
130 |
||
49396 | 131 |
lemma bfilter_in_L: "S \<in> L X \<Longrightarrow> vars b \<subseteq> X \<Longrightarrow> bfilter b bv S \<in> L X" |
132 |
by(induction b arbitrary: bv S)(auto simp: afilter_in_L split: prod.split) |
|
47613 | 133 |
|
49396 | 134 |
lemma bfilter_sound: "S \<in> L X \<Longrightarrow> vars b \<subseteq> X \<Longrightarrow> |
47613 | 135 |
s : \<gamma>\<^isub>o S \<Longrightarrow> bv = bval b s \<Longrightarrow> s : \<gamma>\<^isub>o(bfilter b bv S)" |
136 |
proof(induction b arbitrary: S bv) |
|
137 |
case Bc thus ?case by simp |
|
138 |
next |
|
139 |
case (Not b) thus ?case by simp |
|
140 |
next |
|
141 |
case (And b1 b2) thus ?case |
|
51389 | 142 |
by simp (metis And(1) And(2) bfilter_in_L in_gamma_sup_UpI) |
47613 | 143 |
next |
144 |
case (Less e1 e2) thus ?case |
|
145 |
by(auto split: prod.split) |
|
49396 | 146 |
(metis (lifting) afilter_in_L afilter_sound aval''_sound filter_less') |
47613 | 147 |
qed |
148 |
||
51389 | 149 |
(* Interpretation would be nicer but is impossible *) |
150 |
definition "step' = Step.Step |
|
151 |
(\<lambda>x e S. case S of None \<Rightarrow> None | Some S \<Rightarrow> Some(update S x (aval' e S))) |
|
152 |
(\<lambda>b S. bfilter b True S)" |
|
47613 | 153 |
|
51389 | 154 |
lemma [code,simp]: "step' S (SKIP {P}) = (SKIP {S})" |
155 |
by(simp add: step'_def Step.Step.simps) |
|
156 |
lemma [code,simp]: "step' S (x ::= e {P}) = |
|
157 |
x ::= e {case S of None \<Rightarrow> None | Some S \<Rightarrow> Some(update S x (aval' e S))}" |
|
158 |
by(simp add: step'_def Step.Step.simps) |
|
159 |
lemma [code,simp]: "step' S (C1; C2) = step' S C1; step' (post C1) C2" |
|
160 |
by(simp add: step'_def Step.Step.simps) |
|
161 |
lemma [code,simp]: "step' S (IF b THEN {P1} C1 ELSE {P2} C2 {Q}) = |
|
162 |
(let P1' = bfilter b True S; C1' = step' P1 C1; |
|
163 |
P2' = bfilter b False S; C2' = step' P2 C2 |
|
164 |
in IF b THEN {P1'} C1' ELSE {P2'} C2' {post C1 \<squnion> post C2})" |
|
165 |
by(simp add: step'_def Step.Step.simps) |
|
166 |
lemma [code,simp]: "step' S ({I} WHILE b DO {p} C {Q}) = |
|
47613 | 167 |
{S \<squnion> post C} |
49095 | 168 |
WHILE b DO {bfilter b True I} step' p C |
169 |
{bfilter b False I}" |
|
51389 | 170 |
by(simp add: step'_def Step.Step.simps) |
47613 | 171 |
|
172 |
definition AI :: "com \<Rightarrow> 'av st option acom option" where |
|
51036 | 173 |
"AI c = pfp (step' \<top>\<^bsub>vars c\<^esub>) (bot c)" |
47613 | 174 |
|
175 |
lemma strip_step'[simp]: "strip(step' S c) = strip c" |
|
176 |
by(induct c arbitrary: S) (simp_all add: Let_def) |
|
177 |
||
178 |
||
179 |
subsubsection "Soundness" |
|
180 |
||
181 |
lemma in_gamma_update: |
|
49497 | 182 |
"\<lbrakk> s : \<gamma>\<^isub>s S; i : \<gamma> a \<rbrakk> \<Longrightarrow> s(x := i) : \<gamma>\<^isub>s(update S x a)" |
47613 | 183 |
by(simp add: \<gamma>_st_def) |
184 |
||
50986 | 185 |
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)" |
186 |
proof(induction C arbitrary: S) |
|
187 |
case SKIP thus ?case by auto |
|
47613 | 188 |
next |
189 |
case Assign thus ?case |
|
50986 | 190 |
by (fastforce simp: L_st_def intro: aval'_sound in_gamma_update split: option.splits) |
47613 | 191 |
next |
50986 | 192 |
case Seq thus ?case by auto |
47613 | 193 |
next |
50986 | 194 |
case (If b _ C1 _ C2) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
195 |
hence 0: "post C1 \<le> post C1 \<squnion> post C2 \<and> post C2 \<le> post C1 \<squnion> post C2" |
51389 | 196 |
by(simp, metis post_in_L sup_ge1 sup_ge2) |
50986 | 197 |
have "vars b \<subseteq> X" using If.prems by simp |
198 |
note vars = `S \<in> L X` `vars b \<subseteq> X` |
|
199 |
show ?case using If 0 |
|
200 |
by (auto simp: mono_gamma_o bfilter_sound[OF vars] bfilter_in_L[OF vars]) |
|
47613 | 201 |
next |
50986 | 202 |
case (While I b) |
203 |
hence vars: "I \<in> L X" "vars b \<subseteq> X" by simp_all |
|
204 |
thus ?case using While |
|
205 |
by (auto simp: mono_gamma_o bfilter_sound[OF vars] bfilter_in_L[OF vars]) |
|
47613 | 206 |
qed |
207 |
||
50986 | 208 |
lemma step'_in_L[simp]: "\<lbrakk> C \<in> L X; S \<in> L X \<rbrakk> \<Longrightarrow> step' S C \<in> L X" |
47613 | 209 |
proof(induction C arbitrary: S) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
210 |
case Assign thus ?case by(auto simp add: L_option_def L_st_def split: option.splits) |
49396 | 211 |
qed (auto simp add: bfilter_in_L) |
47613 | 212 |
|
50986 | 213 |
lemma AI_sound: "AI c = Some C \<Longrightarrow> CS c \<le> \<gamma>\<^isub>c C" |
47613 | 214 |
proof(simp add: CS_def AI_def) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
215 |
assume 1: "pfp (step' (Top(vars c))) (bot c) = Some C" |
49396 | 216 |
have "C \<in> L(vars c)" |
49464 | 217 |
by(rule pfp_inv[where P = "%C. C \<in> L(vars c)", OF 1 _ bot_in_L]) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
218 |
(erule step'_in_L[OF _ Top_in_L]) |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
219 |
have pfp': "step' (Top(vars c)) C \<le> C" by(rule pfp_pfp[OF 1]) |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
220 |
have 2: "step (\<gamma>\<^isub>o(Top(vars c))) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c C" |
50986 | 221 |
proof(rule order_trans) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
222 |
show "step (\<gamma>\<^isub>o (Top(vars c))) (\<gamma>\<^isub>c C) \<le> \<gamma>\<^isub>c (step' (Top(vars c)) C)" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
223 |
by(rule step_step'[OF `C \<in> L(vars c)` Top_in_L]) |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
224 |
show "\<gamma>\<^isub>c (step' (Top(vars c)) C) \<le> \<gamma>\<^isub>c C" |
50986 | 225 |
by(rule mono_gamma_c[OF pfp']) |
47613 | 226 |
qed |
50986 | 227 |
have 3: "strip (\<gamma>\<^isub>c C) = c" by(simp add: strip_pfp[OF _ 1]) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
228 |
have "lfp c (step (\<gamma>\<^isub>o(Top(vars c)))) \<le> \<gamma>\<^isub>c C" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
229 |
by(rule lfp_lowerbound[simplified,where f="step (\<gamma>\<^isub>o(Top(vars c)))", OF 3 2]) |
50986 | 230 |
thus "lfp c (step UNIV) \<le> \<gamma>\<^isub>c C" by simp |
47613 | 231 |
qed |
232 |
||
233 |
end |
|
234 |
||
235 |
||
236 |
subsubsection "Monotonicity" |
|
237 |
||
238 |
locale Abs_Int1_mono = Abs_Int1 + |
|
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
239 |
assumes mono_plus': "a1 \<le> b1 \<Longrightarrow> a2 \<le> b2 \<Longrightarrow> plus' a1 a2 \<le> plus' b1 b2" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
240 |
and mono_filter_plus': "a1 \<le> b1 \<Longrightarrow> a2 \<le> b2 \<Longrightarrow> r \<le> r' \<Longrightarrow> |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
241 |
filter_plus' r a1 a2 \<le> filter_plus' r' b1 b2" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
242 |
and mono_filter_less': "a1 \<le> b1 \<Longrightarrow> a2 \<le> b2 \<Longrightarrow> |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
243 |
filter_less' bv a1 a2 \<le> filter_less' bv b1 b2" |
47613 | 244 |
begin |
245 |
||
246 |
lemma mono_aval': |
|
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
247 |
"S1 \<le> S2 \<Longrightarrow> S1 \<in> L X \<Longrightarrow> vars e \<subseteq> X \<Longrightarrow> aval' e S1 \<le> aval' e S2" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
248 |
by(induction e) (auto simp: less_eq_st_def mono_plus' L_st_def) |
47613 | 249 |
|
250 |
lemma mono_aval'': |
|
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
251 |
"S1 \<le> S2 \<Longrightarrow> S1 \<in> L X \<Longrightarrow> vars e \<subseteq> X \<Longrightarrow> aval'' e S1 \<le> aval'' e S2" |
47613 | 252 |
apply(cases S1) |
253 |
apply simp |
|
254 |
apply(cases S2) |
|
255 |
apply simp |
|
256 |
by (simp add: mono_aval') |
|
257 |
||
49396 | 258 |
lemma mono_afilter: "S1 \<in> L X \<Longrightarrow> S2 \<in> L X \<Longrightarrow> vars e \<subseteq> X \<Longrightarrow> |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
259 |
r1 \<le> r2 \<Longrightarrow> S1 \<le> S2 \<Longrightarrow> afilter e r1 S1 \<le> afilter e r2 S2" |
47613 | 260 |
apply(induction e arbitrary: r1 r2 S1 S2) |
51389 | 261 |
apply(auto simp: test_num' Let_def inf_mono split: option.splits prod.splits) |
47613 | 262 |
apply (metis mono_gamma subsetD) |
51389 | 263 |
apply (metis inf_mono le_bot mono_fun_L) |
264 |
apply (metis inf_mono mono_fun_L mono_update) |
|
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
265 |
apply(metis mono_aval'' mono_filter_plus'[simplified less_eq_prod_def] fst_conv snd_conv afilter_in_L) |
47613 | 266 |
done |
267 |
||
49396 | 268 |
lemma mono_bfilter: "S1 \<in> L X \<Longrightarrow> S2 \<in> L X \<Longrightarrow> vars b \<subseteq> X \<Longrightarrow> |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
269 |
S1 \<le> S2 \<Longrightarrow> bfilter b bv S1 \<le> bfilter b bv S2" |
47613 | 270 |
apply(induction b arbitrary: bv S1 S2) |
271 |
apply(simp) |
|
272 |
apply(simp) |
|
273 |
apply simp |
|
51389 | 274 |
apply(metis sup_least order_trans[OF _ sup_ge1] order_trans[OF _ sup_ge2] bfilter_in_L) |
47613 | 275 |
apply (simp split: prod.splits) |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
276 |
apply(metis mono_aval'' mono_afilter mono_filter_less'[simplified less_eq_prod_def] fst_conv snd_conv afilter_in_L) |
47613 | 277 |
done |
278 |
||
49396 | 279 |
theorem mono_step': "S1 \<in> L X \<Longrightarrow> S2 \<in> L X \<Longrightarrow> C1 \<in> L X \<Longrightarrow> C2 \<in> L X \<Longrightarrow> |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
280 |
S1 \<le> S2 \<Longrightarrow> C1 \<le> C2 \<Longrightarrow> step' S1 C1 \<le> step' S2 C2" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
281 |
apply(induction C1 C2 arbitrary: S1 S2 rule: less_eq_acom.induct) |
47613 | 282 |
apply (auto simp: Let_def mono_bfilter mono_aval' mono_post |
51389 | 283 |
le_sup_disj le_sup_disj[OF post_in_L post_in_L] bfilter_in_L |
47613 | 284 |
split: option.split) |
285 |
done |
|
286 |
||
51036 | 287 |
lemma mono_step'_top: "C1 \<in> L X \<Longrightarrow> C2 \<in> L X \<Longrightarrow> |
51359
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
288 |
C1 \<le> C2 \<Longrightarrow> step' (Top X) C1 \<le> step' (Top X) C2" |
00b45c7e831f
major redesign: order instead of preorder, new definition of intervals as quotients
nipkow
parents:
51037
diff
changeset
|
289 |
by (metis Top_in_L mono_step' order_refl) |
47613 | 290 |
|
291 |
end |
|
292 |
||
293 |
end |