77
|
1 |
(*<*)
|
|
2 |
theory S2ss_prop
|
92
|
3 |
imports Main Flask Flask_type Static Static_type Init_prop Tainted_prop Valid_prop Alive_prop Co2sobj_prop Dalive_prop
|
77
|
4 |
begin
|
|
5 |
(*>*)
|
|
6 |
|
|
7 |
context tainting_s begin
|
|
8 |
|
|
9 |
(* simpset for s2ss*)
|
|
10 |
|
|
11 |
lemma s2ss_execve':
|
|
12 |
"valid (Execve p f fds # s) \<Longrightarrow> s2ss (Execve p f fds # s) = (
|
92
|
13 |
if (\<exists> p'. p' \<noteq> p \<and> p' \<in> current_procs s \<and> co2sobj s (D_proc p') = co2sobj s (D_proc p))
|
77
|
14 |
then (case (cp2sproc (Execve p f fds # s) p) of
|
|
15 |
Some sp \<Rightarrow> s2ss s \<union> {S_proc sp (O_proc p \<in> tainted s \<or> O_file f \<in> tainted s)}
|
|
16 |
| _ \<Rightarrow> {} )
|
|
17 |
else (case (cp2sproc (Execve p f fds # s) p, cp2sproc s p) of
|
|
18 |
(Some sp, Some sp') \<Rightarrow> s2ss s - {S_proc sp' (O_proc p \<in> tainted s)}
|
|
19 |
\<union> {S_proc sp (O_proc p \<in> tainted s \<or> O_file f \<in> tainted s)}
|
|
20 |
| _ \<Rightarrow> {} ) )"
|
|
21 |
apply (frule vd_cons, frule vt_grant_os, simp split:if_splits)
|
|
22 |
|
|
23 |
apply (rule conjI, rule impI, (erule exE|erule conjE)+)
|
|
24 |
apply (frule_tac p = p in current_proc_has_sp, simp, erule exE)
|
|
25 |
apply (frule_tac p = p' in current_proc_has_sp, simp, erule exE, simp)
|
|
26 |
apply (subgoal_tac "p \<in> current_procs (Execve p f fds # s)")
|
|
27 |
apply (drule_tac p = p and s = "Execve p f fds # s" in current_proc_has_sp, simp)
|
|
28 |
apply (erule exE, simp)
|
|
29 |
apply (simp add:s2ss_def, rule set_eqI, rule iffI)
|
|
30 |
apply (drule CollectD, (erule exE|erule conjE)+)
|
92
|
31 |
apply (case_tac "obj = D_proc p")
|
77
|
32 |
apply (simp add:co2sobj_execve split:if_splits)
|
|
33 |
apply (simp add:co2sobj_execve, rule disjI2)
|
92
|
34 |
apply (rule_tac x = obj in exI, case_tac obj, (simp add:dalive_simps)+)[1]
|
77
|
35 |
apply (simp, erule disjE)
|
92
|
36 |
apply (rule_tac x = "D_proc p" in exI, simp)
|
77
|
37 |
apply (erule exE| erule conjE)+
|
|
38 |
apply (case_tac "x = S_proc sp (O_proc p \<in> tainted s)")
|
92
|
39 |
apply (rule_tac x = "D_proc p'" in exI)
|
|
40 |
apply (simp add:dalive_execve co2sobj_execve cp2sproc_execve)
|
|
41 |
apply (case_tac "obj = D_proc p", simp, simp add:dalive_execve)
|
|
42 |
apply (frule_tac obj = obj in co2sobj_execve, simp add:dalive_execve)
|
77
|
43 |
apply (rule_tac x = obj in exI, simp, simp)
|
|
44 |
|
|
45 |
apply (erule conjE, frule current_proc_has_sp, simp, erule exE, rule impI, simp)
|
|
46 |
apply (subgoal_tac "p \<in> current_procs (Execve p f fds # s)")
|
|
47 |
apply (drule_tac p = p and s = "Execve p f fds # s" in current_proc_has_sp, simp)
|
|
48 |
apply (erule exE, erule conjE, simp)
|
|
49 |
apply (simp add:s2ss_def, rule set_eqI, rule iffI)
|
|
50 |
apply (drule CollectD, (erule exE|erule conjE)+)
|
92
|
51 |
apply (case_tac "obj = D_proc p", simp)
|
77
|
52 |
apply (rule disjI1, simp split:if_splits)
|
|
53 |
apply (simp add:co2sobj_execve, rule disjI2)
|
92
|
54 |
apply (rule conjI,rule_tac x = obj in exI, simp add:dalive_simps split:t_object.splits)
|
77
|
55 |
apply (rule notI, simp, case_tac obj)
|
|
56 |
apply (erule_tac x = nat in allE, simp, (simp split:option.splits)+)
|
|
57 |
apply (erule disjE, simp)
|
92
|
58 |
apply (rule_tac x = "D_proc p" in exI, simp)
|
77
|
59 |
apply (erule exE|erule conjE)+
|
92
|
60 |
apply (rule_tac x = obj in exI, simp add:dalive_execve)
|
|
61 |
apply (frule_tac obj = obj in co2sobj_execve, simp add:dalive_execve, simp)
|
77
|
62 |
apply (rule impI, simp, simp)
|
|
63 |
done
|
|
64 |
|
|
65 |
lemma s2ss_clone:
|
|
66 |
"valid (Clone p p' fds # s) \<Longrightarrow> s2ss (Clone p p' fds # s) = (
|
|
67 |
case (cp2sproc (Clone p p' fds # s) p') of
|
|
68 |
Some sp \<Rightarrow> s2ss s \<union> {S_proc sp (O_proc p \<in> tainted s)}
|
|
69 |
| _ \<Rightarrow> {})"
|
|
70 |
apply (frule vd_cons, frule vt_grant_os, split option.splits)
|
|
71 |
apply (rule conjI, rule impI, drule current_proc_has_sp', simp, simp)
|
|
72 |
apply (rule allI, rule impI, simp add:s2ss_def)
|
|
73 |
apply (rule set_eqI, rule iffI, drule CollectD, (erule exE|erule conjE)+)
|
92
|
74 |
apply (case_tac "obj = D_proc p'", simp)
|
77
|
75 |
apply (case_tac "O_proc p' \<in> tainted s", drule tainted_in_current, simp+)
|
|
76 |
apply (rule disjI1, simp split:if_splits)
|
|
77 |
apply (simp, rule disjI2)
|
|
78 |
apply (frule co2sobj_clone, simp)
|
92
|
79 |
apply (rule_tac x = obj in exI)
|
|
80 |
apply (simp add:dalive_simps split:t_dobject.splits)
|
77
|
81 |
|
|
82 |
apply (simp, erule disjE, simp)
|
92
|
83 |
apply (rule_tac x = "D_proc p'" in exI, simp)
|
77
|
84 |
apply (rule impI, rule notI, drule tainted_in_current, simp+)
|
|
85 |
apply (erule exE| erule conjE)+
|
92
|
86 |
apply (case_tac "obj = D_proc p'", simp)
|
77
|
87 |
apply (rule_tac x = obj in exI)
|
92
|
88 |
apply (frule dalive_clone)
|
|
89 |
apply (case_tac obj)
|
|
90 |
apply (auto simp:co2sobj_clone split:t_dobject.splits simp del:co2sobj.simps)
|
77
|
91 |
done
|
|
92 |
|
|
93 |
(*
|
|
94 |
definition s2ss_shm_no_backup:: "t_state \<Rightarrow> t_process \<Rightarrow> t_static_state"
|
|
95 |
where
|
|
96 |
"s2ss_shm_no_backup s pfrom \<equiv> {S_proc sp False | sp p. info_flow_shm s pfrom p \<and> cp2sproc s p = Some sp \<and>
|
|
97 |
(\<not> (\<exists> p'. \<not> info_flow_shm s pfrom p' \<and> p' \<in> current_procs s \<and> co2sobj s (O_proc p') = Some (S_proc sp False)))}"
|
|
98 |
|
|
99 |
definition update_s2ss_shm:: "t_state \<Rightarrow> t_process \<Rightarrow> t_static_state"
|
|
100 |
where
|
|
101 |
"update_s2ss_shm s pfrom \<equiv> s2ss s
|
|
102 |
\<union> {S_proc sp True| sp p. info_flow_shm s pfrom p \<and> cp2sproc s p = Some sp}
|
|
103 |
- (s2ss_shm_no_backup s pfrom)"
|
|
104 |
|
|
105 |
lemma s2ss_shm_no_bk_elim:
|
|
106 |
"\<lbrakk>S_proc sp False \<notin> s2ss_shm_no_backup s pfrom; co2sobj s (O_proc p) = Some (S_proc sp False);
|
|
107 |
valid s; info_flow_shm s pfrom p\<rbrakk>
|
|
108 |
\<Longrightarrow> \<exists> p'. \<not> info_flow_shm s pfrom p' \<and> p' \<in> current_procs s \<and> co2sobj s (O_proc p') = Some (S_proc sp False)"
|
|
109 |
apply (auto simp:s2ss_shm_no_backup_def co2sobj.simps split:option.splits)
|
|
110 |
apply (erule_tac x = p in allE, auto)
|
|
111 |
apply (rule_tac x = p' in exI, auto)
|
|
112 |
done
|
|
113 |
|
|
114 |
lemma s2ss_shm_no_bk_intro1:
|
|
115 |
"\<lbrakk>co2sobj s' obj = Some x; \<forall> p. obj \<noteq> O_proc p\<rbrakk> \<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom"
|
|
116 |
apply (case_tac obj)
|
|
117 |
apply (auto simp:co2sobj.simps s2ss_shm_no_backup_def split:option.splits)
|
|
118 |
done
|
|
119 |
|
|
120 |
lemma s2ss_shm_no_bk_intro2:
|
|
121 |
"\<lbrakk>co2sobj s' obj = Some x; obj \<in> tainted s'; valid s'\<rbrakk> \<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom"
|
|
122 |
apply (case_tac obj)
|
|
123 |
|
|
124 |
apply (auto simp:co2sobj.simps s2ss_shm_no_backup_def split:option.splits)
|
|
125 |
done
|
|
126 |
|
|
127 |
lemma s2ss_shm_no_bk_intro3:
|
|
128 |
"\<lbrakk>co2sobj s (O_proc p) = Some x; \<not> info_flow_shm s pfrom p; p \<in> current_procs s
|
|
129 |
\<rbrakk> \<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom"
|
|
130 |
apply (auto simp add:s2ss_shm_no_backup_def split:option.splits)
|
|
131 |
apply (rule_tac x = p in exI, simp)
|
|
132 |
done
|
|
133 |
|
|
134 |
lemma s2ss_shm_no_bk_intro4:
|
|
135 |
"\<lbrakk>co2sobj s (O_proc p) = Some x; info_flow_shm s pfrom p;
|
|
136 |
\<not> info_flow_shm s pfrom p'; p' \<in> current_procs s; co2sobj s (O_proc p') = Some x\<rbrakk>
|
|
137 |
\<Longrightarrow> x \<notin> s2ss_shm_no_backup s pfrom"
|
|
138 |
apply (rule notI)
|
|
139 |
apply (auto simp add:s2ss_shm_no_backup_def co2sobj.simps split:option.splits)
|
|
140 |
done
|
|
141 |
*)
|
|
142 |
|
|
143 |
lemma tainted_ptrace':
|
|
144 |
"tainted (Ptrace p p' # s) =
|
|
145 |
(if (O_proc p \<in> tainted s \<and> O_proc p' \<notin> tainted s)
|
|
146 |
then tainted s \<union> {O_proc p'}
|
|
147 |
else if (O_proc p' \<in> tainted s \<and> O_proc p \<notin> tainted s)
|
|
148 |
then tainted s \<union> {O_proc p}
|
|
149 |
else tainted s)"
|
|
150 |
by auto
|
|
151 |
|
92
|
152 |
(*
|
77
|
153 |
lemma co2sobj_some_caseD:
|
|
154 |
"\<lbrakk>co2sobj s obj = Some sobj; \<And> p. \<lbrakk>co2sobj s obj = Some sobj; obj = O_proc p\<rbrakk> \<Longrightarrow> P (O_proc p);
|
|
155 |
\<And> f. \<lbrakk>co2sobj s obj = Some sobj; obj = O_file f\<rbrakk> \<Longrightarrow> P (O_file f);
|
|
156 |
\<And> f. \<lbrakk>co2sobj s obj = Some sobj; obj = O_dir f\<rbrakk> \<Longrightarrow> P (O_dir f);
|
|
157 |
\<And> q. \<lbrakk>co2sobj s obj = Some sobj; obj = O_msgq q\<rbrakk> \<Longrightarrow> P (O_msgq q)\<rbrakk>
|
|
158 |
\<Longrightarrow> P obj"
|
|
159 |
by (case_tac obj, auto)
|
92
|
160 |
*)
|
77
|
161 |
|
92
|
162 |
definition update_s2ss_obj :: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_dobject \<Rightarrow> t_sobject \<Rightarrow> t_sobject \<Rightarrow> t_static_state"
|
77
|
163 |
where
|
|
164 |
"update_s2ss_obj s ss obj sobj sobj' =
|
92
|
165 |
(if (\<exists> obj'. dalive s obj' \<and> obj' \<noteq> obj \<and> co2sobj s obj' = Some sobj)
|
77
|
166 |
then ss \<union> {sobj'}
|
|
167 |
else ss - {sobj} \<union> {sobj'})"
|
|
168 |
|
|
169 |
ML {*
|
|
170 |
fun my_setiff_tac i =
|
|
171 |
(etac @{thm CollectE} i
|
|
172 |
ORELSE ( asm_full_simp_tac (HOL_ss addsimps @{thms Set.insert_iff}) i
|
|
173 |
THEN etac @{thm disjE} i)
|
|
174 |
ORELSE ( asm_full_simp_tac (HOL_ss addsimps @{thms Set.Diff_iff}) i
|
|
175 |
THEN etac @{thm conjE} i
|
|
176 |
THEN (REPEAT (etac @{thm CollectE} i))))
|
|
177 |
THEN (REPEAT (( etac @{thm exE}
|
|
178 |
ORELSE' etac @{thm conjE}
|
|
179 |
ORELSE' etac @{thm bexE}) i))
|
|
180 |
THEN (rtac @{thm CollectI} i
|
|
181 |
ORELSE ( asm_full_simp_tac (HOL_ss addsimps @{thms Set.insert_iff}) i))
|
|
182 |
|
|
183 |
*}
|
|
184 |
|
|
185 |
ML {*
|
|
186 |
fun my_seteq_tac i =
|
|
187 |
(simp_tac (HOL_ss addsimps @{thms s2ss_def}) 1)
|
|
188 |
THEN (rtac @{thm set_eqI} i)
|
|
189 |
THEN (rtac @{thm iffI} i)
|
|
190 |
THEN my_setiff_tac i
|
|
191 |
*}
|
|
192 |
|
|
193 |
ML {*fun my_clarify_tac i =
|
|
194 |
REPEAT (( rtac @{thm impI}
|
|
195 |
ORELSE' rtac @{thm allI}
|
|
196 |
ORELSE' rtac @{thm ballI}
|
|
197 |
ORELSE' rtac @{thm conjI}
|
|
198 |
ORELSE' etac @{thm conjE}
|
|
199 |
ORELSE' etac @{thm exE}
|
|
200 |
ORELSE' etac @{thm bexE}
|
|
201 |
ORELSE' etac @{thm disjE}) i)
|
|
202 |
*}
|
|
203 |
|
|
204 |
lemma co2sobj_sproc_imp:
|
92
|
205 |
"co2sobj s obj = Some (S_proc sp tag) \<Longrightarrow> \<exists> p. obj = D_proc p"
|
77
|
206 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits)
|
|
207 |
|
|
208 |
lemma co2sobj_sfile_imp:
|
92
|
209 |
"co2sobj s obj = Some (S_file sfs tag) \<Longrightarrow> \<exists> f. obj = D_file f"
|
77
|
210 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits)
|
|
211 |
|
|
212 |
lemma co2sobj_sdir_imp:
|
92
|
213 |
"co2sobj s obj = Some (S_dir sf) \<Longrightarrow> \<exists> f. obj = D_dir f"
|
77
|
214 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits)
|
|
215 |
|
|
216 |
lemma co2sobj_smsgq_imp:
|
92
|
217 |
"co2sobj s obj = Some (S_msgq sq) \<Longrightarrow> \<exists> q. obj = D_msgq q"
|
77
|
218 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits)
|
|
219 |
|
|
220 |
lemma s2ss_execve:
|
|
221 |
"valid (Execve p f fds # s) \<Longrightarrow>
|
|
222 |
(case (cp2sproc s p, cp2sproc (Execve p f fds # s) p) of
|
|
223 |
(Some sp, Some sp') \<Rightarrow> s2ss (Execve p f fds # s) =
|
92
|
224 |
update_s2ss_obj s (s2ss s) (D_proc p) (S_proc sp (O_proc p \<in> tainted s))
|
77
|
225 |
(S_proc sp' (O_proc p \<in> tainted s \<or> O_file f \<in> tainted s))
|
|
226 |
| _ \<Rightarrow> s2ss (Execve p f fds # s) = {})"
|
|
227 |
apply (frule vd_cons, frule vt_grant_os)
|
|
228 |
apply (clarsimp simp only:os_grant.simps)
|
|
229 |
apply (case_tac "cp2sproc s p")
|
|
230 |
apply (drule current_proc_has_sp', simp, simp)
|
|
231 |
apply (case_tac "cp2sproc (Execve p f fds # s) p")
|
|
232 |
apply (drule current_proc_has_sp', simp, simp, simp)
|
|
233 |
apply (simp add:update_s2ss_obj_def)
|
|
234 |
apply (tactic {*my_clarify_tac 1*})
|
|
235 |
apply (frule co2sobj_sproc_imp, erule exE, simp split:option.splits)
|
|
236 |
apply (simp add:s2ss_execve')
|
|
237 |
apply (rule impI)
|
|
238 |
apply (erule_tac x = pa in allE, simp)
|
|
239 |
apply (rule impI)
|
|
240 |
apply (simp add:s2ss_execve')
|
|
241 |
apply (rule impI)
|
|
242 |
apply (tactic {*my_clarify_tac 1*})
|
|
243 |
apply (simp split:option.splits)
|
92
|
244 |
apply (erule_tac x = "D_proc p'" in allE, simp)
|
77
|
245 |
done
|
|
246 |
|
|
247 |
lemma s2ss_ptrace1_aux: "x \<notin> {x. P x} \<Longrightarrow> \<not> P x" by simp
|
|
248 |
|
|
249 |
lemma s2ss_ptrace1:
|
|
250 |
"\<lbrakk>valid (Ptrace p p' # s); O_proc p \<in> tainted s; O_proc p' \<notin> tainted s\<rbrakk>
|
|
251 |
\<Longrightarrow> (case (cp2sproc s p') of
|
|
252 |
Some sp' \<Rightarrow> s2ss (Ptrace p p' # s) =
|
92
|
253 |
update_s2ss_obj s (s2ss s) (D_proc p') (S_proc sp' False) (S_proc sp' True)
|
77
|
254 |
| _ \<Rightarrow> s2ss (Ptrace p p' # s) = {})"
|
|
255 |
apply (frule vd_cons, frule vt_grant_os)
|
|
256 |
apply (clarsimp simp only:os_grant.simps)
|
|
257 |
apply (case_tac "cp2sproc s p'")
|
|
258 |
apply (drule current_proc_has_sp', simp+)
|
|
259 |
apply (case_tac "cp2sproc s p")
|
|
260 |
apply (drule current_proc_has_sp', simp+)
|
|
261 |
|
|
262 |
apply (simp add:update_s2ss_obj_def)
|
|
263 |
apply (tactic {*my_clarify_tac 1*})
|
|
264 |
apply (simp add:s2ss_def)
|
|
265 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
266 |
apply (case_tac "obj = D_proc p'")
|
77
|
267 |
apply (rule disjI1, simp add:co2sobj.simps cp2sproc_other)
|
|
268 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
92
|
269 |
apply (simp add:co2sobj_ptrace is_file_simps is_dir_simps dalive_other split:t_dobject.splits if_splits)
|
77
|
270 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
271 |
apply (rule_tac x = "D_proc p'" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
272 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
273 |
apply (case_tac "obj = D_proc p'")
|
77
|
274 |
apply (rule_tac x = obj' in exI)
|
92
|
275 |
apply (simp add:co2sobj_ptrace dalive_other split:t_dobject.splits if_splits)
|
77
|
276 |
apply (auto simp:co2sobj.simps)[1]
|
92
|
277 |
apply (rule_tac x = obj in exI, simp add:co2sobj_ptrace dalive_other split:t_dobject.splits)
|
77
|
278 |
apply (auto simp:co2sobj.simps)[1]
|
|
279 |
|
|
280 |
apply (rule impI)
|
|
281 |
apply (simp add:s2ss_def)
|
|
282 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
283 |
apply (case_tac "obj = D_proc p'")
|
77
|
284 |
apply (rule disjI1, simp add:co2sobj.simps cp2sproc_other)
|
|
285 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI)
|
92
|
286 |
apply (simp add:co2sobj_ptrace is_file_simps is_dir_simps dalive_other split:t_dobject.splits if_splits)
|
77
|
287 |
apply (rule notI, simp)
|
|
288 |
apply (frule_tac obj = obj in co2sobj_sproc_imp, erule exE, simp)
|
|
289 |
apply (erule_tac x = obj in allE, simp add:co2sobj_ptrace cp2sproc_other split:option.splits)
|
|
290 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
291 |
apply (rule_tac x = "D_proc p'" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
292 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
293 |
apply (case_tac "obj = D_proc p'")
|
77
|
294 |
apply (simp add:co2sobj.simps cp2sproc_other)
|
92
|
295 |
apply (rule_tac x = obj in exI, simp add:co2sobj_ptrace dalive_other split:t_dobject.splits)
|
77
|
296 |
apply (auto simp:co2sobj.simps)[1]
|
|
297 |
done
|
|
298 |
|
|
299 |
lemma s2ss_ptrace2:
|
|
300 |
"\<lbrakk>valid (Ptrace p p' # s); O_proc p' \<in> tainted s; O_proc p \<notin> tainted s\<rbrakk>
|
|
301 |
\<Longrightarrow> (case (cp2sproc s p) of
|
|
302 |
Some sp \<Rightarrow> s2ss (Ptrace p p' # s) =
|
92
|
303 |
update_s2ss_obj s (s2ss s) (D_proc p) (S_proc sp False) (S_proc sp True)
|
77
|
304 |
| _ \<Rightarrow> s2ss (Ptrace p p' # s) = {})"
|
|
305 |
apply (frule vd_cons, frule vt_grant_os)
|
|
306 |
apply (clarsimp simp only:os_grant.simps)
|
|
307 |
apply (case_tac "cp2sproc s p'")
|
|
308 |
apply (drule current_proc_has_sp', simp+)
|
|
309 |
apply (case_tac "cp2sproc s p")
|
|
310 |
apply (drule current_proc_has_sp', simp+)
|
|
311 |
|
|
312 |
apply (simp add:update_s2ss_obj_def)
|
|
313 |
apply (tactic {*my_clarify_tac 1*})
|
|
314 |
apply (simp add:s2ss_def)
|
|
315 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
316 |
apply (case_tac "obj = D_proc p")
|
77
|
317 |
apply (rule disjI1, simp add:co2sobj.simps cp2sproc_other)
|
|
318 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
92
|
319 |
apply (simp add:co2sobj_ptrace is_file_simps is_dir_simps dalive_other split:t_dobject.splits if_splits)
|
77
|
320 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
321 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
322 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
323 |
apply (case_tac "obj = D_proc p")
|
77
|
324 |
apply (rule_tac x = obj' in exI)
|
92
|
325 |
apply (simp add:co2sobj_ptrace dalive_other split:t_dobject.splits if_splits)
|
77
|
326 |
apply (auto simp:co2sobj.simps)[1]
|
92
|
327 |
apply (rule_tac x = obj in exI, simp add:co2sobj_ptrace dalive_other split:t_dobject.splits)
|
77
|
328 |
apply (auto simp:co2sobj.simps)[1]
|
|
329 |
|
|
330 |
apply (rule impI)
|
|
331 |
apply (simp add:s2ss_def)
|
|
332 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
333 |
apply (case_tac "obj = D_proc p")
|
77
|
334 |
apply (rule disjI1, simp add:co2sobj.simps cp2sproc_other)
|
|
335 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI)
|
92
|
336 |
apply (simp add:co2sobj_ptrace is_file_simps is_dir_simps dalive_other split:t_dobject.splits if_splits)
|
77
|
337 |
apply (rule notI, simp)
|
|
338 |
apply (frule_tac obj = obj in co2sobj_sproc_imp, erule exE, simp)
|
|
339 |
apply (erule_tac x = obj in allE, simp add:co2sobj_ptrace cp2sproc_other split:option.splits)
|
|
340 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
341 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
342 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
343 |
apply (case_tac "obj = D_proc p")
|
77
|
344 |
apply (simp add:co2sobj.simps cp2sproc_other)
|
92
|
345 |
apply (rule_tac x = obj in exI, simp add:co2sobj_ptrace dalive_other split:t_dobject.splits)
|
77
|
346 |
apply (auto simp:co2sobj.simps)[1]
|
|
347 |
done
|
|
348 |
|
|
349 |
lemma s2ss_ptrace3:
|
|
350 |
"\<lbrakk>valid (Ptrace p p' # s); (O_proc p' \<in> tainted s) = (O_proc p \<in> tainted s)\<rbrakk>
|
|
351 |
\<Longrightarrow> s2ss (Ptrace p p' # s) = s2ss s"
|
|
352 |
unfolding s2ss_def
|
|
353 |
apply (frule vd_cons, frule vt_grant_os, rule set_eqI, rule iffI)
|
|
354 |
apply (erule CollectE, (erule exE|erule conjE)+, rule CollectI)
|
|
355 |
apply (rule_tac x = obj in exI)
|
92
|
356 |
apply (frule dalive_other, simp+)
|
77
|
357 |
apply (frule_tac obj = obj in co2sobj_ptrace, simp)
|
92
|
358 |
apply (auto split:t_dobject.splits option.splits if_splits)[1]
|
77
|
359 |
|
|
360 |
apply (tactic {*my_setiff_tac 1*})
|
|
361 |
apply (rule_tac x = obj in exI)
|
92
|
362 |
apply (frule dalive_other, simp+)
|
77
|
363 |
apply (frule_tac obj = obj in co2sobj_ptrace, simp)
|
|
364 |
apply (case_tac "cp2sproc s p'")
|
|
365 |
apply (drule current_proc_has_sp', simp, simp)
|
|
366 |
apply (case_tac "cp2sproc s p")
|
|
367 |
apply (drule current_proc_has_sp', simp, simp)
|
|
368 |
apply (case_tac "O_proc p' \<in> tainted s")
|
92
|
369 |
apply (auto split:t_dobject.splits option.splits if_splits simp:co2sobj.simps)
|
77
|
370 |
done
|
|
371 |
|
|
372 |
lemma s2ss_ptrace:
|
|
373 |
"valid (Ptrace p p' # s) \<Longrightarrow> s2ss (Ptrace p p' # s) = (
|
|
374 |
if (O_proc p \<in> tainted s \<and> O_proc p' \<notin> tainted s)
|
|
375 |
then (case (cp2sproc s p') of
|
92
|
376 |
Some sp \<Rightarrow> update_s2ss_obj s (s2ss s) (D_proc p') (S_proc sp False) (S_proc sp True)
|
77
|
377 |
| _ \<Rightarrow> {})
|
|
378 |
else if (O_proc p' \<in> tainted s \<and> O_proc p \<notin> tainted s)
|
|
379 |
then (case (cp2sproc s p) of
|
92
|
380 |
Some sp \<Rightarrow> update_s2ss_obj s (s2ss s) (D_proc p) (S_proc sp False) (S_proc sp True)
|
77
|
381 |
| _ \<Rightarrow> {})
|
|
382 |
else s2ss s )"
|
|
383 |
apply (case_tac "O_proc p \<in> tainted s \<and> O_proc p' \<notin> tainted s")
|
|
384 |
apply (drule s2ss_ptrace1, simp, simp, simp split:option.splits)
|
|
385 |
apply (case_tac "O_proc p' \<in> tainted s \<and> O_proc p \<notin> tainted s")
|
|
386 |
apply (drule s2ss_ptrace2, simp, simp, simp split:option.splits)
|
|
387 |
apply (drule s2ss_ptrace3, auto)
|
|
388 |
done
|
|
389 |
|
|
390 |
lemma s2ss_kill':
|
|
391 |
"valid (Kill p p' # s) \<Longrightarrow> s2ss (Kill p p' # s) = (
|
92
|
392 |
if (\<exists> p''. p'' \<in> current_procs s \<and> p'' \<noteq> p' \<and> co2sobj s (D_proc p'') = co2sobj s (D_proc p'))
|
77
|
393 |
then s2ss s
|
92
|
394 |
else (case (co2sobj s (D_proc p')) of
|
77
|
395 |
Some sp \<Rightarrow> s2ss s - {sp}
|
|
396 |
| _ \<Rightarrow> {}))"
|
|
397 |
apply (frule vt_grant_os, frule vd_cons)
|
|
398 |
unfolding s2ss_def
|
|
399 |
apply (simp split:if_splits, rule conjI)
|
|
400 |
apply (rule impI, (erule exE|erule conjE)+)
|
|
401 |
apply (split option.splits)
|
|
402 |
apply (drule current_proc_has_sp', simp, simp)
|
|
403 |
apply (simp split: option.splits, (erule conjE)+)
|
|
404 |
apply (rule set_eqI, rule iffI, erule CollectE, (erule exE|erule conjE)+, rule CollectI)
|
|
405 |
apply (rule_tac x = obj in exI)
|
92
|
406 |
apply (simp add:co2sobj_kill dalive_kill split:t_dobject.splits if_splits)
|
77
|
407 |
apply (erule CollectE, erule exE, erule conjE, rule CollectI)
|
92
|
408 |
apply (case_tac obj)
|
|
409 |
apply (case_tac "nat = p'")
|
|
410 |
apply (rule_tac x = "D_proc p''" in exI)
|
|
411 |
apply (simp add:cp2sproc_kill dalive_kill
|
|
412 |
split:t_dobject.splits if_splits option.splits)
|
|
413 |
apply (rule_tac x = "D_proc nat" in exI)
|
|
414 |
apply (clarsimp simp add:cp2sproc_kill dalive_kill
|
|
415 |
split:t_dobject.splits if_splits option.splits)
|
|
416 |
apply (rule_tac x = obj in exI, frule dalive_kill, simp add:co2sobj_kill del:co2sobj.simps)+
|
77
|
417 |
|
|
418 |
apply (rule impI, erule conjE, frule current_proc_has_sp, simp, erule exE, simp)
|
|
419 |
apply (rule set_eqI, rule iffI)
|
|
420 |
apply (erule CollectE, erule exE, erule conjE, rule DiffI)
|
|
421 |
apply (rule CollectI, rule_tac x = obj in exI)
|
92
|
422 |
apply (simp add:co2sobj_kill dalive_kill split:t_dobject.splits if_splits)
|
77
|
423 |
apply (rule notI, simp, case_tac obj)
|
|
424 |
apply (erule_tac x = nat in allE)
|
|
425 |
apply (simp add:co2sobj_kill cp2sproc_kill split:option.splits)
|
|
426 |
apply (simp split:option.splits)+
|
92
|
427 |
apply (case_tac obj)
|
|
428 |
apply (case_tac "nat = p'")
|
|
429 |
apply (rule_tac x = "D_proc p''" in exI)
|
|
430 |
apply (simp add:cp2sproc_kill dalive_kill
|
|
431 |
split:t_dobject.splits if_splits option.splits)
|
|
432 |
apply (rule_tac x = "D_proc nat" in exI)
|
|
433 |
apply (clarsimp simp add:cp2sproc_kill dalive_kill
|
|
434 |
split:t_dobject.splits if_splits option.splits)
|
|
435 |
apply (rule_tac x = obj in exI, frule dalive_kill, simp add:co2sobj_kill del:co2sobj.simps)+
|
77
|
436 |
done
|
|
437 |
|
92
|
438 |
definition del_s2ss_obj :: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_dobject \<Rightarrow> t_sobject \<Rightarrow> t_static_state"
|
77
|
439 |
where
|
|
440 |
"del_s2ss_obj s ss obj sobj \<equiv>
|
92
|
441 |
if (\<exists> obj'. dalive s obj' \<and> obj' \<noteq> obj \<and> co2sobj s obj' = Some sobj)
|
77
|
442 |
then ss
|
|
443 |
else ss - {sobj}"
|
|
444 |
|
|
445 |
lemma del_update_s2ss_obj:
|
|
446 |
"update_s2ss_obj s ss obj sobj sobj' = del_s2ss_obj s ss obj sobj \<union> {sobj'}"
|
|
447 |
by (auto simp:update_s2ss_obj_def del_s2ss_obj_def split:if_splits)
|
|
448 |
|
|
449 |
lemma s2ss_kill:
|
|
450 |
"valid (Kill p p' # s) \<Longrightarrow> (
|
|
451 |
case (cp2sproc s p') of
|
92
|
452 |
Some sp \<Rightarrow> s2ss (Kill p p' # s) = del_s2ss_obj s (s2ss s) (D_proc p') (S_proc sp (O_proc p' \<in> tainted s))
|
77
|
453 |
| _ \<Rightarrow> s2ss (Kill p p' # s) = {})"
|
|
454 |
apply (frule vd_cons, frule vt_grant_os)
|
|
455 |
apply (clarsimp simp only:os_grant.simps)
|
|
456 |
apply (split option.splits, rule conjI, rule impI)
|
|
457 |
apply (drule current_proc_has_sp', simp, simp)
|
|
458 |
apply (rule allI, rule impI)
|
|
459 |
apply (simp add:del_s2ss_obj_def split:option.splits)
|
|
460 |
apply (tactic {*my_clarify_tac 1*})
|
|
461 |
apply (frule co2sobj_sproc_imp, erule exE)
|
|
462 |
apply (simp add:s2ss_kill')
|
|
463 |
apply (rule impI)
|
|
464 |
apply (erule_tac x = pa in allE, simp)
|
|
465 |
apply (rule impI)
|
|
466 |
apply (simp add:s2ss_kill')
|
|
467 |
apply (rule impI)
|
|
468 |
apply (tactic {*my_clarify_tac 1*})
|
|
469 |
apply (simp split:option.splits)
|
92
|
470 |
apply (erule_tac x = "D_proc p''" in allE, simp)
|
77
|
471 |
done
|
|
472 |
|
|
473 |
lemma s2ss_exit':
|
|
474 |
"valid (Exit p # s) \<Longrightarrow> s2ss (Exit p # s) = (
|
92
|
475 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (D_proc p') = co2sobj s (D_proc p))
|
77
|
476 |
then s2ss s
|
92
|
477 |
else (case (co2sobj s (D_proc p)) of
|
77
|
478 |
Some sp \<Rightarrow> s2ss s - {sp}
|
|
479 |
| _ \<Rightarrow> {}))"
|
|
480 |
apply (frule vt_grant_os, frule vd_cons)
|
|
481 |
unfolding s2ss_def
|
|
482 |
apply (simp split:if_splits, rule conjI)
|
|
483 |
apply (rule impI, (erule exE|erule conjE)+)
|
|
484 |
apply (split option.splits)
|
|
485 |
apply (drule current_proc_has_sp', simp, simp)
|
|
486 |
apply (simp split: option.splits, (erule conjE)+)
|
|
487 |
apply (rule set_eqI, rule iffI, erule CollectE, (erule exE|erule conjE)+, rule CollectI)
|
|
488 |
apply (rule_tac x = obj in exI)
|
92
|
489 |
apply (simp add:co2sobj_exit dalive_exit split:t_dobject.splits if_splits)
|
77
|
490 |
apply (erule CollectE, erule exE, erule conjE, rule CollectI)
|
92
|
491 |
apply (case_tac obj)
|
|
492 |
apply (case_tac "nat = p")
|
|
493 |
apply (rule_tac x = "D_proc p'" in exI)
|
|
494 |
apply (simp add:cp2sproc_exit dalive_exit
|
|
495 |
split:t_dobject.splits if_splits option.splits)
|
|
496 |
apply (rule_tac x = "D_proc nat" in exI)
|
|
497 |
apply (clarsimp simp add:cp2sproc_exit dalive_exit
|
|
498 |
split:t_dobject.splits if_splits option.splits)
|
|
499 |
apply (rule_tac x = obj in exI, frule dalive_exit, simp add:co2sobj_exit del:co2sobj.simps)+
|
77
|
500 |
|
|
501 |
apply (rule impI, frule current_proc_has_sp, simp, erule exE, simp)
|
|
502 |
apply (rule set_eqI, rule iffI)
|
|
503 |
apply (erule CollectE, erule exE, erule conjE, rule DiffI)
|
|
504 |
apply (rule CollectI, rule_tac x = obj in exI)
|
92
|
505 |
apply (simp add:co2sobj_exit dalive_exit split:t_dobject.splits if_splits)
|
77
|
506 |
apply (rule notI, simp, case_tac obj)
|
|
507 |
apply (erule_tac x = nat in allE)
|
|
508 |
apply (simp add:co2sobj_exit cp2sproc_exit split:option.splits)
|
|
509 |
apply (simp split:option.splits)+
|
92
|
510 |
apply (case_tac obj)
|
|
511 |
apply (case_tac "nat = p")
|
|
512 |
apply (rule_tac x = "D_proc p'" in exI)
|
|
513 |
apply (simp add:cp2sproc_exit dalive_exit
|
|
514 |
split:t_dobject.splits if_splits option.splits)
|
|
515 |
apply (rule_tac x = "D_proc nat" in exI)
|
|
516 |
apply (clarsimp simp add:cp2sproc_exit dalive_exit
|
|
517 |
split:t_dobject.splits if_splits option.splits)
|
|
518 |
apply (rule_tac x = obj in exI, frule dalive_exit, simp add:co2sobj_exit del:co2sobj.simps)+
|
77
|
519 |
done
|
|
520 |
|
|
521 |
lemma s2ss_exit:
|
|
522 |
"valid (Exit p # s) \<Longrightarrow> (
|
|
523 |
case (cp2sproc s p) of
|
92
|
524 |
Some sp \<Rightarrow> s2ss (Exit p # s) = del_s2ss_obj s (s2ss s) (D_proc p) (S_proc sp (O_proc p \<in> tainted s))
|
77
|
525 |
| _ \<Rightarrow> s2ss (Exit p # s) = {})"
|
|
526 |
apply (frule vd_cons, frule vt_grant_os)
|
|
527 |
apply (clarsimp simp only:os_grant.simps)
|
|
528 |
apply (split option.splits, rule conjI, rule impI)
|
|
529 |
apply (drule current_proc_has_sp', simp, simp)
|
|
530 |
apply (rule allI, rule impI)
|
|
531 |
apply (simp add:del_s2ss_obj_def split:option.splits)
|
|
532 |
apply (tactic {*my_clarify_tac 1*})
|
|
533 |
apply (frule co2sobj_sproc_imp, erule exE)
|
|
534 |
apply (simp add:s2ss_exit')
|
|
535 |
apply (rule impI)
|
|
536 |
apply (erule_tac x = pa in allE, simp)
|
|
537 |
apply (rule impI)
|
|
538 |
apply (simp add:s2ss_exit')
|
|
539 |
apply (rule impI)
|
|
540 |
apply (tactic {*my_clarify_tac 1*})
|
|
541 |
apply (simp split:option.splits)
|
92
|
542 |
apply (erule_tac x = "D_proc p'" in allE, simp)
|
77
|
543 |
done
|
|
544 |
|
92
|
545 |
lemma dalive_has_sobj':
|
|
546 |
"\<lbrakk>co2sobj s obj = None; valid s\<rbrakk> \<Longrightarrow> \<not> dalive s obj"
|
77
|
547 |
apply (case_tac obj)
|
|
548 |
apply (auto split:option.splits)
|
|
549 |
oops
|
|
550 |
|
|
551 |
declare co2sobj.simps [simp del]
|
|
552 |
|
|
553 |
lemma co2sobj_open_none:
|
92
|
554 |
"\<lbrakk>valid (Open p f flag fd None # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (Open p f flag fd None # s) obj = (
|
|
555 |
if (obj = D_proc p)
|
77
|
556 |
then (case (cp2sproc (Open p f flag fd None # s) p) of
|
|
557 |
Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
|
|
558 |
| _ \<Rightarrow> None)
|
|
559 |
else co2sobj s obj)"
|
|
560 |
apply (frule vt_grant_os, frule vd_cons)
|
92
|
561 |
apply (frule_tac obj = obj in co2sobj_open, simp add:dalive_open)
|
|
562 |
apply (auto split:t_dobject.splits option.splits dest!:current_proc_has_sp')
|
77
|
563 |
done
|
|
564 |
|
|
565 |
lemma co2sobj_open_some:
|
92
|
566 |
"\<lbrakk>valid (Open p f flag fd (Some i) # s); dalive s obj\<rbrakk> \<Longrightarrow> co2sobj (Open p f flag fd (Some i) # s) obj = (
|
|
567 |
if (obj = D_proc p)
|
77
|
568 |
then (case (cp2sproc (Open p f flag fd (Some i) # s) p) of
|
|
569 |
Some sp \<Rightarrow> Some (S_proc sp (O_proc p \<in> tainted s))
|
|
570 |
| _ \<Rightarrow> None)
|
92
|
571 |
else if (obj = D_file f)
|
77
|
572 |
then (case (cf2sfile (Open p f flag fd (Some i) # s) f) of
|
|
573 |
Some sf \<Rightarrow> Some (S_file {sf} (O_proc p \<in> tainted s))
|
|
574 |
| _ \<Rightarrow> None)
|
|
575 |
else co2sobj s obj)"
|
|
576 |
apply (frule vt_grant_os, frule vd_cons)
|
92
|
577 |
apply (frule_tac obj = obj in co2sobj_open, simp add:dalive_open)
|
|
578 |
apply (auto split:t_dobject.splits option.splits dest!:current_proc_has_sp')
|
77
|
579 |
done
|
|
580 |
|
|
581 |
lemma co2sobj_proc_obj:
|
92
|
582 |
"\<lbrakk>co2sobj s obj = Some x; co2sobj s (D_proc p) = Some x\<rbrakk>
|
|
583 |
\<Longrightarrow> \<exists> p'. obj = D_proc p'"
|
77
|
584 |
by (case_tac obj, auto simp:co2sobj.simps split:option.splits)
|
|
585 |
|
|
586 |
lemma s2ss_open_none:
|
|
587 |
"valid (Open p f flag fd None # s) \<Longrightarrow> s2ss (Open p f flag fd None # s) = (
|
92
|
588 |
case (co2sobj s (D_proc p), co2sobj (Open p f flag fd None # s) (D_proc p)) of
|
77
|
589 |
(Some sp, Some sp') \<Rightarrow>
|
92
|
590 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (D_proc p') = Some sp)
|
77
|
591 |
then s2ss s \<union> {sp'}
|
|
592 |
else s2ss s - {sp} \<union> {sp'}
|
|
593 |
| _ \<Rightarrow> {} )"
|
|
594 |
unfolding s2ss_def
|
|
595 |
apply (frule vt_grant_os, frule vd_cons)
|
92
|
596 |
apply (case_tac "co2sobj s (D_proc p)", simp add:co2sobj.simps split:option.splits)
|
77
|
597 |
apply (drule current_proc_has_sp', simp, simp)
|
92
|
598 |
apply (case_tac "co2sobj (Open p f flag fd None # s) (D_proc p)")
|
77
|
599 |
apply (simp add:co2sobj.simps split:option.splits)
|
|
600 |
apply (drule current_proc_has_sp', simp, simp)
|
|
601 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE, simp)
|
92
|
602 |
apply (simp add:dalive_open)
|
77
|
603 |
apply (rule conjI, rule impI, erule exE, (erule conjE)+)
|
92
|
604 |
apply (rule Meson.disj_comm, rule disjCI, case_tac "obj = D_proc p", simp)
|
|
605 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none dalive_open split:t_dobject.splits)
|
77
|
606 |
apply (rule impI)
|
92
|
607 |
apply (case_tac "obj = D_proc p", simp)
|
77
|
608 |
apply (rule Meson.disj_comm, rule disjCI, rule conjI)
|
92
|
609 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none split:t_dobject.splits)
|
|
610 |
apply (rule notI)
|
77
|
611 |
apply (simp add:co2sobj_open_none split:option.splits)
|
92
|
612 |
apply (frule_tac co2sobj_proc_obj, simp, erule exE)
|
|
613 |
apply (erule_tac x = p' in allE, simp split:t_dobject.splits)
|
77
|
614 |
|
|
615 |
apply (simp split:if_splits)
|
92
|
616 |
apply (erule disjE, rule_tac x = "D_proc p" in exI, simp)
|
|
617 |
apply (erule exE, erule conjE, case_tac "obj = D_proc p")
|
|
618 |
apply (rule_tac x = "D_proc p'" in exI, simp add:co2sobj_open_none)
|
|
619 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none dalive_open)
|
|
620 |
apply (erule disjE, rule_tac x = "D_proc p" in exI, simp)
|
|
621 |
apply (erule conjE, erule exE, erule conjE, case_tac "obj = D_proc p")
|
|
622 |
apply (rule_tac x = "D_proc p'" in exI, simp add:co2sobj_open_none)
|
|
623 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_none dalive_open)
|
77
|
624 |
done
|
|
625 |
|
|
626 |
lemma s2ss_open_some:
|
|
627 |
"valid (Open p f flag fd (Some i) # s) \<Longrightarrow> s2ss (Open p f flag fd (Some i) # s) = (
|
92
|
628 |
case (co2sobj s (D_proc p), co2sobj (Open p f flag fd (Some i) # s) (D_proc p),
|
|
629 |
co2sobj (Open p f flag fd (Some i) # s) (D_file f)) of
|
77
|
630 |
(Some sp, Some sp', Some sf) \<Rightarrow>
|
92
|
631 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (D_proc p') = Some sp)
|
77
|
632 |
then s2ss s \<union> {sp', sf}
|
|
633 |
else s2ss s - {sp} \<union> {sp', sf}
|
|
634 |
| _ \<Rightarrow> {} )"
|
|
635 |
unfolding s2ss_def
|
|
636 |
apply (frule vt_grant_os, frule vd_cons)
|
92
|
637 |
apply (case_tac "co2sobj s (D_proc p)", simp add:co2sobj.simps split:option.splits)
|
77
|
638 |
apply (drule current_proc_has_sp', simp, simp)
|
92
|
639 |
apply (case_tac "co2sobj (Open p f flag fd (Some i) # s) (D_proc p)")
|
77
|
640 |
apply (simp add:co2sobj.simps split:option.splits)
|
|
641 |
apply (drule current_proc_has_sp', simp, simp)
|
92
|
642 |
apply (case_tac "co2sobj (Open p f flag fd (Some i) # s) (D_file f)")
|
77
|
643 |
apply (simp add:co2sobj.simps split:option.splits)
|
|
644 |
apply (clarsimp split del:if_splits)
|
|
645 |
|
|
646 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE)
|
|
647 |
apply (split if_splits, rule conjI, rule impI, erule exE, erule conjE, erule conjE)
|
92
|
648 |
apply (case_tac "obj = D_proc p", simp, case_tac "obj = D_file f", simp)
|
77
|
649 |
apply (rule UnI1, rule CollectI, rule_tac x = obj in exI)
|
92
|
650 |
apply (simp add:co2sobj_open dalive_open split:t_dobject.splits option.splits)
|
|
651 |
apply (rule impI, case_tac "obj = D_proc p", simp, case_tac "obj = D_file f", simp)
|
77
|
652 |
apply (rule UnI1, rule DiffI, rule CollectI, rule_tac x = obj in exI)
|
92
|
653 |
apply (simp add:co2sobj_open dalive_open split:t_dobject.splits)
|
77
|
654 |
apply (frule_tac obj = obj in co2sobj_open_some, simp+)
|
92
|
655 |
apply (simp add:dalive_open)
|
|
656 |
apply (rule notI, simp)
|
77
|
657 |
apply (frule_tac obj = obj and p = p in co2sobj_proc_obj, simp+, erule exE)
|
|
658 |
apply (erule_tac x = p' in allE, simp)
|
|
659 |
|
|
660 |
apply (simp split:if_splits, erule disjE)
|
92
|
661 |
apply (rule_tac x = "D_proc p" in exI, simp)
|
|
662 |
apply (erule disjE, rule_tac x = "D_file f" in exI, simp add:is_file_simps)
|
77
|
663 |
apply (erule exE, erule conjE)
|
92
|
664 |
apply (case_tac "obj = D_proc p", simp)
|
|
665 |
apply (rule_tac x = "D_proc p'" in exI, simp add:co2sobj_open_some)
|
|
666 |
apply (case_tac "obj = D_file f", simp add:is_file_in_current)
|
|
667 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_some dalive_open)
|
|
668 |
apply (erule disjE, rule_tac x = "D_proc p" in exI, simp)
|
|
669 |
apply (erule disjE, rule_tac x = "D_file f" in exI, simp add:is_file_simps)
|
77
|
670 |
apply (erule conjE, erule exE, erule conjE)
|
92
|
671 |
apply (case_tac "obj = D_proc p", simp)
|
|
672 |
apply (case_tac "obj = D_file f", simp add:is_file_in_current)
|
|
673 |
apply (rule_tac x = obj in exI, simp add:co2sobj_open_some dalive_open)
|
77
|
674 |
done
|
|
675 |
|
|
676 |
lemma s2ss_open':
|
|
677 |
"valid (Open p f flag fd opt # s) \<Longrightarrow> s2ss (Open p f flag fd opt # s) = (
|
|
678 |
if opt = None
|
92
|
679 |
then (case (co2sobj s (D_proc p), co2sobj (Open p f flag fd opt # s) (D_proc p)) of
|
77
|
680 |
(Some sp, Some sp') \<Rightarrow>
|
92
|
681 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (D_proc p') = Some sp)
|
77
|
682 |
then s2ss s \<union> {sp'}
|
|
683 |
else s2ss s - {sp} \<union> {sp'}
|
|
684 |
| _ \<Rightarrow> {} )
|
92
|
685 |
else (case (co2sobj s (D_proc p), co2sobj (Open p f flag fd opt # s) (D_proc p),
|
|
686 |
co2sobj (Open p f flag fd opt # s) (D_file f)) of
|
77
|
687 |
(Some sp, Some sp', Some sf) \<Rightarrow>
|
92
|
688 |
if (\<exists> p'. p' \<in> current_procs s \<and> p' \<noteq> p \<and> co2sobj s (D_proc p') = Some sp)
|
77
|
689 |
then s2ss s \<union> {sp', sf}
|
|
690 |
else s2ss s - {sp} \<union> {sp', sf}
|
|
691 |
| _ \<Rightarrow> {} ) )"
|
|
692 |
apply (case_tac opt)
|
|
693 |
apply (simp add:s2ss_open_some s2ss_open_none)+
|
|
694 |
done
|
|
695 |
|
|
696 |
lemma co2sobj_proc_eq_some:
|
92
|
697 |
"\<lbrakk>co2sobj s (D_proc p) = Some sp; co2sobj s obj = Some sp\<rbrakk>
|
|
698 |
\<Longrightarrow> \<exists> p'. obj = D_proc p'"
|
77
|
699 |
apply (case_tac obj, case_tac[!] sp)
|
|
700 |
by (auto simp:co2sobj.simps split:option.splits)
|
|
701 |
|
|
702 |
lemma s2ss_open:
|
|
703 |
"valid (Open p f flag fd opt # s) \<Longrightarrow>
|
92
|
704 |
(case (co2sobj s (D_proc p), co2sobj (Open p f flag fd opt # s) (D_proc p),
|
|
705 |
co2sobj (Open p f flag fd opt # s) (D_file f)) of
|
77
|
706 |
(Some sp, Some sp', Some sf) \<Rightarrow> s2ss (Open p f flag fd opt # s) = (
|
|
707 |
if opt = None
|
92
|
708 |
then update_s2ss_obj s (s2ss s) (D_proc p) sp sp'
|
|
709 |
else update_s2ss_obj s (s2ss s) (D_proc p) sp sp' \<union> {sf})
|
77
|
710 |
| _ \<Rightarrow> s2ss (Open p f flag fd opt # s) = {})"
|
|
711 |
apply (frule vt_grant_os, frule vd_cons, clarsimp simp only:os_grant.simps)
|
92
|
712 |
apply (case_tac "co2sobj s (D_proc p)")
|
77
|
713 |
apply (simp add:co2sobj.simps split:option.splits)
|
|
714 |
apply (drule current_proc_has_sp', simp, simp)
|
|
715 |
apply (drule current_proc_has_sp', simp, simp)
|
92
|
716 |
apply (case_tac "co2sobj (Open p f flag fd opt # s) (D_proc p)")
|
77
|
717 |
apply (simp add:co2sobj.simps split:option.splits)
|
|
718 |
apply (drule current_proc_has_sp', simp, simp)
|
|
719 |
apply (drule current_proc_has_sp', simp, simp)
|
92
|
720 |
apply (case_tac "co2sobj (Open p f flag fd opt # s) (D_file f)")
|
77
|
721 |
apply (simp add:co2sobj.simps split:option.splits)
|
|
722 |
apply (simp split:option.splits add:s2ss_open' update_s2ss_obj_def)
|
|
723 |
apply (auto)
|
92
|
724 |
apply (erule_tac x = "D_proc p'" in allE, simp)
|
77
|
725 |
apply (frule_tac obj = obj' in co2sobj_proc_eq_some, simp, erule exE, simp)
|
|
726 |
apply (erule_tac x = "p'" in allE, simp)
|
92
|
727 |
apply (erule_tac x = "D_proc p'" in allE, simp)
|
77
|
728 |
apply (frule_tac obj = obj' in co2sobj_proc_eq_some, simp, erule exE, simp)
|
|
729 |
apply (erule_tac x = "p'" in allE, simp)
|
92
|
730 |
apply (erule_tac x = "D_proc p'" in allE, simp)
|
77
|
731 |
apply (frule_tac obj = obj' in co2sobj_proc_eq_some, simp, erule exE, simp)
|
|
732 |
apply (erule_tac x = "p'" in allE, simp)
|
|
733 |
done
|
|
734 |
|
|
735 |
lemma s2ss_readfile:
|
|
736 |
"valid (ReadFile p fd # s) \<Longrightarrow> s2ss (ReadFile p fd # s) = (
|
|
737 |
case (file_of_proc_fd s p fd) of
|
|
738 |
Some f \<Rightarrow> if (O_file f \<in> tainted s \<and> O_proc p \<notin> tainted s)
|
|
739 |
then (case (cp2sproc s p) of
|
92
|
740 |
Some sp \<Rightarrow> update_s2ss_obj s (s2ss s) (D_proc p) (S_proc sp False) (S_proc sp True)
|
77
|
741 |
| _ \<Rightarrow> {})
|
|
742 |
else s2ss s
|
|
743 |
| _ \<Rightarrow> {})"
|
|
744 |
apply (frule vt_grant_os, frule vd_cons, clarsimp simp only:os_grant.simps)
|
|
745 |
apply (case_tac "cp2sproc s p")
|
|
746 |
apply (drule current_proc_has_sp', simp+)
|
|
747 |
apply (rule conjI, rule impI, erule conjE)
|
|
748 |
|
|
749 |
apply (simp add:update_s2ss_obj_def)
|
|
750 |
apply (tactic {*my_clarify_tac 1*})
|
|
751 |
apply (frule co2sobj_sproc_imp, erule exE, simp split:option.splits)
|
|
752 |
apply (simp add:s2ss_def)
|
|
753 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
754 |
apply (case_tac "obj = D_proc p")
|
77
|
755 |
apply (rule disjI1, simp add:co2sobj_readfile)
|
|
756 |
apply (rule disjI2, simp)
|
|
757 |
apply (rule_tac x = obj in exI)
|
92
|
758 |
apply (simp add:dalive_other co2sobj_readfile split:t_dobject.splits option.splits)
|
77
|
759 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
760 |
apply (rule_tac x= "D_proc p" in exI, simp add:dalive_other co2sobj_readfile)
|
77
|
761 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
762 |
apply (case_tac "obj = D_proc p")
|
|
763 |
apply (rule_tac x = "D_proc pa" in exI, simp add:dalive_other co2sobj_readfile)
|
77
|
764 |
apply (simp add:co2sobj.simps)
|
|
765 |
apply (rule_tac x = obj in exI)
|
92
|
766 |
apply (auto simp add:dalive_other co2sobj_readfile split:t_dobject.splits option.splits)[1]
|
77
|
767 |
apply (tactic {*my_clarify_tac 1*})
|
|
768 |
apply (simp add:s2ss_def)
|
|
769 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
770 |
apply (case_tac "obj = D_proc p")
|
77
|
771 |
apply (rule disjI1, simp add:co2sobj_readfile)
|
|
772 |
apply (rule disjI2, rule DiffI)
|
|
773 |
apply (simp, rule_tac x = obj in exI)
|
92
|
774 |
apply (simp add:dalive_other co2sobj_readfile split:t_dobject.splits option.splits)
|
77
|
775 |
apply (rule notI, erule_tac x = obj in allE)
|
92
|
776 |
apply (auto simp add:dalive_other co2sobj_readfile split:t_dobject.splits option.splits)[1]
|
77
|
777 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
778 |
apply (rule_tac x = "D_proc p" in exI, simp add:dalive_other co2sobj_readfile)
|
77
|
779 |
apply (tactic {*my_setiff_tac 1*})
|
|
780 |
apply (rule_tac x = obj in exI)
|
92
|
781 |
apply (auto simp add:dalive_other co2sobj_readfile split:t_dobject.splits option.splits)[1]
|
77
|
782 |
apply (simp add:co2sobj.simps)
|
|
783 |
|
|
784 |
apply (simp add:s2ss_def, rule impI)
|
|
785 |
apply (tactic {*my_seteq_tac 1*})
|
|
786 |
apply (rule_tac x = obj in exI)
|
92
|
787 |
apply (simp add:dalive_other co2sobj_readfile split:t_dobject.splits option.splits if_splits)
|
77
|
788 |
apply (simp add:co2sobj.simps)
|
|
789 |
apply (tactic {*my_setiff_tac 1*})
|
|
790 |
apply (rule_tac x = obj in exI)
|
92
|
791 |
apply (auto simp add:dalive_other co2sobj_readfile split:t_dobject.splits option.splits if_splits)
|
77
|
792 |
apply (simp add:co2sobj.simps)
|
|
793 |
done
|
|
794 |
|
|
795 |
lemma same_inode_files_prop9:
|
|
796 |
"is_file s f \<Longrightarrow> f \<in> same_inode_files s f"
|
|
797 |
by (simp add:same_inode_files_def)
|
|
798 |
|
|
799 |
lemma cf2sfiles_prop:
|
|
800 |
"\<lbrakk>f \<in> same_inode_files s f'; valid s\<rbrakk> \<Longrightarrow> cf2sfiles s f = cf2sfiles s f'"
|
|
801 |
apply (auto simp:cf2sfiles_def)
|
|
802 |
apply (rule_tac x = f'a in bexI, simp)
|
|
803 |
apply (erule same_inode_files_prop4, simp)
|
|
804 |
apply (rule_tac x = f'a in bexI, simp)
|
|
805 |
apply (drule same_inode_files_prop5)
|
|
806 |
apply (erule same_inode_files_prop4, simp)
|
|
807 |
done
|
|
808 |
|
|
809 |
lemma co2sobj_writefile_unchange:
|
92
|
810 |
"\<lbrakk>valid (WriteFile p fd # s); dalive s obj; file_of_proc_fd s p fd = Some f;
|
77
|
811 |
O_proc p \<in> tainted s \<longrightarrow> O_file f \<in> tainted s\<rbrakk>
|
|
812 |
\<Longrightarrow> co2sobj (WriteFile p fd # s) obj = co2sobj s obj"
|
92
|
813 |
apply (frule vd_cons, frule co2sobj_writefile, simp, simp split:t_dobject.splits if_splits)
|
77
|
814 |
apply (simp add:co2sobj.simps)
|
|
815 |
apply (case_tac "O_proc p \<in> tainted s")
|
|
816 |
apply (simp add:same_inodes_tainted)+
|
|
817 |
done
|
|
818 |
|
|
819 |
lemma s2ss_writefile':
|
|
820 |
"valid (WriteFile p fd # s) \<Longrightarrow> s2ss (WriteFile p fd # s) = (
|
|
821 |
case (file_of_proc_fd s p fd) of
|
|
822 |
Some f \<Rightarrow> if (O_proc p \<in> tainted s \<and> O_file f \<notin> tainted s)
|
|
823 |
then (if (\<exists> f'. f' \<notin> same_inode_files s f \<and> is_file s f' \<and>
|
92
|
824 |
co2sobj s (D_file f') = co2sobj s (D_file f))
|
77
|
825 |
then s2ss s \<union> {S_file (cf2sfiles s f) True}
|
|
826 |
else s2ss s - {S_file (cf2sfiles s f) False}
|
|
827 |
\<union> {S_file (cf2sfiles s f) True})
|
|
828 |
else s2ss s
|
|
829 |
| _ \<Rightarrow> {})"
|
|
830 |
apply (frule vd_cons, frule vt_grant_os)
|
|
831 |
apply (clarsimp split:option.splits)
|
|
832 |
unfolding s2ss_def
|
|
833 |
apply (rule conjI|rule impI|erule exE|erule conjE)+
|
|
834 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE)
|
92
|
835 |
apply (frule_tac obj = obj in co2sobj_writefile, simp add:dalive_other)
|
|
836 |
apply (simp split:t_dobject.splits if_splits)
|
|
837 |
apply (rule disjI2, rule_tac x= "D_proc nat" in exI, simp)
|
77
|
838 |
apply (rule disjI1, simp add:cf2sfiles_prop)
|
|
839 |
apply (rule disjI2, rule_tac x = obj in exI, simp add:is_file_simps)
|
|
840 |
apply (rule disjI2, rule_tac x = obj in exI, simp add:is_dir_simps)
|
|
841 |
apply (rule disjI2, rule_tac x = obj in exI, simp)
|
|
842 |
apply (simp add:co2sobj.simps)
|
|
843 |
|
|
844 |
apply (erule disjE)
|
92
|
845 |
apply (rule_tac x = "D_file aa" in exI, simp add:is_file_simps file_of_pfd_is_file)
|
|
846 |
apply (frule_tac obj = "D_file aa" in co2sobj_writefile, simp add:file_of_pfd_is_file)
|
77
|
847 |
apply (simp split:if_splits add:same_inode_files_def file_of_pfd_is_file)
|
|
848 |
apply (erule exE, erule conjE, erule conjE)
|
92
|
849 |
apply (case_tac obj)
|
77
|
850 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile)
|
92
|
851 |
apply (case_tac "list \<in> same_inode_files s aa")
|
|
852 |
apply (frule_tac f = list and f' = aa in cf2sfiles_prop, simp)
|
|
853 |
apply (rule_tac x = "D_file f'" in exI, simp add:co2sobj_writefile is_file_simps)
|
77
|
854 |
apply (rule conjI, rule impI, simp add:same_inode_files_prop5)
|
|
855 |
apply (rule impI, simp add:co2sobj.simps same_inodes_tainted)
|
92
|
856 |
apply (rule_tac x = "D_file list" in exI, simp add:co2sobj_writefile is_file_simps)
|
77
|
857 |
apply (rule impI, simp add:same_inode_files_prop5)
|
|
858 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile is_dir_simps)
|
|
859 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile)
|
|
860 |
|
|
861 |
apply (rule impI, rule impI, simp, rule set_eqI, rule iffI, erule CollectE, (erule conjE|erule exE)+)
|
92
|
862 |
apply (rule CollectI, rule_tac x = obj in exI, simp add:dalive_simps)
|
|
863 |
apply (simp add:co2sobj_writefile split:t_dobject.splits if_splits)
|
77
|
864 |
apply (simp add:co2sobj.simps same_inodes_tainted)
|
|
865 |
apply (case_tac "O_proc p \<in> tainted s", simp, simp)
|
|
866 |
apply (erule CollectE, (erule conjE|erule exE)+, rule CollectI)
|
|
867 |
apply (rule_tac x = obj in exI)
|
92
|
868 |
apply (simp add:co2sobj_writefile_unchange dalive_simps)
|
77
|
869 |
|
|
870 |
apply (rule impI| rule conjI|erule conjE)+
|
|
871 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE)
|
92
|
872 |
apply (simp add:dalive_simps co2sobj_writefile split:t_dobject.splits)
|
77
|
873 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp,
|
|
874 |
rule notI, simp add:co2sobj.simps split:option.splits)
|
|
875 |
apply (simp split:if_splits)
|
|
876 |
apply (rule disjI1, simp add:cf2sfiles_prop)
|
|
877 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp)
|
|
878 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
879 |
apply (erule_tac x = list in allE, simp add:same_inode_files_prop5)
|
|
880 |
apply (simp add:co2sobj.simps)
|
92
|
881 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp split:option.splits add:co2sobj.simps)
|
|
882 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
77
|
883 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp,
|
|
884 |
rule notI, simp add:co2sobj.simps split:option.splits)
|
|
885 |
apply (simp add:co2sobj.simps)
|
|
886 |
apply (erule disjE)
|
92
|
887 |
apply (rule_tac x= "D_file aa" in exI)
|
|
888 |
apply ( simp add:co2sobj_writefile dalive_simps file_of_pfd_is_file)
|
77
|
889 |
apply (rule impI, simp add:same_inode_files_def file_of_pfd_is_file)
|
|
890 |
apply (erule exE|erule conjE)+
|
92
|
891 |
apply (case_tac obj)
|
77
|
892 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile)
|
92
|
893 |
apply (case_tac "list \<in> same_inode_files s aa")
|
77
|
894 |
apply (frule cf2sfiles_prop, simp, simp add:co2sobj.simps same_inodes_tainted)
|
|
895 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile is_file_simps)
|
|
896 |
apply (rule impI, simp add:same_inode_files_prop5)
|
|
897 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile is_dir_simps)
|
|
898 |
apply (rule_tac x = obj in exI, simp add:co2sobj_writefile)
|
92
|
899 |
|
77
|
900 |
apply (rule impI, rule impI)
|
|
901 |
apply (rule set_eqI, rule iffI, erule CollectE,erule exE,erule conjE,rule CollectI)
|
|
902 |
apply (rule_tac x = obj in exI)
|
92
|
903 |
apply (simp add:co2sobj_writefile_unchange dalive_simps)
|
77
|
904 |
apply (erule CollectE, erule exE, erule conjE)
|
|
905 |
apply (rule CollectI, rule_tac x = obj in exI)
|
92
|
906 |
apply (simp add:co2sobj_writefile_unchange dalive_simps)
|
77
|
907 |
done
|
|
908 |
|
|
909 |
definition update_s2ss_sfile_tainted:: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> bool \<Rightarrow> t_static_state"
|
|
910 |
where
|
|
911 |
"update_s2ss_sfile_tainted s ss f tag \<equiv>
|
|
912 |
if (\<exists> f'. is_file s f' \<and> f' \<notin> same_inode_files s f \<and>
|
92
|
913 |
co2sobj s (D_file f') = Some (S_file (cf2sfiles s f) False))
|
77
|
914 |
then ss \<union> {S_file (cf2sfiles s f) True}
|
|
915 |
else ss - {S_file (cf2sfiles s f) False}
|
|
916 |
\<union> {S_file (cf2sfiles s f) True}"
|
|
917 |
|
|
918 |
lemma s2ss_writefile:
|
|
919 |
"valid (WriteFile p fd # s) \<Longrightarrow> s2ss (WriteFile p fd # s) = (
|
|
920 |
case (file_of_proc_fd s p fd) of
|
|
921 |
Some f \<Rightarrow> if (O_proc p \<in> tainted s \<and> O_file f \<notin> tainted s)
|
|
922 |
then update_s2ss_sfile_tainted s (s2ss s) f True
|
|
923 |
else s2ss s
|
|
924 |
| _ \<Rightarrow> {})"
|
|
925 |
apply (drule s2ss_writefile')
|
|
926 |
apply (simp)
|
|
927 |
apply (case_tac "file_of_proc_fd s p fd", simp)
|
|
928 |
apply (simp add:update_s2ss_sfile_tainted_def)
|
|
929 |
apply auto
|
|
930 |
apply (erule_tac x = f' in allE, simp add:co2sobj.simps)+
|
|
931 |
done
|
|
932 |
|
|
933 |
definition update_s2ss_sfile_del :: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> t_sfile \<Rightarrow> t_static_state"
|
|
934 |
where
|
|
935 |
"update_s2ss_sfile_del s ss f sf \<equiv>
|
|
936 |
if (same_inode_files s f = {f})
|
|
937 |
then ss
|
|
938 |
else ss \<union> {S_file (cf2sfiles s f - {sf}) (O_file f \<in> tainted s)}"
|
|
939 |
|
|
940 |
definition del_s2ss_file:: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> t_sfile \<Rightarrow> t_static_state"
|
|
941 |
where
|
|
942 |
"del_s2ss_file s ss f sf =
|
|
943 |
(if (\<exists> f' \<in> same_inode_files s f. f' \<noteq> f \<and> cf2sfile s f' = Some sf)
|
|
944 |
then ss
|
92
|
945 |
else if (\<exists> f'. is_file s f' \<and> f' \<notin> same_inode_files s f \<and> co2sobj s (D_file f') = co2sobj s (D_file f))
|
77
|
946 |
then update_s2ss_sfile_del s ss f sf
|
|
947 |
else update_s2ss_sfile_del s (ss - {S_file (cf2sfiles s f) (O_file f \<in> tainted s)}) f sf)"
|
|
948 |
|
|
949 |
|
92
|
950 |
lemma dalive_co2sobj_closefd1:
|
|
951 |
"\<lbrakk>dalive s obj; valid (CloseFd p fd # s);
|
77
|
952 |
file_of_proc_fd s p fd = Some f; \<not> (f \<in> files_hung_by_del s \<and> proc_fd_of_file s f = {(p, fd)})\<rbrakk>
|
92
|
953 |
\<Longrightarrow> dalive (CloseFd p fd # s) obj"
|
|
954 |
apply (case_tac obj)
|
|
955 |
by (auto simp:dalive_simps is_file_simps is_dir_simps split:option.splits)
|
77
|
956 |
|
92
|
957 |
lemma dalive_co2sobj_closefd3:
|
|
958 |
"\<lbrakk>dalive s obj; valid (CloseFd p fd # s); obj \<noteq> D_file f;
|
|
959 |
file_of_proc_fd s p fd = Some f; f \<in> files_hung_by_del s; proc_fd_of_file s f = {(p, fd)}\<rbrakk>
|
|
960 |
\<Longrightarrow> dalive (CloseFd p fd # s) obj"
|
|
961 |
apply (case_tac obj)
|
|
962 |
by (auto simp:dalive_simps is_file_simps is_dir_simps split:option.splits)
|
77
|
963 |
|
92
|
964 |
lemma dalive_co2sobj_closefd2:
|
|
965 |
"\<lbrakk>dalive s obj; valid (CloseFd p fd # s); file_of_proc_fd s p fd = None\<rbrakk>
|
|
966 |
\<Longrightarrow> dalive (CloseFd p fd # s) obj"
|
|
967 |
apply (case_tac obj)
|
|
968 |
by (auto simp:dalive_simps is_file_simps is_dir_simps split:option.splits)
|
77
|
969 |
|
92
|
970 |
lemma dalive_co2sobj_closefd':
|
|
971 |
"\<lbrakk>co2sobj (CloseFd p fd # s) obj = Some sobj; dalive (CloseFd p fd # s) obj;
|
|
972 |
valid (CloseFd p fd # s)\<rbrakk> \<Longrightarrow> dalive s obj"
|
|
973 |
apply (case_tac obj)
|
|
974 |
by (auto simp:dalive_simps is_file_simps is_dir_simps split:option.splits if_splits)
|
77
|
975 |
|
|
976 |
lemma same_inode_files_prop10:
|
|
977 |
"\<lbrakk>same_inode_files s f \<noteq> {f}; is_file s f\<rbrakk> \<Longrightarrow> \<exists> f'. f' \<in> same_inode_files s f \<and> f' \<noteq> f"
|
|
978 |
by (auto simp:same_inode_files_def split:if_splits)
|
|
979 |
|
|
980 |
lemma same_inode_files_prop11:
|
|
981 |
"f \<in> same_inode_files s f' \<Longrightarrow> is_file s f"
|
|
982 |
by (auto simp:same_inode_files_def is_file_def split:if_splits)
|
|
983 |
|
|
984 |
lemma same_inode_files_prop11':
|
|
985 |
"f \<in> same_inode_files s f' \<Longrightarrow> is_file s f'"
|
|
986 |
by (auto simp:same_inode_files_def is_file_def split:if_splits)
|
|
987 |
|
|
988 |
lemma s2ss_closefd:
|
|
989 |
"valid (CloseFd p fd # s) \<Longrightarrow> s2ss (CloseFd p fd # s) = (
|
|
990 |
case (file_of_proc_fd s p fd) of
|
|
991 |
Some f \<Rightarrow> if (f \<in> files_hung_by_del s \<and> proc_fd_of_file s f = {(p, fd)})
|
|
992 |
then (case (cf2sfile s f, cp2sproc s p, cp2sproc (CloseFd p fd # s) p) of
|
|
993 |
(Some sf, Some sp, Some sp') \<Rightarrow>
|
|
994 |
(del_s2ss_file s (
|
92
|
995 |
update_s2ss_obj s (s2ss s) (D_proc p)
|
77
|
996 |
(S_proc sp (O_proc p \<in> tainted s))
|
|
997 |
(S_proc sp' (O_proc p \<in> tainted s))) f sf)
|
|
998 |
| _ \<Rightarrow> {})
|
|
999 |
else (case (cp2sproc s p, cp2sproc (CloseFd p fd # s) p) of
|
|
1000 |
(Some sp, Some sp') \<Rightarrow>
|
92
|
1001 |
(update_s2ss_obj s (s2ss s) (D_proc p)
|
77
|
1002 |
(S_proc sp (O_proc p \<in> tainted s))
|
|
1003 |
(S_proc sp' (O_proc p \<in> tainted s)))
|
|
1004 |
| _ \<Rightarrow> {})
|
|
1005 |
| _ \<Rightarrow> s2ss s)"
|
|
1006 |
apply (frule vd_cons, frule vt_grant_os)
|
|
1007 |
apply (clarsimp simp only:os_grant.simps)
|
|
1008 |
apply (frule current_proc_has_sp, simp, erule exE)
|
|
1009 |
apply (case_tac "file_of_proc_fd s p fd")
|
|
1010 |
|
|
1011 |
apply (simp add:s2ss_def)
|
|
1012 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE, rule CollectI)
|
92
|
1013 |
apply (rule_tac x = obj in exI, simp add:dalive_co2sobj_closefd')
|
77
|
1014 |
apply (frule co2sobj_closefd, simp)
|
|
1015 |
apply (frule cp2sproc_closefd, simp)
|
92
|
1016 |
apply (simp add:proc_file_fds_def split:t_dobject.splits)
|
77
|
1017 |
apply (simp split:if_splits add:co2sobj.simps)
|
|
1018 |
apply (erule CollectE, erule exE, erule conjE, rule CollectI)
|
92
|
1019 |
apply (rule_tac x = obj in exI, simp add:dalive_co2sobj_closefd2)
|
|
1020 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:dalive_co2sobj_closefd2)
|
77
|
1021 |
apply (frule cp2sproc_closefd, simp)
|
|
1022 |
apply (auto simp add:proc_file_fds_def co2sobj.simps
|
92
|
1023 |
split:t_dobject.splits option.splits if_splits)[1]
|
77
|
1024 |
|
|
1025 |
apply (case_tac "cp2sproc (CloseFd p fd # s) p")
|
|
1026 |
apply (drule current_proc_has_sp', simp, simp)
|
|
1027 |
apply (case_tac "cf2sfile s a")
|
|
1028 |
apply (drule current_file_has_sfile', simp, simp add:file_of_pfd_in_current)
|
|
1029 |
apply (simp)
|
|
1030 |
|
|
1031 |
apply (rule conjI, rule impI, erule conjE)
|
|
1032 |
apply (simp add:del_s2ss_file_def)
|
|
1033 |
apply (rule conjI|rule impI|erule exE|erule conjE|erule bexE)+
|
|
1034 |
|
|
1035 |
apply (simp add:update_s2ss_obj_def)
|
|
1036 |
apply (rule conjI|rule impI|erule exE|erule conjE|erule bexE)+
|
|
1037 |
apply (tactic {*my_seteq_tac 1*})
|
|
1038 |
apply simp
|
92
|
1039 |
apply (case_tac "obj = D_proc p")
|
77
|
1040 |
apply (simp add:co2sobj.simps)
|
|
1041 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1042 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:dalive_simps)
|
|
1043 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1044 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1045 |
apply (rule_tac x = "D_proc p" in exI)
|
77
|
1046 |
apply (simp add:co2sobj.simps)
|
|
1047 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1048 |
apply (case_tac "obj = D_proc p")
|
77
|
1049 |
apply (rule_tac x = obj' in exI)
|
|
1050 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd)
|
|
1051 |
apply (simp add:co2sobj.simps)
|
92
|
1052 |
apply (case_tac "obj = D_file a")
|
|
1053 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1054 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file)
|
92
|
1055 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd, simp add:dalive_simps)
|
|
1056 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1057 |
apply (rule_tac x = obj in exI)
|
92
|
1058 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1059 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1060 |
apply (auto simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1061 |
|
|
1062 |
apply (rule impI)+
|
|
1063 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1064 |
apply (case_tac "obj = D_proc p", rule disjI1, simp add:co2sobj.simps)
|
77
|
1065 |
apply (rule disjI2)
|
92
|
1066 |
apply (case_tac "obj = D_file a", simp add:dalive_simps)
|
77
|
1067 |
apply (rule DiffI, simp)
|
|
1068 |
apply (rule_tac x = obj in exI)
|
92
|
1069 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd', simp+)
|
77
|
1070 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1071 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1072 |
apply (simp, rule notI, simp, frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd)
|
92
|
1073 |
apply (erule_tac x = "D_proc pa" in allE, simp)
|
77
|
1074 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1075 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1076 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1077 |
apply (case_tac "obj = D_proc p", simp add:co2sobj.simps)
|
|
1078 |
apply (case_tac "obj = D_file a", rule_tac x = "D_file f'" in exI)
|
77
|
1079 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file)
|
92
|
1080 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd, simp add:dalive_simps)
|
|
1081 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1082 |
apply (rule_tac x = obj in exI)
|
92
|
1083 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1084 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1085 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1086 |
|
|
1087 |
apply (rule impI, tactic {*my_seteq_tac 1*})
|
|
1088 |
apply (simp add:update_s2ss_obj_def update_s2ss_sfile_del_def)
|
|
1089 |
apply (rule conjI| rule impI|erule exE|erule conjE)+
|
92
|
1090 |
apply (case_tac obj)
|
|
1091 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1092 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1093 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
|
1094 |
apply (case_tac "list = a", simp add:dalive_simps)
|
77
|
1095 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1096 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1097 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1098 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1099 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1100 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1101 |
apply (rule conjI| rule impI|erule exE|erule conjE)+
|
92
|
1102 |
apply (case_tac obj)
|
|
1103 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1104 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI)
|
|
1105 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1106 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
|
1107 |
apply (case_tac "list = a", simp add:dalive_simps)
|
|
1108 |
apply (case_tac "list \<in> same_inode_files s a", rule disjI1)
|
77
|
1109 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits)
|
|
1110 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop)
|
|
1111 |
apply (erule bexE, erule conjE)
|
|
1112 |
apply (erule_tac x = f'' in ballE, simp, simp)
|
|
1113 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI)
|
92
|
1114 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1115 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI)
|
92
|
1116 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1117 |
apply (rule disjI2, rule disjI2, rule_tac x = obj in exI)
|
92
|
1118 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1119 |
apply (rule impI, rule conjI, rule impI)
|
92
|
1120 |
apply (case_tac obj)
|
|
1121 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1122 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1123 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1124 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_file_simps)
|
92
|
1125 |
apply (case_tac "list = a", simp add:dalive_simps)
|
77
|
1126 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1127 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1128 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_file_simps)
|
|
1129 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1130 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1131 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_dir_simps)
|
|
1132 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1133 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1134 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp)
|
|
1135 |
apply (rule impI)
|
92
|
1136 |
apply (case_tac obj)
|
|
1137 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1138 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
|
1139 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1140 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1141 |
apply (rule notI, simp add:co2sobj_closefd)
|
|
1142 |
apply (erule_tac x = obj in allE, simp)
|
92
|
1143 |
apply (case_tac "list = a", simp add:dalive_simps)
|
|
1144 |
apply (case_tac "list \<in> same_inode_files s a", rule disjI1)
|
77
|
1145 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits)
|
|
1146 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop)
|
|
1147 |
apply (erule bexE, erule conjE)
|
|
1148 |
apply (erule_tac x = f'' in ballE, simp, simp)
|
|
1149 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1150 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1151 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_file_simps)
|
|
1152 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1153 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1154 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp add:is_dir_simps)
|
|
1155 |
apply (rule disjI2, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1156 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1157 |
apply (rule notI, simp add:co2sobj_closefd, erule_tac x = obj in allE, simp)
|
|
1158 |
|
|
1159 |
apply (simp add:update_s2ss_sfile_del_def update_s2ss_obj_def split:if_splits)
|
92
|
1160 |
apply (erule disjE, rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1161 |
apply (erule exE, erule conjE)
|
92
|
1162 |
apply (case_tac "obj = D_proc p")
|
77
|
1163 |
apply (rule_tac x = obj' in exI)
|
|
1164 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd)
|
|
1165 |
apply (simp add:co2sobj.simps)
|
92
|
1166 |
apply (case_tac "obj = D_file a")
|
|
1167 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1168 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file)
|
92
|
1169 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd, simp add:dalive_simps)
|
|
1170 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1171 |
apply (rule_tac x = obj in exI)
|
92
|
1172 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1173 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1174 |
apply (auto simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)[1]
|
|
1175 |
apply (erule disjE, rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1176 |
apply (erule conjE, erule exE, erule conjE)
|
92
|
1177 |
apply (case_tac "obj = D_proc p")
|
77
|
1178 |
apply (simp add:co2sobj.simps)
|
92
|
1179 |
apply (case_tac "obj = D_file a")
|
|
1180 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1181 |
apply (case_tac "f' = a", simp add:same_inode_files_prop9 file_of_pfd_is_file)
|
92
|
1182 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd, simp add:dalive_simps)
|
|
1183 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1184 |
apply (rule_tac x = obj in exI)
|
92
|
1185 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1186 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1187 |
apply (auto simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1188 |
apply (erule disjE)
|
|
1189 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE)
|
92
|
1190 |
apply (rule_tac x = "D_file f'a" in exI)
|
77
|
1191 |
apply (frule same_inode_files_prop11)
|
92
|
1192 |
apply (frule_tac obj = "D_file f'a" in co2sobj_closefd)
|
|
1193 |
apply (simp add:dalive_simps)+
|
77
|
1194 |
apply (frule_tac f = "f'a" in is_file_has_sfile', simp, erule exE)
|
|
1195 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted split:if_splits)
|
|
1196 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1197 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1198 |
apply (erule disjE)
|
92
|
1199 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1200 |
apply (erule exE, erule conjE)
|
92
|
1201 |
apply (case_tac "obj = D_proc p")
|
77
|
1202 |
apply (rule_tac x = obj' in exI)
|
|
1203 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd)
|
|
1204 |
apply (simp add:co2sobj.simps)
|
92
|
1205 |
apply (case_tac obj)
|
77
|
1206 |
apply (rule_tac x = obj in exI)
|
|
1207 |
apply (simp add:co2sobj_closefd)
|
92
|
1208 |
apply (case_tac "list \<in> same_inode_files s a")
|
|
1209 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1210 |
apply (simp add:co2sobj_simps is_file_simps split:if_splits option.splits t_sobject.splits)
|
|
1211 |
apply (rule conjI, rule notI, simp add:same_inode_files_prop9)
|
|
1212 |
apply (rule impI, simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1213 |
apply (rule_tac x = obj in exI)
|
|
1214 |
apply (simp add:co2sobj_closefd is_file_simps)
|
|
1215 |
apply (rule notI, simp add:same_inode_files_prop9)
|
|
1216 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_dir_simps)
|
|
1217 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
|
1218 |
|
|
1219 |
apply (erule disjE)
|
|
1220 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE)
|
92
|
1221 |
apply (rule_tac x = "D_file f'a" in exI)
|
77
|
1222 |
apply (frule same_inode_files_prop11)
|
92
|
1223 |
apply (frule_tac obj = "D_file f'a" in co2sobj_closefd)
|
|
1224 |
apply (simp add:dalive_simps)+
|
77
|
1225 |
apply (frule_tac f = "f'a" in is_file_has_sfile', simp, erule exE)
|
|
1226 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted split:if_splits)
|
|
1227 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1228 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1229 |
apply (erule disjE)
|
92
|
1230 |
apply (rule_tac x = "D_proc p" in exI)
|
77
|
1231 |
apply (simp add:co2sobj.simps)
|
|
1232 |
apply (erule conjE, erule exE, erule conjE)
|
92
|
1233 |
apply (case_tac "obj = D_proc p")
|
77
|
1234 |
apply (simp add:co2sobj.simps)
|
92
|
1235 |
apply (case_tac obj)
|
77
|
1236 |
apply (rule_tac x = obj in exI)
|
|
1237 |
apply (simp add:co2sobj_closefd)
|
92
|
1238 |
apply (case_tac "list \<in> same_inode_files s a")
|
|
1239 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1240 |
apply (simp add:co2sobj_simps is_file_simps split:if_splits option.splits t_sobject.splits)
|
|
1241 |
apply (rule conjI, rule notI, simp add:same_inode_files_prop9)
|
|
1242 |
apply (rule impI, simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1243 |
apply (rule_tac x = obj in exI)
|
|
1244 |
apply (simp add:co2sobj_closefd is_file_simps)
|
|
1245 |
apply (rule notI, simp add:same_inode_files_prop9)
|
|
1246 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_dir_simps)
|
|
1247 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
|
1248 |
|
|
1249 |
apply (rule impI, rule conjI, rule impI)
|
|
1250 |
apply (tactic {*my_seteq_tac 1*})
|
|
1251 |
apply (simp add:update_s2ss_obj_def update_s2ss_sfile_del_def)
|
|
1252 |
apply (rule conjI| rule impI|erule exE|erule conjE)+
|
92
|
1253 |
apply (case_tac obj)
|
|
1254 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1255 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1256 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
|
1257 |
apply (case_tac "list = a", simp add:dalive_simps)
|
77
|
1258 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1259 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, clarsimp simp:dalive_simps split:if_splits)
|
77
|
1260 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1261 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1262 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1263 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1264 |
apply (rule conjI| rule impI|erule exE|erule conjE)+
|
92
|
1265 |
apply (case_tac obj)
|
|
1266 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1267 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
|
1268 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1269 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
|
1270 |
apply (rule notI, simp, erule_tac x = "D_proc nat" in allE, simp add:co2sobj_closefd)
|
|
1271 |
apply (case_tac "list = a", simp add:dalive_simps)
|
|
1272 |
apply (case_tac "list \<in> same_inode_files s a", rule disjI2)
|
77
|
1273 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits)
|
|
1274 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop)
|
|
1275 |
apply (erule bexE, erule conjE)
|
92
|
1276 |
apply (rule conjI, rule_tac x = "D_file f''" in exI)
|
77
|
1277 |
apply (simp add:same_inode_files_prop11 co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1278 |
apply (rule notI, simp)
|
|
1279 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1280 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1281 |
apply (rule notI, simp add:co2sobj.simps)
|
|
1282 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1283 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1284 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1285 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1286 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1287 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1288 |
|
|
1289 |
apply (erule bexE, erule conjE)
|
|
1290 |
apply (simp add:update_s2ss_obj_def split:if_splits)
|
92
|
1291 |
apply (erule disjE, rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1292 |
apply (erule exE, erule conjE)
|
92
|
1293 |
apply (case_tac "obj = D_proc p")
|
77
|
1294 |
apply (rule_tac x = obj' in exI)
|
|
1295 |
apply (frule co2sobj_sproc_imp, erule exE, simp add:co2sobj_closefd)
|
|
1296 |
apply (simp add:co2sobj.simps)
|
92
|
1297 |
apply (case_tac "obj = D_file a")
|
|
1298 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1299 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd, simp add:dalive_simps same_inode_files_prop11)
|
|
1300 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1301 |
apply (rule conjI)
|
|
1302 |
apply (rule impI)
|
|
1303 |
apply (rule_tac x = f' in ballE, simp, simp, simp)
|
|
1304 |
apply (simp add:same_inode_files_prop11 co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1305 |
apply (rule_tac x = obj in exI)
|
92
|
1306 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1307 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1308 |
apply (auto simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)[1]
|
|
1309 |
apply (erule disjE, rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1310 |
apply (erule conjE, erule exE, erule conjE)
|
92
|
1311 |
apply (case_tac "obj = D_proc p")
|
77
|
1312 |
apply (simp add:co2sobj.simps)
|
92
|
1313 |
apply (case_tac "obj = D_file a")
|
|
1314 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1315 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd, simp add:dalive_simps same_inode_files_prop11)
|
|
1316 |
apply (simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1317 |
apply (rule conjI)
|
|
1318 |
apply (rule impI)
|
|
1319 |
apply (rule_tac x = f' in ballE, simp, simp, simp)
|
|
1320 |
apply (simp add:same_inode_files_prop11 co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1321 |
apply (rule_tac x = obj in exI)
|
92
|
1322 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1323 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1324 |
apply (auto simp add:dalive_simps co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1325 |
|
|
1326 |
apply (rule impI)
|
|
1327 |
apply (tactic {*my_seteq_tac 1*})
|
|
1328 |
apply (simp add:update_s2ss_obj_def update_s2ss_sfile_del_def)
|
|
1329 |
apply (rule conjI| rule impI|erule exE|erule conjE)+
|
92
|
1330 |
apply (case_tac obj)
|
|
1331 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1332 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1333 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
|
1334 |
apply (case_tac "list = a", simp add:dalive_simps)
|
77
|
1335 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1336 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, clarsimp simp:dalive_simps split:if_splits)
|
77
|
1337 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1338 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1339 |
apply (rule disjI2, rule_tac x = obj in exI)
|
92
|
1340 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1341 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, rule notI, simp)
|
|
1342 |
apply (frule_tac obj = obj in co2sobj_sfile_imp, erule exE, simp add:is_file_simps split:if_splits)
|
|
1343 |
apply (erule_tac x= f in allE, simp add:co2sobj.simps)
|
|
1344 |
apply (rule conjI| rule impI|erule exE|erule conjE)+
|
92
|
1345 |
apply (case_tac obj)
|
|
1346 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1347 |
apply (rule disjI2, rule notI, simp)
|
|
1348 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI)
|
|
1349 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1350 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1351 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
92
|
1352 |
apply (case_tac "list = a", simp add:dalive_simps)
|
|
1353 |
apply (case_tac "list \<in> same_inode_files s a", rule disjI1)
|
77
|
1354 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits)
|
|
1355 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop)
|
|
1356 |
apply (erule bexE, erule conjE)
|
|
1357 |
apply (erule_tac x = f'' in ballE, simp, simp)
|
|
1358 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI)
|
|
1359 |
apply (simp add:is_file_simps co2sobj_closefd)
|
|
1360 |
apply (rule notI, simp add:co2sobj_closefd)
|
92
|
1361 |
apply (erule_tac x = list in allE, simp add:is_file_simps co2sobj.simps)
|
77
|
1362 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI)
|
92
|
1363 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1364 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1365 |
apply (rule disjI2, rule conjI, rule disjI2, rule_tac x = obj in exI)
|
92
|
1366 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1367 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1368 |
apply (rule impI, rule conjI, rule impI)
|
|
1369 |
|
92
|
1370 |
apply (case_tac obj)
|
|
1371 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1372 |
apply (rule notI, simp)
|
|
1373 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
|
1374 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1375 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1376 |
apply (erule_tac x = obj in allE, simp add:co2sobj_closefd)
|
|
1377 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
92
|
1378 |
apply (case_tac "list = a", simp add:dalive_simps)
|
|
1379 |
apply (case_tac "list \<in> same_inode_files s a", rule conjI, rule disjI2, rule conjI)
|
77
|
1380 |
apply (simp add:co2sobj_simps split:if_splits option.splits t_sobject.splits)
|
|
1381 |
apply (simp add:co2sobj.simps)
|
|
1382 |
apply (rule notI, simp add:co2sobj.simps)
|
|
1383 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
|
1384 |
apply (simp add:is_file_simps co2sobj_closefd)
|
|
1385 |
apply (rule notI, simp add:co2sobj.simps)
|
|
1386 |
apply (rule notI, simp add:co2sobj_closefd)
|
92
|
1387 |
apply (erule_tac x = list in allE, simp add:is_file_simps co2sobj.simps)
|
77
|
1388 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1389 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1390 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+
|
|
1391 |
apply (rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1392 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1393 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+
|
|
1394 |
apply (rule impI)
|
92
|
1395 |
apply (case_tac obj)
|
|
1396 |
apply (case_tac "nat = p", simp add:co2sobj.simps)
|
77
|
1397 |
apply (rule disjI2, rule notI, simp)
|
|
1398 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
|
1399 |
apply (frule_tac obj = obj in co2sobj_closefd, simp)
|
92
|
1400 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1401 |
apply (erule_tac x = obj in allE, simp add:co2sobj_closefd)
|
|
1402 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
92
|
1403 |
apply (case_tac "list = a", simp add:dalive_simps)
|
|
1404 |
apply (case_tac "list \<in> same_inode_files s a", rule disjI1)
|
77
|
1405 |
apply (simp add:co2sobj_closefd split:if_splits option.splits t_sobject.splits)
|
|
1406 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1407 |
apply (erule bexE, erule conjE, erule_tac x = "f''" in ballE, simp, simp)
|
|
1408 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
|
1409 |
apply (simp add:is_file_simps co2sobj_closefd)
|
|
1410 |
apply (rule notI, simp add:co2sobj.simps)
|
|
1411 |
apply (rule notI, simp add:co2sobj_closefd)
|
92
|
1412 |
apply (erule_tac x = list in allE, simp add:is_file_simps co2sobj.simps)
|
77
|
1413 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1414 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1415 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+
|
|
1416 |
apply (rule disjI2, rule conjI, rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1417 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp add:dalive_simps)
|
77
|
1418 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)+
|
|
1419 |
|
|
1420 |
apply (simp add:update_s2ss_sfile_del_def update_s2ss_obj_def split:if_splits)
|
|
1421 |
apply (erule conjE, erule disjE)
|
92
|
1422 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1423 |
apply (erule exE, erule conjE)
|
92
|
1424 |
apply (case_tac "obj = D_file a", simp add:co2sobj.simps)
|
|
1425 |
apply (case_tac "obj = D_proc p")
|
77
|
1426 |
apply (rule_tac x = obj' in exI, frule_tac obj = obj' in co2sobj_sproc_imp, erule exE)
|
92
|
1427 |
apply (frule_tac obj = obj' in dalive_co2sobj_closefd3, simp+)
|
77
|
1428 |
apply (simp add:co2sobj_closefd)
|
|
1429 |
apply (simp add:co2sobj.simps)
|
92
|
1430 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1431 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
92
|
1432 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1433 |
apply (erule conjE|erule exE|erule disjE)+
|
92
|
1434 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1435 |
apply (erule conjE, erule exE, erule conjE)
|
92
|
1436 |
apply (case_tac "obj = D_file a", simp add:co2sobj.simps)
|
|
1437 |
apply (case_tac "obj = D_proc p")
|
77
|
1438 |
apply (simp add:co2sobj.simps)
|
92
|
1439 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
77
|
1440 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
92
|
1441 |
apply (auto simp add:co2sobj.simps split:t_dobject.splits if_splits)[1]
|
77
|
1442 |
apply (erule conjE|erule exE|erule disjE)+
|
|
1443 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE)
|
92
|
1444 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1445 |
apply (frule same_inode_files_prop11)
|
92
|
1446 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd)
|
|
1447 |
apply (simp add:dalive_simps)+
|
77
|
1448 |
apply (frule_tac f = "f'" in is_file_has_sfile', simp, erule exE)
|
|
1449 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted split:if_splits)
|
|
1450 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1451 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1452 |
apply (erule conjE, erule disjE)
|
92
|
1453 |
apply (rule_tac x = "D_proc p" in exI)
|
77
|
1454 |
apply (simp add:co2sobj.simps)
|
|
1455 |
apply (erule exE, erule conjE)
|
92
|
1456 |
apply (case_tac "obj = D_proc p")
|
77
|
1457 |
apply (rule_tac x = "obj'" in exI, simp, frule_tac obj = obj' in co2sobj_sproc_imp, erule exE)
|
92
|
1458 |
apply (frule_tac obj = obj' in dalive_co2sobj_closefd3, simp+)
|
77
|
1459 |
apply (simp add:co2sobj_closefd)
|
|
1460 |
apply (simp add:co2sobj.simps)
|
92
|
1461 |
apply (case_tac "obj = D_file a", simp add:co2sobj.simps)
|
|
1462 |
apply (frule_tac obj = obj in dalive_co2sobj_closefd3, simp+)
|
|
1463 |
apply (case_tac obj)
|
77
|
1464 |
apply (rule_tac x = obj in exI)
|
|
1465 |
apply (simp add:co2sobj_closefd)
|
92
|
1466 |
apply (case_tac "list = a", simp add:dalive_simps)
|
|
1467 |
apply (case_tac "list \<in> same_inode_files s a")
|
77
|
1468 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1469 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
|
1470 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
|
1471 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
|
1472 |
apply (erule disjE)
|
|
1473 |
apply (drule same_inode_files_prop10, simp add:file_of_pfd_is_file, erule exE, erule conjE)
|
92
|
1474 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1475 |
apply (frule same_inode_files_prop11)
|
92
|
1476 |
apply (frule_tac obj = "D_file f'" in co2sobj_closefd)
|
|
1477 |
apply (simp add:dalive_simps)+
|
77
|
1478 |
apply (frule_tac f = "f'" in is_file_has_sfile', simp, erule exE)
|
|
1479 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted split:if_splits)
|
|
1480 |
apply (rule impI, erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1481 |
apply (erule bexE, erule conjE, erule_tac x = f'' in ballE, simp, simp)
|
|
1482 |
apply (erule conjE, erule disjE)
|
92
|
1483 |
apply (rule_tac x = "D_proc p" in exI)
|
77
|
1484 |
apply (simp add:co2sobj.simps)
|
|
1485 |
apply (erule conjE, erule exE, erule conjE)
|
92
|
1486 |
apply (case_tac "obj = D_proc p", simp add:co2sobj.simps)
|
|
1487 |
apply (case_tac "obj = D_file a", simp add:co2sobj.simps)
|
|
1488 |
apply (case_tac obj)
|
77
|
1489 |
apply (rule_tac x = obj in exI)
|
|
1490 |
apply (simp add:co2sobj_closefd)
|
92
|
1491 |
apply (case_tac "list \<in> same_inode_files s a")
|
77
|
1492 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1493 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_file_simps)
|
|
1494 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd is_dir_simps)
|
|
1495 |
apply (rule_tac x = obj in exI, simp add:co2sobj_closefd)
|
|
1496 |
|
|
1497 |
apply (rule impI)
|
|
1498 |
apply (simp add:update_s2ss_obj_def)
|
|
1499 |
apply (rule conjI, rule impI, erule exE, erule conjE)
|
|
1500 |
apply (simp add:s2ss_def)
|
|
1501 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE)
|
|
1502 |
apply (simp)
|
92
|
1503 |
apply (case_tac "obj = D_proc p")
|
77
|
1504 |
apply (simp add:co2sobj.simps split:if_splits)
|
|
1505 |
apply (rule disjI2, rule_tac x = obj in exI, erule conjE)
|
92
|
1506 |
apply (simp add:dalive_co2sobj_closefd')
|
|
1507 |
apply (frule_tac obj = obj in co2sobj_closefd, simp, simp split:t_dobject.splits if_splits)
|
77
|
1508 |
apply (simp, erule disjE)
|
92
|
1509 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1510 |
apply (erule exE, erule conjE)
|
92
|
1511 |
apply (case_tac "obj = D_proc p")
|
|
1512 |
apply (rule_tac x = obj' in exI, simp add:dalive_co2sobj_closefd1)
|
|
1513 |
apply (frule_tac obj = obj' in co2sobj_closefd, simp add:dalive_co2sobj_closefd1)
|
|
1514 |
apply (clarsimp split:t_dobject.splits if_splits option.splits simp:co2sobj.simps)
|
|
1515 |
apply (rule_tac x = obj in exI, simp add:dalive_co2sobj_closefd1)
|
|
1516 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:dalive_co2sobj_closefd1)
|
|
1517 |
apply (clarsimp split:t_dobject.splits if_splits option.splits simp: co2sobj.simps)
|
77
|
1518 |
apply (rule impI)
|
|
1519 |
apply (simp add:s2ss_def)
|
|
1520 |
apply (rule set_eqI, rule iffI, erule CollectE, erule exE, erule conjE)
|
|
1521 |
apply (simp)
|
92
|
1522 |
apply (case_tac "obj = D_proc p")
|
77
|
1523 |
apply (rule disjI1, simp add:co2sobj.simps split:if_splits)
|
92
|
1524 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI, simp add:dalive_co2sobj_closefd')
|
|
1525 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:dalive_co2sobj_closefd1)
|
|
1526 |
apply (clarsimp split:t_dobject.splits if_splits option.splits simp: co2sobj.simps)
|
|
1527 |
apply (rule notI, erule_tac x = obj in allE, simp add:dalive_co2sobj_closefd')
|
|
1528 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:dalive_co2sobj_closefd1)
|
|
1529 |
apply (clarsimp split:t_dobject.splits if_splits option.splits)
|
77
|
1530 |
apply (simp)
|
|
1531 |
apply (erule disjE)
|
92
|
1532 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps)
|
77
|
1533 |
apply (erule exE|erule conjE)+
|
|
1534 |
apply (rule_tac x = obj in exI)
|
92
|
1535 |
apply (frule_tac obj = obj in co2sobj_closefd, simp add:dalive_co2sobj_closefd1)
|
|
1536 |
apply (clarsimp split:t_dobject.splits if_splits option.splits
|
|
1537 |
simp: co2sobj.simps dalive_co2sobj_closefd1)
|
77
|
1538 |
done
|
|
1539 |
|
92
|
1540 |
lemma dalive_co2sobj_unlink:
|
|
1541 |
"\<lbrakk>dalive s obj; valid (UnLink p f # s); obj \<noteq> D_file f\<rbrakk>
|
|
1542 |
\<Longrightarrow> dalive (UnLink p f # s) obj"
|
|
1543 |
by (auto simp add:dalive_simps split:t_dobject.splits)
|
77
|
1544 |
|
|
1545 |
lemma s2ss_unlink:
|
|
1546 |
"valid (UnLink p f # s) \<Longrightarrow> s2ss (UnLink p f # s) = (
|
|
1547 |
if (proc_fd_of_file s f = {})
|
|
1548 |
then (case (cf2sfile s f) of
|
|
1549 |
Some sf \<Rightarrow> del_s2ss_file s (s2ss s) f sf
|
|
1550 |
| _ \<Rightarrow> {})
|
|
1551 |
else s2ss s)"
|
|
1552 |
apply (frule vd_cons, frule vt_grant_os, clarsimp split:if_splits)
|
|
1553 |
apply (frule is_file_has_sfile', simp, erule exE, simp)
|
|
1554 |
apply (rule conjI, rule impI)
|
|
1555 |
apply (simp add:update_s2ss_sfile_del_def del_s2ss_file_def)
|
|
1556 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ defer
|
|
1557 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+
|
|
1558 |
|
|
1559 |
apply (simp add:s2ss_def)
|
|
1560 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1561 |
apply (case_tac "obj = D_file f", simp add:is_file_simps)
|
77
|
1562 |
apply simp
|
|
1563 |
apply (rule conjI)
|
92
|
1564 |
apply (rule_tac x = obj in exI,simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits)
|
77
|
1565 |
apply (rule notI, simp, frule_tac obj = obj in co2sobj_sfile_imp, erule exE, simp)
|
|
1566 |
apply (frule_tac obj = obj in co2sobj_unlink, simp)
|
|
1567 |
apply (erule_tac x = fa in allE, simp add:is_file_simps)
|
|
1568 |
apply (simp add:co2sobj.simps)
|
|
1569 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1570 |
apply (case_tac "obj = D_file f", simp add:co2sobj.simps)
|
|
1571 |
apply (frule_tac dalive_co2sobj_unlink, simp, simp)
|
77
|
1572 |
apply (frule_tac obj = obj in co2sobj_unlink, simp)
|
|
1573 |
apply (rule_tac x = obj in exI)
|
92
|
1574 |
apply (simp add:co2sobj.simps split:t_dobject.splits if_splits)
|
77
|
1575 |
|
|
1576 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ defer
|
|
1577 |
|
|
1578 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+
|
|
1579 |
apply (simp add:s2ss_def)
|
|
1580 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1581 |
apply (case_tac "obj = D_file f", simp add:dalive_simps)
|
|
1582 |
apply (case_tac obj)
|
77
|
1583 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
|
1584 |
apply (simp add:co2sobj_unlink)
|
92
|
1585 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1586 |
apply (rule disjI1)
|
|
1587 |
apply (simp add:co2sobj_unlink)
|
|
1588 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop split:if_splits)
|
|
1589 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp)
|
|
1590 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
|
1591 |
apply (simp add:co2sobj_unlink is_file_simps)
|
|
1592 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps)
|
|
1593 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
|
1594 |
apply (tactic {*my_setiff_tac 1*})
|
|
1595 |
apply (drule same_inode_files_prop10, simp, erule exE, erule conjE)
|
92
|
1596 |
apply (rule_tac x = "D_file f'a" in exI, simp add:is_file_simps)
|
|
1597 |
apply (frule_tac obj = "D_file f'a" in co2sobj_unlink, simp add:same_inode_files_prop11 is_file_simps)
|
77
|
1598 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop
|
|
1599 |
is_file_simps same_inode_files_prop11 split:if_splits)
|
|
1600 |
apply (rule impI, erule bexE, erule_tac x = f'' in ballE, simp, simp)
|
|
1601 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp)
|
|
1602 |
|
|
1603 |
apply (tactic {*my_setiff_tac 1*})
|
|
1604 |
apply (case_tac "f' = f", simp add:same_inode_files_prop9)
|
92
|
1605 |
apply (case_tac "obj= D_file f")
|
|
1606 |
apply (rule_tac x = "D_file f'" in exI, simp add:is_file_simps)
|
77
|
1607 |
apply (frule_tac f' = f' in cf2sfiles_unlink, simp add:current_files_simps is_file_in_current)
|
|
1608 |
apply (simp add:co2sobj.simps)
|
92
|
1609 |
apply (case_tac obj)
|
77
|
1610 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
92
|
1611 |
apply (case_tac "list \<in> same_inode_files s f")
|
|
1612 |
apply (rule_tac x = "D_file f'" in exI)
|
77
|
1613 |
apply (frule_tac f' = f' in cf2sfiles_unlink, simp add:current_files_simps is_file_in_current)
|
|
1614 |
apply (simp add:co2sobj.simps is_file_simps cf2sfiles_prop same_inodes_tainted)
|
|
1615 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps)
|
|
1616 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps)
|
|
1617 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
|
1618 |
|
|
1619 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+ defer
|
|
1620 |
|
|
1621 |
apply (rule impI|erule conjE|erule exE|rule conjI|erule bexE)+
|
|
1622 |
apply (simp add:s2ss_def)
|
|
1623 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1624 |
apply (case_tac "obj = D_file f", simp add:dalive_simps, simp)
|
|
1625 |
apply (case_tac obj)
|
77
|
1626 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI)
|
|
1627 |
apply (simp add:co2sobj_unlink)
|
|
1628 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
92
|
1629 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1630 |
apply (rule disjI1)
|
|
1631 |
apply (simp add:co2sobj_unlink)
|
|
1632 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop split:if_splits)
|
|
1633 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp)
|
|
1634 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI)
|
|
1635 |
apply (simp add:co2sobj_unlink is_file_simps)
|
|
1636 |
apply (rule notI, simp add:co2sobj_unlink)
|
92
|
1637 |
apply (erule_tac x = list in allE, simp add:co2sobj.simps is_file_simps)
|
77
|
1638 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps)
|
|
1639 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1640 |
apply (rule disjI2, rule conjI, simp, rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
|
1641 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1642 |
apply (tactic {*my_setiff_tac 1*})
|
|
1643 |
apply (drule same_inode_files_prop10, simp, erule exE, erule conjE)
|
92
|
1644 |
apply (rule_tac x = "D_file f'" in exI, simp add:is_file_simps)
|
|
1645 |
apply (frule_tac obj = "D_file f'" in co2sobj_unlink, simp add:same_inode_files_prop11 is_file_simps)
|
77
|
1646 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop
|
|
1647 |
is_file_simps same_inode_files_prop11 split:if_splits)
|
|
1648 |
apply (rule impI, erule bexE, erule_tac x = f'' in ballE, simp, simp)
|
|
1649 |
apply (erule bexE, erule_tac x = f'' in ballE, simp, simp)
|
|
1650 |
apply (tactic {*my_setiff_tac 1*}, simp)
|
92
|
1651 |
apply (case_tac "obj = D_file f", simp add:co2sobj.simps)
|
|
1652 |
apply (case_tac obj)
|
77
|
1653 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
92
|
1654 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1655 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1656 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps)
|
|
1657 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps)
|
|
1658 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
|
1659 |
|
|
1660 |
apply (rule impI)
|
|
1661 |
apply (simp add:s2ss_def)
|
|
1662 |
apply (tactic {*my_seteq_tac 1*})
|
|
1663 |
apply (rule_tac x = obj in exI)
|
92
|
1664 |
apply (simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits)
|
77
|
1665 |
apply (tactic {*my_setiff_tac 1*})
|
|
1666 |
apply (rule_tac x = obj in exI)
|
92
|
1667 |
apply (subgoal_tac "dalive (UnLink p f # s) obj")
|
|
1668 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits)[1]
|
|
1669 |
apply (auto simp add:co2sobj_unlink dalive_simps split:t_dobject.splits)[1]
|
77
|
1670 |
|
|
1671 |
apply (simp add:s2ss_def)
|
|
1672 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1673 |
apply (case_tac "obj = D_file f", simp add:dalive_simps)
|
|
1674 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits)
|
77
|
1675 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1676 |
apply (case_tac "obj = D_file f")
|
|
1677 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1678 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits)[1]
|
77
|
1679 |
apply (rule_tac x =obj in exI)
|
92
|
1680 |
apply (subgoal_tac "dalive (UnLink p f # s) obj")
|
|
1681 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits)[1]
|
|
1682 |
apply (auto simp add:co2sobj_unlink dalive_simps split:t_dobject.splits)[1]
|
77
|
1683 |
|
|
1684 |
apply (simp add:s2ss_def)
|
|
1685 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1686 |
apply (case_tac "obj = D_file f", simp add:dalive_simps)
|
|
1687 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits if_splits)
|
77
|
1688 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1689 |
apply (case_tac "obj = D_file f")
|
|
1690 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1691 |
apply (auto simp add:co2sobj_unlink is_file_simps is_dir_simps same_inode_files_prop9 split:t_dobject.splits)[1]
|
|
1692 |
apply (case_tac obj)
|
77
|
1693 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
92
|
1694 |
apply (case_tac "list \<in> same_inode_files s f")
|
|
1695 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1696 |
apply (simp add:dalive_simps co2sobj.simps)
|
77
|
1697 |
apply (rule conjI, rule notI, simp add:same_inode_files_prop9)
|
|
1698 |
apply (rule impI, frule_tac f' = f' in cf2sfiles_unlink)
|
|
1699 |
apply (simp add:current_files_simps is_file_simps is_file_in_current)
|
|
1700 |
apply (simp add:same_inodes_tainted cf2sfiles_prop)
|
|
1701 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps)
|
|
1702 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps)
|
|
1703 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
|
1704 |
|
|
1705 |
apply (simp add:s2ss_def)
|
|
1706 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1707 |
apply (case_tac "obj = D_file f", simp add:dalive_simps)
|
|
1708 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps is_dir_simps split:t_dobject.splits if_splits)
|
77
|
1709 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1710 |
apply (case_tac "obj = D_file f")
|
|
1711 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1712 |
apply (subgoal_tac "dalive (UnLink p f # s) (D_file f')")
|
77
|
1713 |
apply (frule same_inode_files_prop11, frule_tac f = f' in is_file_has_sfile', simp add:vd_cons, erule exE)
|
92
|
1714 |
apply (frule_tac obj = "D_file f'" in co2sobj_unlink, simp)
|
77
|
1715 |
apply (simp split:if_splits option.splits add:is_file_simps)
|
|
1716 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1717 |
apply (auto split:t_sobject.splits)[1]
|
|
1718 |
apply (simp add:is_file_simps same_inode_files_prop11)
|
92
|
1719 |
apply (case_tac obj)
|
77
|
1720 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
92
|
1721 |
apply (case_tac "list \<in> same_inode_files s f")
|
|
1722 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1723 |
apply (subgoal_tac "dalive (UnLink p f # s) (D_file f')")
|
77
|
1724 |
apply (frule same_inode_files_prop11, frule_tac f = f' in is_file_has_sfile', simp add:vd_cons, erule exE)
|
92
|
1725 |
apply (frule_tac obj = "D_file f'" in co2sobj_unlink, simp)
|
77
|
1726 |
apply (simp split:if_splits option.splits add:is_file_simps)
|
|
1727 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
|
1728 |
apply (auto split:t_sobject.splits)[1]
|
|
1729 |
apply (simp add:is_file_simps same_inode_files_prop11)
|
|
1730 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_file_simps)
|
|
1731 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink is_dir_simps)
|
|
1732 |
apply (rule_tac x = obj in exI, simp add:co2sobj_unlink)
|
|
1733 |
done
|
|
1734 |
|
|
1735 |
lemma s2ss_rmdir: "valid (Rmdir p f # s) \<Longrightarrow> s2ss (Rmdir p f # s) = (
|
92
|
1736 |
case (co2sobj s (D_dir f)) of
|
|
1737 |
Some sdir \<Rightarrow> del_s2ss_obj s (s2ss s) (D_dir f) sdir
|
77
|
1738 |
| _ \<Rightarrow> {})"
|
|
1739 |
apply (frule vd_cons, frule vt_grant_os)
|
|
1740 |
apply (clarsimp simp:dir_is_empty_def)
|
|
1741 |
apply (frule is_dir_has_sdir', simp, erule exE)
|
|
1742 |
apply (simp split:option.splits, rule conjI, rule impI, simp add:co2sobj.simps)
|
|
1743 |
apply (rule allI, rule impI)
|
|
1744 |
|
|
1745 |
apply (simp add:del_s2ss_obj_def)
|
|
1746 |
apply (rule conjI|rule impI|erule exE|erule conjE)+
|
|
1747 |
apply (simp add:s2ss_def)
|
|
1748 |
apply (tactic {*my_seteq_tac 1*})
|
|
1749 |
apply (rule_tac x = obj in exI)
|
92
|
1750 |
apply (simp add:co2sobj_rmdir is_file_simps is_dir_simps dalive_simps split:t_dobject.splits if_splits)
|
77
|
1751 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1752 |
apply (case_tac "obj = D_dir f")
|
77
|
1753 |
apply (rule_tac x = obj' in exI)
|
92
|
1754 |
apply (subgoal_tac "dalive (Rmdir p f # s) obj'")
|
|
1755 |
apply (auto simp add:co2sobj_rmdir is_file_simps is_dir_simps split:t_dobject.splits)[1]
|
|
1756 |
apply (simp add:dalive_rmdir)
|
77
|
1757 |
apply (rule_tac x = obj in exI)
|
92
|
1758 |
apply (subgoal_tac "dalive (Rmdir p f # s) obj")
|
|
1759 |
apply (auto simp add:co2sobj_rmdir is_file_simps is_dir_simps split:t_dobject.splits)[1]
|
|
1760 |
apply (simp add:dalive_rmdir)
|
77
|
1761 |
|
|
1762 |
apply (rule conjI|rule impI|erule exE|erule conjE)+
|
|
1763 |
apply (simp add:s2ss_def)
|
|
1764 |
apply (tactic {*my_seteq_tac 1*})
|
|
1765 |
apply simp
|
92
|
1766 |
apply (case_tac "obj = D_dir f", simp add:dalive_rmdir)
|
77
|
1767 |
apply (rule conjI)
|
92
|
1768 |
apply (rule_tac x = obj in exI, simp add:co2sobj_rmdir dalive_rmdir)
|
77
|
1769 |
apply (simp add:co2sobj_rmdir)
|
92
|
1770 |
apply (simp add:dalive_rmdir, erule_tac x = obj in allE, simp)
|
77
|
1771 |
apply (tactic {*my_setiff_tac 1*}, simp)
|
92
|
1772 |
apply (case_tac "obj = D_dir f", simp)
|
|
1773 |
apply (rule_tac x = obj in exI, simp add:co2sobj_rmdir dalive_rmdir)
|
77
|
1774 |
done
|
|
1775 |
|
|
1776 |
lemma s2ss_mkdir: "valid (Mkdir p f inum # s) \<Longrightarrow> s2ss (Mkdir p f inum # s) = (
|
|
1777 |
case (cf2sfile (Mkdir p f inum # s) f) of
|
|
1778 |
Some sf \<Rightarrow> (s2ss s) \<union> {S_dir sf}
|
|
1779 |
| _ \<Rightarrow> {})"
|
|
1780 |
apply (frule vt_grant_os, frule vd_cons, clarsimp)
|
|
1781 |
apply (case_tac "cf2sfile (Mkdir p f inum # s) f")
|
|
1782 |
apply (drule current_file_has_sfile', simp, simp add:current_files_simps, simp)
|
|
1783 |
|
|
1784 |
apply (simp add:s2ss_def)
|
|
1785 |
apply (tactic {*my_seteq_tac 1*}, simp)
|
92
|
1786 |
apply (case_tac "obj = D_dir f")
|
77
|
1787 |
apply (rule disjI1, simp add:co2sobj.simps)
|
92
|
1788 |
apply (rule disjI2, rule_tac x = obj in exI, simp add:co2sobj_mkdir dalive_simps)
|
77
|
1789 |
apply (tactic {*my_setiff_tac 1*}, simp)
|
92
|
1790 |
apply (rule_tac x = "D_dir f" in exI, simp add:dalive_mkdir co2sobj.simps)
|
77
|
1791 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1792 |
apply (case_tac "obj = D_dir f", simp add:is_dir_in_current)
|
|
1793 |
apply (rule_tac x = obj in exI, simp add:co2sobj_mkdir dalive_mkdir)
|
77
|
1794 |
done
|
|
1795 |
|
|
1796 |
definition update_s2ss_sfile_add :: "t_state \<Rightarrow> t_static_state \<Rightarrow> t_file \<Rightarrow> t_sfile \<Rightarrow> t_static_state"
|
|
1797 |
where
|
|
1798 |
"update_s2ss_sfile_add s ss f sf \<equiv>
|
92
|
1799 |
if (\<exists> f'. is_file s f' \<and> f' \<notin> same_inode_files s f \<and> co2sobj s (D_file f') = co2sobj s (D_file f))
|
77
|
1800 |
then ss \<union> {S_file (cf2sfiles s f \<union> {sf}) (O_file f \<in> tainted s)}
|
|
1801 |
else ss - {S_file (cf2sfiles s f) (O_file f \<in> tainted s)}
|
|
1802 |
\<union> {S_file (cf2sfiles s f \<union> {sf}) (O_file f \<in> tainted s)}"
|
|
1803 |
|
|
1804 |
lemma s2ss_linkhard: "valid (LinkHard p f f' # s) \<Longrightarrow> s2ss (LinkHard p f f' # s) = (
|
|
1805 |
case (cf2sfile (LinkHard p f f' # s) f') of
|
|
1806 |
Some sf \<Rightarrow> update_s2ss_sfile_add s (s2ss s) f sf
|
|
1807 |
| _ \<Rightarrow> {})"
|
|
1808 |
apply (frule vt_grant_os, frule vd_cons, clarsimp)
|
|
1809 |
apply (split option.splits)
|
|
1810 |
apply (rule conjI, rule impI, drule current_file_has_sfile', simp, simp add:current_files_simps)
|
|
1811 |
apply (rule allI, rule impI)
|
|
1812 |
|
|
1813 |
apply (simp add:update_s2ss_sfile_add_def)
|
|
1814 |
apply (rule conjI, rule impI, erule exE, erule conjE, erule conjE)
|
|
1815 |
apply (simp add:s2ss_def)
|
|
1816 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1817 |
apply (case_tac "obj = D_file f'")
|
77
|
1818 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard
|
|
1819 |
same_inode_files_linkhard split:if_splits)
|
|
1820 |
apply (case_tac "O_file f' \<in> tainted s")
|
92
|
1821 |
apply (drule tainted_in_current, simp, simp add:is_file_in_current dalive.simps, simp)
|
|
1822 |
apply (case_tac obj)
|
77
|
1823 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
92
|
1824 |
apply (simp add:co2sobj_linkhard dalive_linkhard)
|
|
1825 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1826 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard
|
|
1827 |
same_inodes_tainted split:if_splits)
|
|
1828 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_file_simps)
|
|
1829 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_dir_simps)
|
|
1830 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_linkhard)
|
|
1831 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1832 |
apply (rule_tac x = "D_file f" in exI)
|
|
1833 |
apply (frule_tac obj = "D_file f" in co2sobj_linkhard)
|
|
1834 |
apply (simp add:dalive_linkhard)
|
|
1835 |
apply (simp add:dalive_linkhard same_inode_files_prop9 split:t_dobject.splits)
|
77
|
1836 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1837 |
apply (case_tac "obj = D_file f'", simp add:dalive_linkhard is_file_in_current)
|
|
1838 |
apply (case_tac obj)
|
|
1839 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
|
1840 |
apply (case_tac "list \<in> same_inode_files s f")
|
|
1841 |
apply (rule_tac x = "D_file f'a" in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
77
|
1842 |
apply (rule conjI, rule impI, simp add:is_file_in_current)
|
|
1843 |
apply (rule impI, simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
92
|
1844 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
|
1845 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
|
1846 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
77
|
1847 |
|
|
1848 |
apply (rule impI)
|
|
1849 |
apply (simp add:s2ss_def)
|
|
1850 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1851 |
apply (case_tac "obj = D_file f'", simp)
|
77
|
1852 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard
|
|
1853 |
same_inode_files_linkhard split:if_splits)
|
|
1854 |
apply (case_tac "O_file f' \<in> tainted s")
|
92
|
1855 |
apply (drule tainted_in_current, simp, simp add:is_file_in_current dalive.simps, simp)
|
|
1856 |
apply (case_tac obj, simp)
|
77
|
1857 |
apply (rule disjI2, rule conjI, rule_tac x = obj in exI)
|
92
|
1858 |
apply (simp add:co2sobj_linkhard dalive_linkhard)
|
77
|
1859 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
92
|
1860 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1861 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_linkhard
|
|
1862 |
same_inodes_tainted split:if_splits)
|
|
1863 |
apply (simp, rule disjI2, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_file_simps)
|
92
|
1864 |
apply (erule_tac x = list in allE, rule notI)
|
77
|
1865 |
apply (simp add:co2sobj_linkhard is_file_simps)
|
|
1866 |
apply (simp add:co2sobj.simps)
|
|
1867 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_linkhard is_dir_simps)
|
|
1868 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1869 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_linkhard)
|
|
1870 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1871 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1872 |
apply (rule_tac x = "D_file f" in exI)
|
|
1873 |
apply (frule_tac obj = "D_file f" in co2sobj_linkhard)
|
|
1874 |
apply (simp add:dalive_linkhard)
|
|
1875 |
apply (simp add:dalive_linkhard same_inode_files_prop9 split:t_dobject.splits)
|
77
|
1876 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1877 |
apply (case_tac "obj = D_file f'", simp add:dalive_linkhard is_file_in_current)
|
|
1878 |
apply (case_tac obj)
|
|
1879 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
|
1880 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1881 |
apply (simp add:co2sobj.simps cf2sfiles_prop same_inodes_tainted)
|
92
|
1882 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
|
1883 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
|
1884 |
apply (rule_tac x = obj in exI, simp add:co2sobj_linkhard dalive_linkhard)
|
77
|
1885 |
done
|
|
1886 |
|
|
1887 |
lemma same_inode_files_prop12:
|
|
1888 |
"is_file s f \<Longrightarrow> f \<in> same_inode_files s f "
|
|
1889 |
by (auto simp:is_file_def same_inode_files_def split:option.splits)
|
|
1890 |
|
|
1891 |
lemma s2ss_truncate: "valid (Truncate p f len # s) \<Longrightarrow> s2ss (Truncate p f len # s) = (
|
|
1892 |
if (O_file f \<notin> tainted s \<and> O_proc p \<in> tainted s \<and> len > 0)
|
|
1893 |
then update_s2ss_sfile_tainted s (s2ss s) f True
|
|
1894 |
else s2ss s)"
|
|
1895 |
apply (frule vt_grant_os, frule vd_cons, simp split:if_splits)
|
|
1896 |
apply (rule conjI, rule impI, (erule conjE)+)
|
|
1897 |
|
|
1898 |
apply (simp add:update_s2ss_sfile_tainted_def)
|
|
1899 |
apply (rule conjI|rule impI|erule exE|erule conjE)+
|
|
1900 |
apply (simp add:s2ss_def)
|
|
1901 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1902 |
apply (case_tac "obj = D_file f")
|
77
|
1903 |
apply (rule disjI1, simp add:co2sobj.simps same_inode_files_prop12 cf2sfiles_other)
|
92
|
1904 |
apply (case_tac obj)
|
|
1905 |
apply (rule disjI2, simp, rule_tac x = obj in exI, simp add:co2sobj_truncate dalive_simps)
|
|
1906 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1907 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_prop cf2sfiles_other)
|
|
1908 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
|
1909 |
apply (simp add:co2sobj_truncate is_file_simps)
|
|
1910 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
|
1911 |
apply (simp add:co2sobj_truncate is_dir_simps)
|
|
1912 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
|
1913 |
apply (simp add:co2sobj_truncate)
|
|
1914 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1915 |
apply (rule_tac x = "D_file f" in exI)
|
77
|
1916 |
apply (simp add:co2sobj.simps is_file_simps cf2sfiles_other same_inode_files_prop12)
|
|
1917 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1918 |
apply (case_tac obj)
|
77
|
1919 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate)
|
92
|
1920 |
apply (case_tac "list \<in> same_inode_files s f")
|
|
1921 |
apply (rule_tac x = "D_file f'" in exI)
|
|
1922 |
apply (auto simp:co2sobj_truncate is_file_simps is_dir_simps split:t_dobject.splits)[1]
|
77
|
1923 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop)
|
|
1924 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_file_simps)
|
|
1925 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_dir_simps)
|
|
1926 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate)
|
|
1927 |
|
|
1928 |
apply (rule conjI|rule impI|erule exE|erule conjE)+
|
|
1929 |
apply (simp add:s2ss_def)
|
|
1930 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1931 |
apply (case_tac "obj = D_file f")
|
77
|
1932 |
apply (rule disjI1, simp add:co2sobj.simps same_inode_files_prop12 cf2sfiles_other)
|
92
|
1933 |
apply (case_tac obj)
|
|
1934 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI, simp add:co2sobj_truncate dalive_simps)
|
77
|
1935 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
92
|
1936 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1937 |
apply (rule disjI1, simp add:co2sobj.simps cf2sfiles_prop cf2sfiles_other)
|
|
1938 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI)
|
|
1939 |
apply (simp add:co2sobj_truncate is_file_simps)
|
|
1940 |
apply (rule notI, simp add:co2sobj_truncate is_file_simps)
|
92
|
1941 |
apply (erule_tac x = list in allE)
|
77
|
1942 |
apply (simp add:co2sobj.simps)
|
|
1943 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI)
|
|
1944 |
apply (simp add:co2sobj_truncate is_dir_simps)
|
|
1945 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1946 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI)
|
|
1947 |
apply (simp add:co2sobj_truncate)
|
|
1948 |
apply (rule notI, simp add:co2sobj.simps split:option.splits)
|
|
1949 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1950 |
apply (rule_tac x = "D_file f" in exI)
|
77
|
1951 |
apply (simp add:co2sobj.simps is_file_simps cf2sfiles_other same_inode_files_prop12)
|
|
1952 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1953 |
apply (case_tac obj)
|
77
|
1954 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate)
|
92
|
1955 |
apply (case_tac "list \<in> same_inode_files s f")
|
77
|
1956 |
apply (simp add:co2sobj.simps same_inodes_tainted cf2sfiles_prop)
|
|
1957 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_file_simps)
|
|
1958 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate is_dir_simps)
|
|
1959 |
apply (rule_tac x = obj in exI, simp add:co2sobj_truncate)
|
|
1960 |
|
|
1961 |
apply (rule impI, simp add:s2ss_def)
|
|
1962 |
apply (tactic {*my_seteq_tac 1*})
|
|
1963 |
apply (rule_tac x = obj in exI)
|
92
|
1964 |
apply (simp add:dalive_simps co2sobj_truncate)
|
|
1965 |
apply (simp split:t_dobject.splits if_splits add:co2sobj.simps)
|
77
|
1966 |
apply (case_tac "O_proc p \<in> tainted s", simp add:same_inodes_tainted)
|
|
1967 |
apply simp
|
|
1968 |
apply (tactic {*my_setiff_tac 1*})
|
|
1969 |
apply (rule_tac x = obj in exI)
|
92
|
1970 |
apply (simp add:dalive_simps co2sobj_truncate)
|
|
1971 |
apply (auto split:t_dobject.splits if_splits simp:co2sobj.simps same_inodes_tainted)
|
77
|
1972 |
done
|
|
1973 |
|
|
1974 |
lemma s2ss_createmsgq: "valid (CreateMsgq p q # s) \<Longrightarrow> s2ss (CreateMsgq p q # s) =
|
|
1975 |
(case (cq2smsgq (CreateMsgq p q # s) q) of
|
|
1976 |
Some sq \<Rightarrow> s2ss s \<union> {S_msgq sq}
|
|
1977 |
| _ \<Rightarrow> {})"
|
|
1978 |
apply (frule vd_cons, frule vt_grant_os, clarsimp)
|
|
1979 |
apply (case_tac "cq2smsgq (CreateMsgq p q # s) q")
|
|
1980 |
apply (drule current_has_smsgq', simp+)
|
|
1981 |
apply (simp add:s2ss_def)
|
|
1982 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
1983 |
apply (case_tac "obj = D_msgq q")
|
77
|
1984 |
apply (rule disjI1, simp add:co2sobj.simps)
|
|
1985 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
92
|
1986 |
apply (simp add:co2sobj_createmsgq is_file_simps is_dir_simps split:t_dobject.splits if_splits)
|
77
|
1987 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1988 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
1989 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
1990 |
apply (case_tac "obj = D_msgq q")
|
77
|
1991 |
apply simp
|
|
1992 |
apply (rule_tac x = obj in exI)
|
92
|
1993 |
apply (auto simp add:co2sobj_createmsgq dalive_simps split:t_dobject.splits if_splits)
|
77
|
1994 |
done
|
|
1995 |
|
|
1996 |
lemma s2ss_sendmsg: "valid (SendMsg p q m # s) \<Longrightarrow> s2ss (SendMsg p q m # s) = (
|
|
1997 |
case (cq2smsgq s q, cq2smsgq (SendMsg p q m # s) q) of
|
92
|
1998 |
(Some sq, Some sq') \<Rightarrow> update_s2ss_obj s (s2ss s) (D_msgq q) (S_msgq sq) (S_msgq sq')
|
77
|
1999 |
| _ \<Rightarrow> {})"
|
|
2000 |
apply (frule vd_cons, frule vt_grant_os, clarsimp)
|
|
2001 |
apply (case_tac "cq2smsgq s q")
|
|
2002 |
apply (drule current_has_smsgq', simp+)
|
|
2003 |
apply (case_tac "cq2smsgq (SendMsg p q m # s) q")
|
|
2004 |
apply (drule current_has_smsgq', simp+)
|
|
2005 |
|
|
2006 |
apply (simp add:update_s2ss_obj_def)
|
|
2007 |
apply (tactic {*my_clarify_tac 1*})
|
|
2008 |
apply (simp add:s2ss_def)
|
|
2009 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2010 |
apply (case_tac "obj = D_msgq q")
|
77
|
2011 |
apply (rule disjI1, simp add:co2sobj.simps)
|
|
2012 |
apply (rule disjI2, simp, rule_tac x = obj in exI)
|
92
|
2013 |
apply (simp add:co2sobj_sendmsg is_file_simps is_dir_simps split:t_dobject.splits if_splits)
|
|
2014 |
apply (tactic {*my_setiff_tac 1*})
|
|
2015 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2016 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2017 |
apply (case_tac "obj = D_msgq q")
|
77
|
2018 |
apply (rule_tac x = obj' in exI)
|
92
|
2019 |
apply (simp add:co2sobj_sendmsg dalive_sendmsg split:t_dobject.splits if_splits)
|
77
|
2020 |
apply (auto simp:co2sobj.simps)[1]
|
92
|
2021 |
apply (rule_tac x = obj in exI, simp add:co2sobj_sendmsg dalive_sendmsg split:t_dobject.splits)
|
77
|
2022 |
apply (auto simp:co2sobj.simps)[1]
|
|
2023 |
|
|
2024 |
apply (rule impI)
|
|
2025 |
apply (simp add:s2ss_def)
|
|
2026 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2027 |
apply (case_tac "obj = D_msgq q")
|
77
|
2028 |
apply (rule disjI1, simp add:co2sobj.simps)
|
|
2029 |
apply (rule disjI2, simp, rule conjI, rule_tac x = obj in exI)
|
92
|
2030 |
apply (simp add:co2sobj_sendmsg is_file_simps is_dir_simps split:t_dobject.splits if_splits)
|
77
|
2031 |
apply (rule notI, simp)
|
|
2032 |
apply (frule_tac obj = obj in co2sobj_smsgq_imp, erule exE, simp)
|
|
2033 |
apply (erule_tac x = obj in allE, simp add:co2sobj_sendmsg)
|
|
2034 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2035 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2036 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2037 |
apply (case_tac "obj = D_msgq q")
|
77
|
2038 |
apply (simp add:co2sobj.simps)
|
92
|
2039 |
apply (rule_tac x = obj in exI, simp add:co2sobj_sendmsg dalive_sendmsg split:t_dobject.splits)
|
77
|
2040 |
apply (auto simp:co2sobj.simps)[1]
|
|
2041 |
done
|
|
2042 |
|
92
|
2043 |
lemma dalive_co2sobj_removemsgq:
|
|
2044 |
"\<lbrakk>dalive s obj; valid (RemoveMsgq p q # s); obj \<noteq> D_msgq q\<rbrakk>
|
|
2045 |
\<Longrightarrow> dalive (RemoveMsgq p q # s) obj"
|
|
2046 |
apply (case_tac obj)
|
77
|
2047 |
apply (auto simp:is_file_simps is_dir_simps)
|
|
2048 |
done
|
|
2049 |
|
|
2050 |
lemma s2ss_removemsgq: "valid (RemoveMsgq p q # s) \<Longrightarrow> s2ss (RemoveMsgq p q # s) =
|
|
2051 |
(case (cq2smsgq s q) of
|
92
|
2052 |
Some sq \<Rightarrow> del_s2ss_obj s (s2ss s) (D_msgq q) (S_msgq sq)
|
77
|
2053 |
| _ \<Rightarrow> {})"
|
|
2054 |
apply (frule vd_cons, frule vt_grant_os, clarsimp)
|
|
2055 |
apply (split option.splits, rule conjI, rule impI)
|
|
2056 |
apply (drule current_has_smsgq', simp, simp)
|
|
2057 |
apply (rule allI, rule impI)
|
|
2058 |
|
|
2059 |
apply (simp add:del_s2ss_obj_def)
|
|
2060 |
apply (tactic {*my_clarify_tac 1*})
|
|
2061 |
apply (simp add:s2ss_def)
|
|
2062 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2063 |
apply (case_tac "obj = D_msgq q", simp)
|
77
|
2064 |
apply (rule_tac x = obj in exI)
|
92
|
2065 |
apply (simp add:co2sobj_removemsgq dalive_simps split:t_dobject.splits if_splits)
|
77
|
2066 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2067 |
apply (case_tac "obj = D_msgq q", simp)
|
77
|
2068 |
apply (rule_tac x = obj' in exI)
|
|
2069 |
apply (frule_tac obj = obj' in co2sobj_smsgq_imp, erule exE)
|
92
|
2070 |
apply (simp add:co2sobj_removemsgq dalive_simps split:t_dobject.splits if_splits)
|
77
|
2071 |
apply (simp add:co2sobj.simps)
|
|
2072 |
apply (rule_tac x = obj in exI)
|
92
|
2073 |
apply (simp add:co2sobj_removemsgq dalive_co2sobj_removemsgq)
|
77
|
2074 |
|
|
2075 |
apply (rule impI)
|
|
2076 |
apply (simp add:s2ss_def)
|
|
2077 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2078 |
apply (case_tac "obj = D_msgq q", simp)
|
77
|
2079 |
apply (simp, rule conjI, rule_tac x = obj in exI)
|
92
|
2080 |
apply (simp add:co2sobj_removemsgq dalive_simps split:t_dobject.splits if_splits)
|
77
|
2081 |
apply (rule notI, simp, frule_tac obj = obj in co2sobj_smsgq_imp, erule exE)
|
92
|
2082 |
apply (erule_tac x = obj in allE, simp add:co2sobj_removemsgq dalive_co2sobj_removemsgq)
|
77
|
2083 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2084 |
apply (case_tac "obj = D_msgq q", simp)
|
77
|
2085 |
apply (simp add:co2sobj.simps)
|
|
2086 |
apply (rule_tac x = obj in exI)
|
92
|
2087 |
apply (simp add:co2sobj_removemsgq dalive_co2sobj_removemsgq)
|
77
|
2088 |
done
|
|
2089 |
|
|
2090 |
declare Product_Type.split_paired_Ex Product_Type.split_paired_All [simp del]
|
|
2091 |
|
|
2092 |
lemma s2ss_recvmsg: "valid (RecvMsg p q m # s) \<Longrightarrow> s2ss (RecvMsg p q m # s) = (
|
|
2093 |
case (cq2smsgq s q, cq2smsgq (RecvMsg p q m # s) q, cp2sproc s p) of
|
|
2094 |
(Some sq, Some sq', Some sp) \<Rightarrow> if (O_msg q m \<in> tainted s \<and> O_proc p \<notin> tainted s)
|
|
2095 |
then update_s2ss_obj s (update_s2ss_obj s (s2ss s)
|
92
|
2096 |
(D_proc p) (S_proc sp False) (S_proc sp True))
|
|
2097 |
(D_msgq q) (S_msgq sq) (S_msgq sq')
|
|
2098 |
else update_s2ss_obj s (s2ss s) (D_msgq q) (S_msgq sq) (S_msgq sq')
|
77
|
2099 |
| _ \<Rightarrow> {})"
|
|
2100 |
apply (frule vt_grant_os, frule vd_cons)
|
|
2101 |
apply (case_tac "cq2smsgq s q")
|
|
2102 |
apply (drule current_has_smsgq', simp, simp)
|
|
2103 |
apply (case_tac "cq2smsgq (RecvMsg p q m # s) q")
|
|
2104 |
apply (drule current_has_smsgq', simp, simp)
|
|
2105 |
apply (case_tac "cp2sproc s p")
|
|
2106 |
apply (drule current_proc_has_sp', simp, simp+)
|
|
2107 |
|
|
2108 |
apply (tactic {*my_clarify_tac 1*})
|
|
2109 |
apply (simp add:update_s2ss_obj_def)
|
|
2110 |
|
|
2111 |
apply (tactic {*my_clarify_tac 1*})
|
|
2112 |
apply (simp add:s2ss_def)
|
|
2113 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2114 |
apply (case_tac "obj = D_msgq q")
|
77
|
2115 |
apply (rule disjI1, simp add:co2sobj.simps)
|
92
|
2116 |
apply (case_tac "obj = D_proc p")
|
77
|
2117 |
apply (rule disjI2, rule disjI1, simp add:co2sobj.simps cp2sproc_other)
|
|
2118 |
apply (rule disjI2, rule disjI2, simp)
|
|
2119 |
apply (rule_tac x = obj in exI)
|
92
|
2120 |
apply (simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)
|
77
|
2121 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2122 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2123 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2124 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
2125 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2126 |
apply (case_tac "obj = D_msgq q")
|
77
|
2127 |
apply (frule co2sobj_smsgq_imp, erule exE)
|
92
|
2128 |
apply (rule_tac x = "D_msgq qa" in exI, simp add:dalive_recvmsg co2sobj_recvmsg)
|
77
|
2129 |
apply (simp add:co2sobj.simps)
|
92
|
2130 |
apply (case_tac "obj = D_proc p")
|
77
|
2131 |
apply (frule co2sobj_sproc_imp, erule exE)
|
92
|
2132 |
apply (rule_tac x = "D_proc pa" in exI, simp add:dalive_recvmsg co2sobj_recvmsg)
|
77
|
2133 |
apply (simp add:co2sobj.simps)
|
|
2134 |
apply (rule_tac x = obj in exI)
|
92
|
2135 |
apply (auto simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)[1]
|
77
|
2136 |
|
|
2137 |
apply (tactic {*my_clarify_tac 1*})
|
|
2138 |
apply (simp add:s2ss_def)
|
|
2139 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2140 |
apply (case_tac "obj = D_msgq q")
|
77
|
2141 |
apply (rule disjI1, simp add:co2sobj.simps)
|
92
|
2142 |
apply (case_tac "obj = D_proc p")
|
77
|
2143 |
apply (rule disjI2, simp add:co2sobj.simps cp2sproc_other)
|
|
2144 |
apply (rule notI, simp)
|
|
2145 |
apply (rule disjI2, simp, rule conjI, rule disjI2)
|
|
2146 |
apply (rule_tac x = obj in exI)
|
92
|
2147 |
apply (simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)
|
77
|
2148 |
apply (rule notI, simp)
|
|
2149 |
apply (frule co2sobj_smsgq_imp, erule exE)
|
92
|
2150 |
apply (erule_tac x = "D_msgq qa" in allE, simp add:dalive_recvmsg co2sobj_recvmsg split:if_splits)
|
77
|
2151 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2152 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2153 |
apply (tactic {*my_setiff_tac 1*}, simp, erule disjE)
|
92
|
2154 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
2155 |
apply (erule exE, erule conjE)
|
92
|
2156 |
apply (case_tac "obj = D_msgq q", simp add:co2sobj.simps)
|
|
2157 |
apply (case_tac "obj = D_proc p")
|
77
|
2158 |
apply (frule_tac co2sobj_sproc_imp, erule exE)
|
92
|
2159 |
apply (rule_tac x = "D_proc pa" in exI, simp add:dalive_recvmsg co2sobj_recvmsg)
|
77
|
2160 |
apply (simp add:co2sobj.simps)
|
|
2161 |
apply (rule_tac x = obj in exI)
|
92
|
2162 |
apply (auto simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)[1]
|
77
|
2163 |
|
|
2164 |
apply (tactic {*my_clarify_tac 1*})
|
|
2165 |
apply (simp add:s2ss_def)
|
|
2166 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2167 |
apply (case_tac "obj = D_msgq q")
|
77
|
2168 |
apply (rule disjI1, simp add:co2sobj.simps)
|
92
|
2169 |
apply (case_tac "obj = D_proc p")
|
77
|
2170 |
apply (rule disjI2, rule disjI1, simp add:co2sobj.simps cp2sproc_other)
|
|
2171 |
apply (rule disjI2, rule disjI2, simp, rule conjI)
|
|
2172 |
apply (rule_tac x = obj in exI)
|
92
|
2173 |
apply (simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)
|
77
|
2174 |
apply (rule notI, simp)
|
|
2175 |
apply (frule co2sobj_sproc_imp, erule exE)
|
92
|
2176 |
apply (erule_tac x = "D_proc pa" in allE, simp add:co2sobj_recvmsg split:t_dobject.splits)
|
77
|
2177 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2178 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2179 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2180 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
2181 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2182 |
apply (case_tac "obj = D_msgq q")
|
77
|
2183 |
apply (frule co2sobj_smsgq_imp, erule exE)
|
92
|
2184 |
apply (rule_tac x = "D_msgq qa" in exI, simp add:dalive_recvmsg co2sobj_recvmsg)
|
77
|
2185 |
apply (simp add:co2sobj.simps)
|
92
|
2186 |
apply (case_tac "obj = D_proc p")
|
77
|
2187 |
apply (simp add:co2sobj.simps)
|
|
2188 |
apply (rule_tac x = obj in exI)
|
92
|
2189 |
apply (auto simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)[1]
|
77
|
2190 |
|
|
2191 |
apply (tactic {*my_clarify_tac 1*})
|
|
2192 |
apply (simp add:s2ss_def)
|
|
2193 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2194 |
apply (case_tac "obj = D_msgq q")
|
77
|
2195 |
apply (rule disjI1, simp add:co2sobj.simps)
|
92
|
2196 |
apply (case_tac "obj = D_proc p")
|
77
|
2197 |
apply (rule disjI2, simp, rule conjI)
|
|
2198 |
apply (rule disjI1, simp add:co2sobj.simps cp2sproc_other)
|
|
2199 |
apply (rule notI, simp add:co2sobj.simps cp2sproc_other)
|
|
2200 |
apply (rule disjI2, simp, rule conjI, rule disjI2, rule conjI)
|
|
2201 |
apply (rule_tac x = obj in exI)
|
92
|
2202 |
apply (simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)
|
77
|
2203 |
apply (rule notI, simp, frule co2sobj_sproc_imp, erule exE)
|
92
|
2204 |
apply (erule_tac x = "D_proc pa" in allE, simp add:co2sobj_recvmsg)
|
77
|
2205 |
apply (rule notI, simp, frule co2sobj_smsgq_imp, erule exE)
|
92
|
2206 |
apply (rotate_tac 12, erule_tac x = "D_msgq qa" in allE, simp add:co2sobj_recvmsg)
|
77
|
2207 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2208 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2209 |
apply (tactic {*my_setiff_tac 1*}, simp)
|
|
2210 |
apply (tactic {*my_clarify_tac 1*})
|
92
|
2211 |
apply (rule_tac x = "D_proc p" in exI, simp add:co2sobj.simps cp2sproc_other)
|
77
|
2212 |
apply (tactic {*my_clarify_tac 1*})
|
92
|
2213 |
apply (case_tac "obj = D_msgq q")
|
77
|
2214 |
apply (simp add:co2sobj.simps)
|
92
|
2215 |
apply (case_tac "obj = D_proc p")
|
77
|
2216 |
apply (simp add:co2sobj.simps)
|
|
2217 |
apply (rule_tac x = obj in exI)
|
92
|
2218 |
apply (auto simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)[1]
|
77
|
2219 |
|
|
2220 |
apply (simp add:update_s2ss_obj_def)
|
|
2221 |
|
|
2222 |
apply (tactic {*my_clarify_tac 1*})
|
|
2223 |
apply (simp add:s2ss_def)
|
|
2224 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2225 |
apply (case_tac "obj = D_msgq q")
|
77
|
2226 |
apply (rule disjI1, simp add:co2sobj.simps)
|
|
2227 |
apply (rule disjI2, simp)
|
|
2228 |
apply (rule_tac x = obj in exI)
|
92
|
2229 |
apply (simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)
|
77
|
2230 |
apply (simp add:co2sobj.simps)
|
|
2231 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2232 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2233 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2234 |
apply (case_tac "obj = D_msgq q")
|
77
|
2235 |
apply (frule co2sobj_smsgq_imp, erule exE)
|
92
|
2236 |
apply (rule_tac x = "D_msgq qa" in exI, simp add:dalive_recvmsg co2sobj_recvmsg)
|
77
|
2237 |
apply (simp add:co2sobj.simps)
|
|
2238 |
apply (rule_tac x = obj in exI)
|
92
|
2239 |
apply (auto simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)[1]
|
77
|
2240 |
apply (simp add:co2sobj.simps)
|
|
2241 |
|
|
2242 |
apply (tactic {*my_clarify_tac 1*})
|
|
2243 |
apply (simp add:s2ss_def)
|
|
2244 |
apply (tactic {*my_seteq_tac 1*})
|
92
|
2245 |
apply (case_tac "obj = D_msgq q")
|
77
|
2246 |
apply (rule disjI1, simp add:co2sobj.simps)
|
|
2247 |
apply (rule disjI2, simp, rule conjI)
|
|
2248 |
apply (rule_tac x = obj in exI)
|
92
|
2249 |
apply (simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)
|
77
|
2250 |
apply (simp add:co2sobj.simps)
|
|
2251 |
apply (rule notI, simp)
|
92
|
2252 |
apply (frule co2sobj_smsgq_imp, erule exE, erule_tac x = "D_msgq qa" in allE)
|
77
|
2253 |
apply (simp add:co2sobj_recvmsg)
|
|
2254 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2255 |
apply (rule_tac x = "D_msgq q" in exI, simp add:co2sobj.simps)
|
77
|
2256 |
apply (tactic {*my_setiff_tac 1*})
|
92
|
2257 |
apply (case_tac "obj = D_msgq q")
|
77
|
2258 |
apply (simp add:co2sobj.simps)
|
|
2259 |
apply (rule_tac x = obj in exI)
|
92
|
2260 |
apply (auto simp add:dalive_recvmsg co2sobj_recvmsg split:t_dobject.splits if_splits)[1]
|
77
|
2261 |
apply (simp add:co2sobj.simps)
|
|
2262 |
done
|
|
2263 |
|
|
2264 |
end
|
|
2265 |
|
|
2266 |
end |