author | chunhan |
Wed, 15 May 2013 11:21:39 +0800 | |
changeset 6 | 8779d321cc2e |
parent 4 | e9c5594d5963 |
child 7 | f27882976251 |
permissions | -rw-r--r-- |
1 | 1 |
(*<*) |
2 |
theory Init_prop |
|
3 |
imports Main OS_type_def Flask Flask_type Static_type Static |
|
4 |
begin |
|
5 |
(*>*) |
|
6 |
||
7 |
context init begin |
|
8 |
||
9 |
lemma init_files_prop1: "init_inum_of_file f = Some im \<Longrightarrow> f \<in> init_files" |
|
10 |
by (simp add:inof_has_file_tag) |
|
11 |
||
12 |
lemma init_files_prop2: "finite init_files" |
|
13 |
by (simp add:init_finite_sets) |
|
14 |
||
15 |
lemma init_files_prop3: "f \<in> init_files \<Longrightarrow> init_inum_of_file f \<noteq> None" |
|
16 |
by (auto dest:init_file_has_inum) |
|
17 |
||
18 |
lemma init_files_prop4: "(f \<in> init_files) = (f \<in> current_files [])" |
|
19 |
apply (simp add:current_files_def, rule iffI) |
|
20 |
using init_files_prop1 init_files_prop3 by auto |
|
21 |
||
22 |
lemmas init_files_props = init_file_has_inum init_files_prop1 init_files_prop2 init_files_prop3 init_files_prop4 |
|
23 |
||
24 |
lemma init_inumof_prop1: "init_inum_of_file f = Some im \<Longrightarrow> \<exists> tag. init_itag_of_inum im = Some tag" |
|
25 |
by (auto dest:inof_has_file_tag) |
|
26 |
||
27 |
lemma init_inumof_prop2: "init_inum_of_file f = Some im \<Longrightarrow> init_itag_of_inum im \<noteq> None" |
|
28 |
by (auto dest:inof_has_file_tag) |
|
29 |
||
30 |
lemma init_inumof_prop3: "\<lbrakk>init_inum_of_file f = Some im; init_itag_of_inum im = Some tag\<rbrakk> \<Longrightarrow> is_file_dir_itag tag" |
|
31 |
by (auto dest:inof_has_file_tag) |
|
32 |
||
33 |
lemmas init_inum_of_file_props = init_files_prop1 init_inumof_prop1 init_inumof_prop2 init_inumof_prop3 |
|
34 |
||
35 |
lemma init_inumos_prop1: "init_inum_of_socket s = Some im \<Longrightarrow> s \<in> init_sockets" |
|
36 |
by (auto dest:inos_has_sock_tag) |
|
37 |
||
38 |
lemma init_inumos_prop2: "init_inum_of_socket s = Some im \<Longrightarrow> init_itag_of_inum im = Some Tag_TCP_SOCK \<or> init_itag_of_inum im = Some Tag_UDP_SOCK" |
|
39 |
apply (auto dest!:inos_has_sock_tag) |
|
40 |
apply (case_tac tag, simp+) |
|
41 |
done |
|
42 |
||
43 |
lemma init_inumos_prop3: "init_inum_of_socket s = Some im \<Longrightarrow> init_itag_of_inum im \<noteq> None" |
|
44 |
by (auto dest:inos_has_sock_tag) |
|
45 |
||
46 |
lemma init_inumos_prop4: "init_inum_of_socket s = Some im \<Longrightarrow> \<exists> tag. init_itag_of_inum im = Some tag \<and> is_sock_itag tag" |
|
47 |
by (auto dest!:inos_has_sock_tag) |
|
48 |
||
49 |
lemmas init_inum_of_socket_props = init_inumos_prop1 init_inumos_prop2 init_inumos_prop3 init_inumos_prop4 |
|
50 |
||
51 |
lemma init_sockets_prop1: "(p, fd) \<in> init_sockets \<Longrightarrow> p \<in> init_procs" |
|
52 |
by (auto dest: init_socket_has_inode) |
|
53 |
||
54 |
lemma init_sockets_prop2: "(p, fd) \<in> init_sockets \<Longrightarrow> fd \<in> init_fds_of_proc p" |
|
55 |
by (auto dest:init_socket_has_inode) |
|
56 |
||
57 |
lemma init_sockets_prop3: "s \<in> init_sockets \<Longrightarrow> \<exists> im. init_inum_of_socket s = Some im" |
|
58 |
by (case_tac s, auto dest:init_socket_has_inode) |
|
59 |
||
60 |
lemma init_sockets_prop4: "s \<in> init_sockets \<Longrightarrow> init_inum_of_socket s \<noteq> None" |
|
61 |
by (simp add:init_sockets_prop3) |
|
62 |
||
63 |
lemma init_sockets_prop5: "s \<in> init_sockets = (s \<in> current_sockets [])" |
|
64 |
apply (simp add:current_sockets_def, rule iffI) |
|
65 |
using init_sockets_prop4 inos_has_sock_tag apply auto |
|
66 |
apply (case_tac s, auto) |
|
67 |
done |
|
68 |
||
69 |
lemmas init_sockets_props = init_sockets_prop1 init_sockets_prop2 init_sockets_prop3 init_sockets_prop4 init_sockets_prop5 |
|
70 |
||
71 |
lemma is_init_file_prop1: "is_init_file f = (f \<in> init_files \<and> is_file [] f)" |
|
72 |
by (auto simp add:is_init_file_def is_file_def init_inum_of_file_props split:option.splits) |
|
73 |
||
74 |
lemma is_init_file_prop2: "is_init_file f = (init_alive (O_file f))" |
|
75 |
by (auto simp add:is_init_file_def is_file_def init_inum_of_file_props split:option.splits) |
|
76 |
||
77 |
lemmas is_init_file_props = is_init_file_prop1 is_init_file_prop2 |
|
78 |
||
79 |
lemma is_init_dir_prop1: "is_init_dir f = (f \<in> init_files \<and> is_dir [] f)" |
|
80 |
by (auto simp add:is_init_dir_def is_dir_def init_inum_of_file_props split:option.splits) |
|
81 |
||
82 |
lemma is_init_dir_prop2: "is_init_dir f = (init_alive (O_dir f))" |
|
83 |
by (auto simp add:is_init_dir_def is_dir_def init_inum_of_file_props split:option.splits) |
|
84 |
||
85 |
lemmas is_init_dir_props = is_init_dir_prop1 is_init_dir_prop2 |
|
86 |
||
2 | 87 |
lemma is_file_nil: "is_file [] = is_init_file" |
88 |
by (auto simp:is_init_file_def is_file_def init_inum_of_file_props intro!:ext split:option.splits) |
|
89 |
||
90 |
lemma is_dir_nil: "is_dir [] = is_init_dir" |
|
91 |
by (auto simp:is_init_dir_def is_dir_def init_inum_of_file_props intro!:ext split:option.splits) |
|
92 |
||
4 | 93 |
lemma is_udp_sock_nil: |
94 |
"is_udp_sock [] k = is_init_udp_sock k" |
|
95 |
by (auto simp:is_udp_sock_def is_init_udp_sock_def split:option.splits) |
|
96 |
||
1 | 97 |
lemma is_init_udp_sock_prop1: "is_init_udp_sock s = (s \<in> init_sockets \<and> is_udp_sock [] s)" |
98 |
apply (auto simp add:is_init_udp_sock_def is_udp_sock_def init_inum_of_socket_props |
|
99 |
dest:init_socket_has_inode split:option.splits) |
|
100 |
done |
|
101 |
||
102 |
lemma is_init_udp_sock_prop2: "is_init_udp_sock s = (init_alive (O_udp_sock s))" |
|
103 |
apply (auto simp add:is_init_udp_sock_def is_udp_sock_def init_inum_of_socket_props |
|
104 |
dest:init_socket_has_inode split:option.splits) |
|
105 |
done |
|
106 |
||
4 | 107 |
lemma is_init_udp_sock_prop3: |
108 |
"is_init_udp_sock (p, fd) \<Longrightarrow> p \<in> init_procs" |
|
109 |
by (auto simp:is_init_udp_sock_def split:option.splits t_inode_tag.splits |
|
110 |
dest:init_socket_has_inode inos_has_sock_tag) |
|
111 |
||
112 |
lemma is_init_udp_sock_prop4: |
|
113 |
"is_init_udp_sock (p, fd) \<Longrightarrow> fd \<in> init_fds_of_proc p" |
|
114 |
by (auto simp:is_init_udp_sock_def split:option.splits t_inode_tag.splits |
|
115 |
dest:init_socket_has_inode inos_has_sock_tag) |
|
116 |
||
117 |
lemmas is_init_udp_sock_props = is_init_udp_sock_prop1 is_init_udp_sock_prop2 is_init_udp_sock_prop3 |
|
118 |
is_init_udp_sock_prop4 |
|
119 |
||
120 |
lemma is_tcp_sock_nil: |
|
121 |
"is_tcp_sock [] k = is_init_tcp_sock k" |
|
122 |
by (auto simp:is_tcp_sock_def is_init_tcp_sock_def split:option.splits) |
|
1 | 123 |
|
124 |
lemma is_init_tcp_sock_prop1: "is_init_tcp_sock s = (s \<in> init_sockets \<and> is_tcp_sock [] s)" |
|
125 |
apply (auto simp add:is_init_tcp_sock_def is_tcp_sock_def init_inum_of_socket_props |
|
126 |
dest:init_socket_has_inode split:option.splits) |
|
127 |
done |
|
128 |
||
129 |
lemma is_init_tcp_sock_prop2: "is_init_tcp_sock s = (init_alive (O_tcp_sock s))" |
|
130 |
apply (auto simp add:is_init_tcp_sock_def is_tcp_sock_def init_inum_of_socket_props |
|
131 |
dest:init_socket_has_inode split:option.splits) |
|
132 |
done |
|
133 |
||
4 | 134 |
lemma is_init_tcp_sock_prop3: |
135 |
"is_init_tcp_sock (p, fd) \<Longrightarrow> p \<in> init_procs" |
|
136 |
by (auto simp:is_init_tcp_sock_def split:option.splits t_inode_tag.splits |
|
137 |
dest:init_socket_has_inode inos_has_sock_tag) |
|
1 | 138 |
|
4 | 139 |
lemma is_init_tcp_sock_prop4: |
140 |
"is_init_tcp_sock (p, fd) \<Longrightarrow> fd \<in> init_fds_of_proc p" |
|
141 |
by (auto simp:is_init_tcp_sock_def split:option.splits t_inode_tag.splits |
|
142 |
dest:init_socket_has_inode inos_has_sock_tag) |
|
143 |
||
144 |
lemmas is_init_tcp_sock_props = is_init_tcp_sock_prop1 is_init_tcp_sock_prop2 is_init_tcp_sock_prop3 |
|
145 |
is_init_tcp_sock_prop4 |
|
1 | 146 |
|
147 |
lemma init_parent_file_prop1: |
|
148 |
"\<lbrakk>parent f = Some pf; f \<in> init_files\<rbrakk> \<Longrightarrow> is_init_dir pf" |
|
149 |
apply (frule parent_file_in_init, simp, frule_tac f = pf in init_files_prop3) |
|
150 |
apply (clarsimp, drule_tac im = y in init_parentf_is_dir, simp+) |
|
151 |
by (simp add:is_init_dir_def) |
|
152 |
||
153 |
lemma init_parent_file_prop1': |
|
154 |
"a # f \<in> init_files \<Longrightarrow> is_init_dir f" |
|
155 |
by (rule_tac pf = f in init_parent_file_prop1, auto) |
|
156 |
||
157 |
lemma init_parent_file_prop2: |
|
158 |
"\<lbrakk>parent f = Some pf; is_init_file f\<rbrakk> \<Longrightarrow> is_init_dir pf" |
|
159 |
by (rule init_parent_file_prop1, simp, simp add: is_init_file_props) |
|
160 |
||
161 |
lemma init_parent_file_prop2': |
|
162 |
"is_init_file (f#pf) \<Longrightarrow> is_init_dir pf" |
|
163 |
apply (rule init_parent_file_prop2) |
|
164 |
by auto |
|
165 |
||
166 |
lemma init_parent_file_prop3: |
|
167 |
"\<lbrakk>parent f = Some pf; is_init_dir f\<rbrakk> \<Longrightarrow> is_init_dir pf" |
|
168 |
by (rule init_parent_file_prop1, simp, simp add: is_init_dir_props) |
|
169 |
||
170 |
lemma init_parent_file_prop3': |
|
171 |
"is_init_dir (f#pf) \<Longrightarrow> is_init_dir pf" |
|
172 |
apply (rule init_parent_file_prop3) |
|
173 |
by auto |
|
174 |
||
175 |
lemma parent_file_in_init': "a # f \<in> init_files \<Longrightarrow> f \<in> init_files" |
|
176 |
by (subgoal_tac "parent (a # f) = Some f", drule parent_file_in_init, auto) |
|
177 |
||
178 |
lemmas init_parent_file_props = parent_file_in_init init_parent_file_prop1 parent_file_in_init' init_parent_file_prop1' init_parent_file_prop2 init_parent_file_prop2' init_parent_file_prop3 init_parent_file_prop3' |
|
179 |
||
180 |
lemma root_in_filesystem: "[] \<in> init_files" |
|
181 |
using init_files_prop1 root_is_dir by auto |
|
182 |
||
183 |
lemma root_is_init_dir: "is_init_dir []" |
|
184 |
using root_is_dir |
|
185 |
by (auto simp add:is_init_dir_def split:option.splits) |
|
186 |
||
187 |
lemma root_is_init_dir': "is_init_file [] \<Longrightarrow> False" |
|
188 |
using root_is_dir |
|
189 |
by (auto simp:is_init_file_def split:option.splits) |
|
190 |
||
191 |
||
192 |
lemma init_files_hung_prop1: "f \<in> init_files_hung_by_del \<Longrightarrow> f \<in> init_files" |
|
193 |
by (auto dest:init_files_hung_valid) |
|
194 |
||
195 |
lemma init_files_hung_prop2: "f \<in> init_files_hung_by_del \<Longrightarrow> \<exists> p fd. init_file_of_proc_fd p fd = Some f" |
|
196 |
by (auto dest:init_files_hung_valid) |
|
197 |
||
198 |
lemmas init_files_hung_by_del_props = init_files_hung_prop1 init_files_hung_prop2 init_files_hung_valid' |
|
199 |
||
200 |
||
201 |
lemma init_fds_of_proc_prop1: "fd \<in> init_fds_of_proc p \<Longrightarrow> p \<in> init_procs" |
|
202 |
by (auto dest!:init_procfds_valid) |
|
203 |
||
204 |
lemma init_fds_of_proc_prop2: "fd \<in> init_fds_of_proc p \<Longrightarrow> (\<exists> f \<in> init_files. init_file_of_proc_fd p fd = Some f) \<or> (p, fd) \<in> init_sockets" |
|
205 |
by (auto dest:init_procfds_valid) |
|
206 |
||
207 |
lemmas init_fds_of_proc_props = init_fds_of_proc_prop1 init_fds_of_proc_prop2 |
|
208 |
||
209 |
lemma init_filefd_prop1: "init_file_of_proc_fd p fd = Some f \<Longrightarrow> f \<in> init_files" |
|
210 |
by (auto dest!:init_filefd_valid intro:init_files_prop1) |
|
211 |
||
212 |
lemma init_filefd_prop2: "init_file_of_proc_fd p fd = Some f \<Longrightarrow> p \<in> init_procs" |
|
213 |
by (auto dest:init_filefd_valid) |
|
214 |
||
215 |
lemma init_filefd_prop3: "init_file_of_proc_fd p fd = Some f \<Longrightarrow> fd \<in> init_fds_of_proc p" |
|
216 |
by (auto dest:init_filefd_valid) |
|
217 |
||
218 |
lemma init_filefd_prop4: "init_file_of_proc_fd p fd = Some f \<Longrightarrow> \<exists> flags. init_oflags_of_proc_fd p fd = Some flags" |
|
219 |
by (auto dest:init_filefd_valid) |
|
220 |
||
221 |
lemma init_filefd_prop5: "init_file_of_proc_fd p fd = Some f \<Longrightarrow> is_init_file f" |
|
222 |
by (auto dest:init_filefd_valid simp:is_init_file_def) |
|
223 |
||
224 |
lemmas init_file_of_proc_fd_props = init_filefd_prop1 init_filefd_prop2 init_filefd_prop3 init_filefd_prop4 init_filefd_prop5 |
|
225 |
||
226 |
lemma init_oflags_prop1: "init_oflags_of_proc_fd p fd = Some flags \<Longrightarrow> p \<in> init_procs" |
|
227 |
by (auto dest:init_fileflag_valid init_file_of_proc_fd_props) |
|
228 |
||
229 |
lemma init_oflags_prop2: "init_oflags_of_proc_fd p fd = Some flags \<Longrightarrow> fd \<in> init_fds_of_proc p" |
|
230 |
by (auto dest:init_fileflag_valid init_file_of_proc_fd_props) |
|
231 |
||
232 |
lemmas init_oflags_of_proc_fd_props = init_oflags_prop1 init_oflags_prop2 init_fileflag_valid |
|
233 |
||
234 |
(* |
|
235 |
lemma init_socketstate_prop1: "s \<in> init_sockets \<Longrightarrow> init_socket_state s \<noteq> None" |
|
236 |
using init_socket_has_state |
|
237 |
by (case_tac s, simp add:bidirect_in_init_def) |
|
238 |
||
239 |
lemma init_socketstate_prop2: "s \<in> init_sockets \<Longrightarrow> \<exists> t. init_socket_state s = Some t" |
|
240 |
using init_socket_has_state |
|
241 |
by (case_tac s, simp add:bidirect_in_init_def) |
|
242 |
||
243 |
lemma init_socketstate_prop3: "init_socket_state s = Some t \<Longrightarrow> s \<in> init_sockets" |
|
244 |
using init_socket_has_state |
|
245 |
by (case_tac s, simp add:bidirect_in_init_def) |
|
246 |
||
247 |
lemmas init_socket_state_props = init_socketstate_prop1 init_socketstate_prop2 init_socketstate_prop3 |
|
248 |
*) |
|
249 |
||
250 |
lemma init_inum_sock_file_noninter: "\<lbrakk>init_inum_of_socket s = Some im; init_inum_of_file f = Some im\<rbrakk> \<Longrightarrow> False" |
|
251 |
apply (frule init_inumof_prop1, erule exE, drule init_inumof_prop3, simp) |
|
252 |
apply (frule init_inumos_prop2) |
|
253 |
apply (case_tac tag, simp+) |
|
254 |
done |
|
255 |
||
256 |
lemma init_parent_file_has_inum: "\<lbrakk>parent f = Some pf; init_inum_of_file f = Some im\<rbrakk> \<Longrightarrow> \<exists> im. init_inum_of_file pf = Some im" |
|
257 |
by (drule init_files_prop1, drule parent_file_in_init, simp, simp add:init_files_props) |
|
258 |
||
259 |
lemma init_file_has_no_son': "\<lbrakk>init_itag_of_inum im = Some Tag_FILE; init_inum_of_file f = Some im; parent f' = Some f\<rbrakk> \<Longrightarrow> init_inum_of_file f' = None" |
|
260 |
apply (drule init_file_no_son, simp) |
|
261 |
by (case_tac "init_inum_of_file f'", auto dest:init_files_prop1) |
|
262 |
||
263 |
lemma init_parent_file_is_dir': "\<lbrakk>parent f = Some pf; init_inum_of_file f = Some im; init_inum_of_file pf = Some ipm\<rbrakk> \<Longrightarrow> init_itag_of_inum ipm = Some Tag_DIR" |
|
264 |
by (drule init_parentf_is_dir, auto dest:init_files_prop1) |
|
265 |
||
266 |
lemma init_file_hung_has_no_son: "\<lbrakk>f \<in> init_files_hung_by_del; parent f' = Some f; init_inum_of_file f' = Some im\<rbrakk> \<Longrightarrow> False" |
|
267 |
apply (frule init_files_hung_prop1, drule init_file_has_inum, erule exE) |
|
268 |
apply (drule init_files_hung_valid', simp) |
|
269 |
apply (frule init_parent_file_is_dir', simp+) |
|
270 |
apply (drule init_files_prop1) |
|
271 |
apply (erule_tac x = f' in allE, simp) |
|
272 |
by (case_tac f', simp_all add:no_junior_def) |
|
273 |
||
2 | 274 |
lemma same_inode_nil_prop: |
275 |
"same_inode_files [] f = init_same_inode_files f" |
|
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
276 |
by (simp add:same_inode_files_def init_same_inode_files_def is_file_nil) |
2 | 277 |
|
278 |
lemma init_same_inode_prop1: |
|
279 |
"f \<in> init_files \<Longrightarrow> \<forall> f' \<in> init_same_inode_files f. f' \<in> init_files" |
|
280 |
apply (simp add:init_same_inode_files_def) |
|
281 |
apply (drule init_files_prop3) |
|
282 |
apply (auto simp:init_files_prop1) |
|
283 |
done |
|
1 | 284 |
|
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
285 |
lemma init_same_inode_prop2: |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
286 |
"\<lbrakk>f' \<in> init_same_inode_files f; f \<in> init_files\<rbrakk> \<Longrightarrow> f' \<in> init_files" |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
287 |
by (drule init_same_inode_prop1, simp) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
288 |
|
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
289 |
lemma init_same_inode_prop3: |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
290 |
"f' \<in> init_same_inode_files f \<Longrightarrow> f \<in> init_same_inode_files f'" |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
291 |
by (auto simp add:init_same_inode_files_def is_init_file_def split:if_splits) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
292 |
|
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
293 |
lemma init_same_inode_prop4: |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
294 |
"\<lbrakk>f' \<in> init_same_inode_files f; f' \<in> init_files\<rbrakk> \<Longrightarrow> f \<in> init_files" |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
295 |
apply (drule init_same_inode_prop3) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
296 |
by (simp add:init_same_inode_prop2) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
297 |
|
1 | 298 |
end |
299 |
||
300 |
context flask begin |
|
301 |
||
302 |
lemma init_alive_prop: "init_alive obj = alive [] obj" |
|
303 |
apply (case_tac obj, simp_all add:is_init_file_props is_init_dir_props is_init_tcp_sock_props |
|
304 |
is_init_udp_sock_props init_files_props init_sockets_props) |
|
305 |
done |
|
306 |
||
307 |
lemma init_alive_proc: "p \<in> init_procs \<Longrightarrow> init_alive (O_proc p)" by simp |
|
308 |
lemma init_alive_file: "is_init_file f \<Longrightarrow> init_alive (O_file f)" by simp |
|
309 |
lemma init_alive_dir: "is_init_dir f \<Longrightarrow> init_alive (O_dir f)" by simp |
|
310 |
lemma init_alive_fd: "fd \<in> init_fds_of_proc p \<Longrightarrow> init_alive (O_fd p fd)" by simp |
|
311 |
lemma init_alive_tcp: "is_init_tcp_sock s \<Longrightarrow> init_alive (O_tcp_sock s)" by simp |
|
312 |
lemma init_alive_udp: "is_init_udp_sock s \<Longrightarrow> init_alive (O_udp_sock s)" by simp |
|
313 |
lemma init_alive_node: "n \<in> init_nodes \<Longrightarrow> init_alive (O_node n)" by simp |
|
314 |
lemma init_alive_shm: "h \<in> init_shms \<Longrightarrow> init_alive (O_shm h)" by simp |
|
315 |
lemma init_alive_msgq: "q \<in> init_msgqs \<Longrightarrow> init_alive (O_msgq q)" by simp |
|
316 |
lemma init_alive_msg: "\<lbrakk>m \<in> set (init_msgs_of_queue q); q \<in> init_msgqs\<rbrakk> |
|
317 |
\<Longrightarrow> init_alive (O_msg q m)" by simp |
|
318 |
||
319 |
lemmas init_alive_intros = init_alive_proc init_alive_file init_alive_dir init_alive_fd |
|
320 |
init_alive_tcp init_alive_udp init_alive_node init_alive_shm init_alive_msgq init_alive_msg |
|
321 |
||
322 |
||
323 |
lemma init_file_type_prop1: "is_init_file f \<Longrightarrow> \<exists> t. init_type_of_obj (O_file f) = Some t" |
|
324 |
using init_obj_has_type |
|
325 |
by (auto simp:is_init_file_def split:option.splits) |
|
326 |
||
327 |
lemma init_file_type_prop2: "is_init_file f \<Longrightarrow> init_type_of_obj (O_file f) \<noteq> None" |
|
328 |
by (simp add:init_file_type_prop1) |
|
329 |
||
330 |
lemma init_file_type_prop3: "init_type_of_obj (O_file f) = Some t \<Longrightarrow> f \<in> init_files" |
|
331 |
apply (drule init_type_has_obj) |
|
332 |
by (simp add:is_init_file_def init_inum_of_file_props split:option.splits) |
|
333 |
||
334 |
lemma init_file_type_prop4: "init_type_of_obj (O_file f) = Some t \<Longrightarrow> is_init_file f" |
|
335 |
apply (drule init_type_has_obj) |
|
336 |
by (simp add:is_init_file_def init_inum_of_file_props split:option.splits) |
|
337 |
||
338 |
lemmas init_file_types_props = init_file_type_prop1 init_file_type_prop2 init_file_type_prop3 init_file_type_prop4 |
|
339 |
||
340 |
lemma init_dir_type_prop1: "is_init_dir f \<Longrightarrow> \<exists> t. init_type_of_obj (O_dir f) = Some t" |
|
341 |
using init_obj_has_type |
|
342 |
by (auto simp:is_init_dir_def split:option.splits) |
|
343 |
||
344 |
lemma init_dir_type_prop2: "is_init_dir f \<Longrightarrow> init_type_of_obj (O_dir f) \<noteq> None" |
|
345 |
by (simp add:init_dir_type_prop1) |
|
346 |
||
347 |
lemma init_dir_type_prop3: "init_type_of_obj (O_dir f) = Some t \<Longrightarrow> f \<in> init_files" |
|
348 |
apply (drule init_type_has_obj) |
|
349 |
by (simp add:is_init_dir_def init_inum_of_file_props split:option.splits) |
|
350 |
||
351 |
lemma init_dir_type_prop4: "init_type_of_obj (O_dir f) = Some t \<Longrightarrow> is_init_dir f" |
|
352 |
apply (drule init_type_has_obj) |
|
353 |
by (simp add:is_init_dir_def init_inum_of_file_props split:option.splits) |
|
354 |
||
355 |
lemmas init_dir_types_props = init_dir_type_prop1 init_dir_type_prop2 init_dir_type_prop3 init_dir_type_prop4 |
|
356 |
||
357 |
lemma init_procrole_prop1: "init_role_of_proc p = Some r \<Longrightarrow> p \<in> init_procs" |
|
358 |
using init_proc_has_role |
|
359 |
by (auto simp:bidirect_in_init_def) |
|
360 |
||
361 |
lemma init_procrole_prop2: "p \<in> init_procs \<Longrightarrow> \<exists> r. init_role_of_proc p = Some r" |
|
362 |
using init_proc_has_role |
|
363 |
by (auto simp:bidirect_in_init_def) |
|
364 |
||
365 |
lemma init_procrole_prop3: "p \<in> init_procs \<Longrightarrow> init_role_of_proc p \<noteq> None" |
|
366 |
using init_proc_has_role |
|
367 |
by (auto simp:bidirect_in_init_def) |
|
368 |
||
369 |
lemmas init_role_of_proc_props = init_procrole_prop1 init_procrole_prop2 init_procrole_prop3 |
|
370 |
||
371 |
lemma init_file_user_prop1: "is_init_file f \<Longrightarrow> \<exists> t. init_user_of_obj (O_file f) = Some t" |
|
372 |
apply (simp only: is_init_file_prop2) |
|
373 |
by (drule init_obj_has_user, auto) |
|
374 |
||
375 |
lemma init_file_user_prop2: "is_init_file f \<Longrightarrow> init_user_of_obj (O_file f) \<noteq> None" |
|
376 |
by (simp add:init_file_user_prop1) |
|
377 |
||
378 |
lemma init_file_user_prop3: "init_user_of_obj (O_file f) = Some t \<Longrightarrow> f \<in> init_files" |
|
379 |
apply (drule init_user_has_obj) |
|
380 |
by (simp add:is_init_file_def init_inum_of_file_props split:option.splits) |
|
381 |
||
382 |
lemma init_file_user_prop4: "init_user_of_obj (O_file f) = Some t \<Longrightarrow> is_init_file f" |
|
383 |
apply (drule init_user_has_obj) |
|
384 |
by (simp add:is_init_file_def init_inum_of_file_props split:option.splits) |
|
385 |
||
386 |
lemma init_file_user_prop5: "init_user_of_obj (O_file f) = Some u \<Longrightarrow> u \<in> init_users" |
|
387 |
by (simp add:init_user_has_obj) |
|
388 |
||
389 |
lemmas init_file_users_props = init_file_user_prop1 init_file_user_prop2 init_file_user_prop3 init_file_user_prop4 init_file_user_prop5 |
|
390 |
||
391 |
lemma init_dir_user_prop1: "is_init_dir f \<Longrightarrow> \<exists> t. init_user_of_obj (O_dir f) = Some t" |
|
392 |
apply (simp only: is_init_dir_prop2) |
|
393 |
by (drule init_obj_has_user, auto) |
|
394 |
||
395 |
lemma init_dir_user_prop2: "is_init_dir f \<Longrightarrow> init_user_of_obj (O_dir f) \<noteq> None" |
|
396 |
by (simp add:init_dir_user_prop1) |
|
397 |
||
398 |
lemma init_dir_user_prop3: "init_user_of_obj (O_dir f) = Some t \<Longrightarrow> f \<in> init_files" |
|
399 |
apply (drule init_user_has_obj) |
|
400 |
by (simp add:is_init_dir_def init_inum_of_file_props split:option.splits) |
|
401 |
||
402 |
lemma init_dir_user_prop4: "init_user_of_obj (O_dir f) = Some t \<Longrightarrow> is_init_dir f" |
|
403 |
apply (drule init_user_has_obj) |
|
404 |
by (simp add:is_init_dir_def init_inum_of_file_props split:option.splits) |
|
405 |
||
406 |
lemma init_dir_user_prop5: "init_user_of_obj (O_dir f) = Some u \<Longrightarrow> u \<in> init_users" |
|
407 |
by (simp add:init_user_has_obj) |
|
408 |
||
409 |
lemmas init_dir_users_props = init_dir_user_prop1 init_dir_user_prop2 init_dir_user_prop3 init_dir_user_prop4 init_dir_user_prop5 |
|
410 |
||
2 | 411 |
lemma init_file_dir_conflict: "\<lbrakk>is_init_file f; is_init_dir f\<rbrakk> \<Longrightarrow> False" |
412 |
by (auto simp:is_init_file_def is_init_dir_def split:option.splits t_inode_tag.splits) |
|
413 |
||
414 |
lemma init_file_dir_conflict1: "is_init_file f \<Longrightarrow> \<not> is_init_dir f" |
|
415 |
by (auto simp:is_init_file_def is_init_dir_def split:option.splits t_inode_tag.splits) |
|
416 |
||
417 |
lemma init_file_dir_conflict2: "is_init_dir f \<Longrightarrow> \<not> is_init_file f" |
|
418 |
by (auto simp:is_init_file_def is_init_dir_def split:option.splits t_inode_tag.splits) |
|
419 |
||
1 | 420 |
end |
421 |
||
2 | 422 |
context tainting begin |
423 |
||
424 |
lemma tainted_nil_prop: |
|
425 |
"(x \<in> tainted []) = (x \<in> seeds)" |
|
426 |
apply (rule iffI) |
|
427 |
apply (erule tainted.cases, simp+) |
|
428 |
apply (erule t_init) |
|
429 |
done |
|
430 |
||
431 |
end |
|
1 | 432 |
|
433 |
context tainting_s begin |
|
434 |
||
435 |
lemma init_file_has_ctxt: |
|
436 |
"is_init_file f \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_file f) = Some sec" |
|
437 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
438 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_file_props) |
|
439 |
by (simp add:init_file_types_props) |
|
440 |
||
441 |
lemma init_file_has_ctxt': |
|
442 |
"init_sectxt_of_obj (O_file f) = None \<Longrightarrow> \<not> is_init_file f" |
|
443 |
by (rule notI, drule init_file_has_ctxt, simp) |
|
444 |
||
445 |
lemma init_dir_has_ctxt: |
|
446 |
"is_init_dir f \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_dir f) = Some sec" |
|
447 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
448 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
449 |
by (simp add:init_dir_types_props) |
|
450 |
||
451 |
lemma init_dir_has_ctxt': |
|
452 |
"init_sectxt_of_obj (O_dir f) = None \<Longrightarrow> \<not> is_init_dir f" |
|
453 |
by (rule notI, drule init_dir_has_ctxt, simp) |
|
454 |
||
455 |
lemma init_proc_has_ctxt: |
|
456 |
"p \<in> init_procs \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_proc p) = Some sec" |
|
457 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
458 |
apply (rule conjI, rule init_obj_has_user, simp) |
|
459 |
apply (frule init_alive_proc, drule init_obj_has_type) |
|
460 |
by (drule init_procrole_prop2, auto) |
|
461 |
||
462 |
lemma init_proc_has_ctxt': |
|
463 |
"init_sectxt_of_obj (O_proc p) = None \<Longrightarrow> p \<notin> init_procs" |
|
464 |
by (rule notI, drule init_proc_has_ctxt, simp) |
|
465 |
||
466 |
lemma init_fd_has_ctxt: |
|
467 |
"fd \<in> init_fds_of_proc p \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_fd p fd) = Some sec" |
|
468 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
469 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
470 |
apply (drule init_alive_intros) |
|
471 |
apply (drule init_obj_has_type, clarsimp) |
|
472 |
done |
|
473 |
||
474 |
lemma init_fd_has_ctxt': |
|
475 |
"init_sectxt_of_obj (O_fd p fd) = None \<Longrightarrow> fd \<notin> init_fds_of_proc p" |
|
476 |
by (rule notI, drule init_fd_has_ctxt, simp) |
|
477 |
||
478 |
lemma init_node_has_ctxt: |
|
479 |
"n \<in> init_nodes \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_node n) = Some sec" |
|
480 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
481 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
482 |
apply (drule init_alive_intros) |
|
483 |
apply (drule init_obj_has_type, clarsimp) |
|
484 |
done |
|
485 |
||
486 |
lemma init_node_has_ctxt': |
|
487 |
"init_sectxt_of_obj (O_node n) = None \<Longrightarrow> n \<notin> init_nodes" |
|
488 |
by (rule notI, drule init_node_has_ctxt, simp) |
|
489 |
||
490 |
lemma init_tcp_has_ctxt: |
|
491 |
"is_init_tcp_sock s \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_tcp_sock s) = Some sec" |
|
492 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
493 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
494 |
apply (drule init_alive_intros) |
|
495 |
apply (drule init_obj_has_type, clarsimp) |
|
496 |
done |
|
497 |
||
498 |
lemma init_tcp_has_ctxt': |
|
499 |
"init_sectxt_of_obj (O_tcp_sock s) = None \<Longrightarrow> \<not> is_init_tcp_sock s" |
|
500 |
by (rule notI, drule init_tcp_has_ctxt, simp) |
|
501 |
||
502 |
lemma init_udp_has_ctxt: |
|
503 |
"is_init_udp_sock s \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_udp_sock s) = Some sec" |
|
504 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
505 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
506 |
by (drule init_alive_intros, drule init_obj_has_type, clarsimp) |
|
507 |
||
508 |
lemma init_udp_has_ctxt': |
|
509 |
"init_sectxt_of_obj (O_udp_sock s) = None \<Longrightarrow> \<not> is_init_udp_sock s" |
|
510 |
by (rule notI, drule init_udp_has_ctxt, simp) |
|
511 |
||
512 |
lemma init_shm_has_ctxt: |
|
513 |
"h \<in> init_shms \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_shm h) = Some sec" |
|
514 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
515 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
516 |
by (drule init_alive_intros, drule init_obj_has_type, clarsimp) |
|
517 |
||
518 |
lemma init_shm_has_ctxt': |
|
519 |
"init_sectxt_of_obj (O_shm h) = None \<Longrightarrow> h \<notin> init_shms" |
|
520 |
by (rule notI, drule init_shm_has_ctxt, simp) |
|
521 |
||
522 |
lemma init_msgq_has_ctxt: |
|
523 |
"q \<in> init_msgqs \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_msgq q) = Some sec" |
|
524 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
525 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
526 |
by (drule init_alive_intros, drule init_obj_has_type, clarsimp) |
|
527 |
||
528 |
lemma init_msgq_has_ctxt': |
|
529 |
"init_sectxt_of_obj (O_msgq q) = None \<Longrightarrow> q \<notin> init_msgqs" |
|
530 |
by (rule notI, drule init_msgq_has_ctxt, simp) |
|
531 |
||
532 |
lemma init_msg_has_ctxt: |
|
533 |
"\<lbrakk>m \<in> set (init_msgs_of_queue q); q \<in> init_msgqs\<rbrakk> \<Longrightarrow> \<exists> sec. init_sectxt_of_obj (O_msg q m) = Some sec" |
|
534 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
535 |
apply (rule conjI, rule init_obj_has_user, simp add:is_init_dir_props) |
|
536 |
by (drule init_alive_intros, simp, drule init_obj_has_type, clarsimp) |
|
537 |
||
538 |
lemma init_msg_has_ctxt': |
|
539 |
"init_sectxt_of_obj (O_msg q m) = None \<Longrightarrow> m \<notin> set (init_msgs_of_queue q) \<or> q \<notin> init_msgqs" |
|
540 |
by (auto dest:init_msg_has_ctxt) |
|
541 |
||
542 |
lemma init_rootf_has_ctxt: |
|
543 |
"\<exists> sec. init_sectxt_of_obj (O_dir []) = Some sec" |
|
544 |
apply (rule init_dir_has_ctxt, simp add:is_init_dir_def split:option.splits) |
|
545 |
using root_is_dir by auto |
|
546 |
||
547 |
lemma init_rootf_has_ctxt': |
|
548 |
"init_sectxt_of_obj (O_dir []) = None \<Longrightarrow> False" |
|
549 |
using init_rootf_has_ctxt by auto |
|
550 |
||
551 |
lemmas init_has_ctxt = init_file_has_ctxt init_dir_has_ctxt init_proc_has_ctxt init_fd_has_ctxt |
|
552 |
init_node_has_ctxt init_tcp_has_ctxt init_udp_has_ctxt init_shm_has_ctxt init_msgq_has_ctxt |
|
553 |
init_msg_has_ctxt init_rootf_has_ctxt |
|
554 |
||
555 |
lemmas init_has_ctxt' = init_file_has_ctxt' init_dir_has_ctxt' init_proc_has_ctxt' init_fd_has_ctxt' |
|
556 |
init_node_has_ctxt' init_tcp_has_ctxt' init_udp_has_ctxt' init_shm_has_ctxt' init_msgq_has_ctxt' |
|
557 |
init_msg_has_ctxt' init_rootf_has_ctxt' |
|
558 |
||
559 |
lemma sec_of_root_valid: |
|
560 |
"init_sectxt_of_obj (O_dir []) = Some sec_of_root" |
|
561 |
using init_rootf_has_ctxt |
|
562 |
by (auto simp:init_sectxt_of_obj_def sec_of_root_def split:option.splits) |
|
563 |
||
564 |
lemma sec_of_root_is_tuple: |
|
565 |
"\<exists> u t. sec_of_root = (u, R_object, t)" |
|
566 |
using sec_of_root_valid |
|
567 |
by (auto simp:sec_of_root_def init_sectxt_of_obj_def split:option.splits) |
|
568 |
||
569 |
lemma sroot_valid: |
|
570 |
"init_cf2sfile [] = Some sroot" |
|
571 |
by (simp add:init_cf2sfile_def) |
|
572 |
||
573 |
lemma sroot_valid': |
|
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
574 |
"cf2sfile s [] = Some sroot" |
1 | 575 |
by (simp add:cf2sfile_def) |
576 |
||
577 |
lemma init_sectxt_prop: |
|
578 |
"sectxt_of_obj [] obj = init_sectxt_of_obj obj" |
|
579 |
apply (auto simp:init_sectxt_of_obj_def sectxt_of_obj_def split:option.splits) |
|
580 |
apply (case_tac [!] obj, simp+) |
|
581 |
done |
|
582 |
||
583 |
lemma init_sectxt_prop2: |
|
584 |
"init_sectxt_of_obj obj = Some sec \<Longrightarrow> init_alive obj" |
|
585 |
by (case_tac obj, auto simp:init_sectxt_of_obj_def split:option.splits dest:init_type_has_obj) |
|
586 |
||
587 |
lemma init_dir_has_seclist: |
|
588 |
"is_init_dir f \<Longrightarrow> \<exists> seclist. get_parentfs_ctxts [] f = Some seclist" |
|
589 |
apply (induct f) |
|
590 |
apply (simp only:get_parentfs_ctxts.simps init_sectxt_prop) |
|
591 |
using init_rootf_has_ctxt apply (auto)[1] |
|
592 |
apply (frule init_parent_file_prop3', simp del:get_parentfs_ctxts.simps) |
|
593 |
apply (erule exE, drule init_dir_has_ctxt) |
|
594 |
by (auto simp add:init_sectxt_prop) |
|
595 |
||
596 |
lemma is_init_file_dir_prop1: |
|
597 |
"is_init_dir f \<Longrightarrow> \<not> is_init_file f" |
|
598 |
by (auto simp:is_init_dir_def is_init_file_def split:option.splits t_inode_tag.splits) |
|
599 |
||
600 |
lemma is_init_file_dir_prop2: |
|
601 |
"is_init_file f \<Longrightarrow> \<not> is_init_dir f" |
|
602 |
by (auto simp:is_init_dir_def is_init_file_def split:option.splits t_inode_tag.splits) |
|
603 |
||
604 |
lemma is_init_file_dir_prop3: |
|
605 |
"\<lbrakk>is_init_dir f; is_init_file f\<rbrakk> \<Longrightarrow> False" |
|
606 |
by (auto simp:is_init_dir_def is_init_file_def split:option.splits t_inode_tag.splits) |
|
607 |
||
608 |
lemma is_init_file_dir_prop4: |
|
609 |
"\<lbrakk>is_init_file f; is_init_dir f\<rbrakk> \<Longrightarrow> False" |
|
610 |
by (auto simp:is_init_dir_def is_init_file_def split:option.splits t_inode_tag.splits) |
|
611 |
||
612 |
lemmas is_init_file_dir_props = is_init_file_dir_prop1 is_init_file_dir_prop2 is_init_file_dir_prop3 is_init_file_dir_prop4 |
|
613 |
||
614 |
lemma init_dir_has_sfile: |
|
615 |
"is_init_dir f \<Longrightarrow> \<exists> sf. init_cf2sfile f = Some sf" |
|
616 |
apply (case_tac f) |
|
617 |
using init_rootf_has_ctxt apply (auto)[1] |
|
618 |
apply (simp add:sec_of_root_valid sroot_valid sroot_def) |
|
619 |
apply (simp, frule init_parent_file_prop3') |
|
620 |
apply (frule_tac f = list in init_dir_has_seclist) |
|
621 |
apply (frule_tac f = list in init_dir_has_ctxt) |
|
622 |
apply (frule_tac f = "a # list" in init_dir_has_ctxt) |
|
623 |
apply ((erule exE)+, case_tac sec, auto simp:init_cf2sfile_def split:option.splits) |
|
624 |
by (auto simp:is_init_file_def is_init_dir_def split:option.splits t_inode_tag.splits) |
|
625 |
||
626 |
lemma init_file_has_sfile: |
|
627 |
"is_init_file f \<Longrightarrow> \<exists> sf. init_cf2sfile f = Some sf" |
|
628 |
apply (case_tac f) |
|
629 |
apply (simp, drule root_is_init_dir', simp) |
|
630 |
apply (simp, frule init_parent_file_prop2') |
|
631 |
apply (frule_tac f = list in init_dir_has_seclist) |
|
632 |
apply (frule_tac f = list in init_dir_has_ctxt) |
|
633 |
apply (frule_tac f = "a # list" in init_file_has_ctxt) |
|
634 |
by ((erule exE)+, case_tac sec, auto simp:init_cf2sfile_def) |
|
635 |
||
636 |
lemma init_shm_has_sshm: |
|
637 |
"h \<in> init_shms \<Longrightarrow> \<exists> sh. init_ch2sshm h = Some sh" |
|
638 |
apply (drule init_shm_has_ctxt) |
|
639 |
by (auto simp add:init_ch2sshm_def) |
|
640 |
||
641 |
lemma init_proc_has_sproc: |
|
642 |
"p \<in> init_procs \<Longrightarrow> \<exists> sp. init_cp2sproc p = Some sp" |
|
643 |
apply (frule init_proc_has_ctxt, erule exE) |
|
644 |
apply (simp add:init_cp2sproc_def) |
|
645 |
by (case_tac sec, simp+) |
|
646 |
||
647 |
lemma init_cqm2sms_has_sms_aux: |
|
648 |
"\<forall> m \<in> set ms. init_sectxt_of_obj (O_msg q m) \<noteq> None \<Longrightarrow> (\<exists> sms. init_cqm2sms q ms = Some sms)" |
|
649 |
by (induct ms, auto split:option.splits simp:init_cm2smsg_def) |
|
650 |
||
651 |
lemma init_cqm2sms_has_sms: |
|
652 |
"q \<in> init_msgqs \<Longrightarrow> \<exists> sms. init_cqm2sms q (init_msgs_of_queue q) = Some sms" |
|
653 |
apply (rule init_cqm2sms_has_sms_aux) |
|
654 |
using init_msg_has_ctxt by auto |
|
655 |
||
656 |
lemma init_msgq_has_smsgq: |
|
657 |
"q \<in> init_msgqs \<Longrightarrow> \<exists> sq. init_cq2smsgq q = Some sq" |
|
658 |
apply (frule init_msgq_has_ctxt, erule exE, drule init_cqm2sms_has_sms, erule exE) |
|
659 |
apply (simp add:init_cq2smsgq_def) |
|
660 |
by (case_tac sec, simp+) |
|
661 |
||
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
662 |
lemma cf2sfile_nil_prop: |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
663 |
"f \<in> init_files \<Longrightarrow> cf2sfile [] f = init_cf2sfile f" |
1 | 664 |
apply (case_tac f) |
665 |
apply (simp add:init_sectxt_prop cf2sfile_def init_cf2sfile_def) |
|
666 |
apply (auto simp:init_sectxt_prop cf2sfile_def init_cf2sfile_def split:option.splits dest!:init_has_ctxt') |
|
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
667 |
apply (auto simp:is_init_file_def is_init_dir_def is_file_nil split:option.splits t_inode_tag.splits |
1 | 668 |
dest:init_file_has_inum inof_has_file_tag) |
669 |
done |
|
670 |
||
671 |
lemma init_sec_file_dir: |
|
672 |
"\<lbrakk>init_sectxt_of_obj (O_file f) = Some x; init_sectxt_of_obj (O_dir f) = Some y\<rbrakk> \<Longrightarrow> False" |
|
673 |
apply (drule init_sectxt_prop2)+ |
|
674 |
apply (auto intro:init_file_dir_conflict) |
|
675 |
done |
|
676 |
||
677 |
lemma cf2sfile_nil_prop3: |
|
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
678 |
"is_init_file f \<Longrightarrow> cf2sfile [] f = init_cf2sfile f" |
1 | 679 |
by (simp add:is_init_file_prop1 cf2sfile_nil_prop) |
680 |
||
681 |
lemma cf2sfile_nil_prop4: |
|
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
682 |
"is_init_dir f \<Longrightarrow> cf2sfile [] f = init_cf2sfile f" |
1 | 683 |
apply (frule init_file_dir_conflict2) |
684 |
by (simp add:is_init_file_prop1 is_init_dir_prop1 cf2sfile_nil_prop) |
|
685 |
||
686 |
lemma cfs2sfiles_nil_prop: |
|
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
687 |
"f \<in> init_files \<Longrightarrow> cf2sfiles [] f = init_cf2sfiles f" |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
688 |
apply (simp add:cf2sfiles_def init_cf2sfiles_def) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
689 |
apply (rule set_eqI, rule iffI, auto split:if_splits) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
690 |
apply (rule_tac x = f' in bexI, simp add:same_inode_nil_prop cf2sfile_nil_prop) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
691 |
apply (drule init_same_inode_prop2, simp) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
692 |
apply (simp add:cf2sfile_nil_prop) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
693 |
apply (simp add:same_inode_nil_prop) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
694 |
apply (rule_tac x = f' in bexI) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
695 |
apply (drule init_same_inode_prop2, simp) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
696 |
apply ( simp add:same_inode_nil_prop cf2sfile_nil_prop) |
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
697 |
apply (simp add:same_inode_nil_prop) |
2 | 698 |
done |
1 | 699 |
|
700 |
lemma cfd2sfd_nil_prop: |
|
701 |
"init_file_of_proc_fd p fd = Some f \<Longrightarrow> cfd2sfd [] p fd = init_cfd2sfd p fd" |
|
702 |
apply (simp add:cfd2sfd_def init_sectxt_prop init_cfd2sfd_def) |
|
2 | 703 |
apply (frule init_filefd_prop5, drule init_filefd_prop1, drule cf2sfile_nil_prop) |
1 | 704 |
by (auto split:option.splits) |
705 |
||
706 |
lemma cpfd2sfds_nil_prop: |
|
707 |
"cpfd2sfds [] p = init_cfds2sfds p" |
|
708 |
apply (simp only:cpfd2sfds_def init_cfds2sfds_def) |
|
709 |
apply (rule set_eqI, rule iffI) |
|
710 |
apply (drule CollectD, rule CollectI, (erule exE)+) |
|
711 |
apply (rule_tac x = fd in exI, rule_tac x = sfd in exI, rule_tac x = f in exI) defer |
|
712 |
apply (drule CollectD, rule CollectI, (erule exE)+) |
|
713 |
apply (rule_tac x = fd in exI, rule_tac x = sfd in exI, rule_tac x = f in exI) |
|
714 |
using cfd2sfd_nil_prop by auto |
|
715 |
||
716 |
lemma ch2sshm_nil_prop: |
|
717 |
"h \<in> init_shms \<Longrightarrow> ch2sshm [] h = init_ch2sshm h" |
|
718 |
by (simp add:ch2sshm_def init_sectxt_prop init_ch2sshm_def) |
|
719 |
||
720 |
lemma cph2spshs_nil_prop: |
|
721 |
"cph2spshs [] p = init_cph2spshs p" |
|
722 |
apply (auto simp add:init_cph2spshs_def cph2spshs_def init_sectxt_prop) |
|
723 |
apply (rule_tac x = h in exI, simp) defer |
|
724 |
apply (rule_tac x = h in exI, simp) |
|
725 |
by (auto simp:ch2sshm_nil_prop dest:init_procs_has_shm) |
|
726 |
||
727 |
lemma cp2sproc_nil_prop: |
|
728 |
"p \<in> init_procs \<Longrightarrow> cp2sproc [] p = init_cp2sproc p" |
|
729 |
by (auto simp add:init_cp2sproc_def cp2sproc_def init_sectxt_prop cph2spshs_nil_prop cpfd2sfds_nil_prop |
|
730 |
split:option.splits) |
|
731 |
||
732 |
lemma msg_has_sec_imp_init: |
|
733 |
"init_sectxt_of_obj (O_msg q m) = Some sec \<Longrightarrow> q \<in> init_msgqs \<and> m \<in> set (init_msgs_of_queue q)" |
|
734 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
735 |
by (drule init_type_has_obj, simp) |
|
736 |
||
737 |
lemma msgq_has_sec_imp_init: |
|
738 |
"init_sectxt_of_obj (O_msgq q) = Some sec \<Longrightarrow> q \<in> init_msgqs" |
|
739 |
apply (simp add:init_sectxt_of_obj_def split:option.splits) |
|
740 |
by (drule init_type_has_obj, simp) |
|
741 |
||
742 |
lemma cm2smsg_nil_prop: |
|
743 |
"cm2smsg [] q m = init_cm2smsg q m" |
|
744 |
by (auto simp add:init_sectxt_prop cm2smsg_def init_cm2smsg_def split:option.splits |
|
745 |
dest: msg_has_sec_imp_init intro:t_init elim:tainted.cases) |
|
746 |
||
747 |
lemma cqm2sms_nil_prop: |
|
748 |
"cqm2sms [] q ms = init_cqm2sms q ms" |
|
749 |
apply (induct ms, simp) |
|
750 |
by (auto simp add:cm2smsg_def init_sectxt_prop tainted_nil_prop msg_has_sec_imp_init init_cm2smsg_def |
|
751 |
split:option.splits) |
|
752 |
||
753 |
lemma cq2smsga_nil_prop: |
|
754 |
"cq2smsgq [] q = init_cq2smsgq q" |
|
755 |
by (auto simp add:cq2smsgq_def init_cq2smsgq_def init_sectxt_prop cqm2sms_nil_prop |
|
756 |
intro:msgq_has_sec_imp_init split:option.splits) |
|
757 |
||
758 |
lemma co2sobj_nil_prop: |
|
759 |
"init_alive obj \<Longrightarrow> co2sobj [] obj = init_obj2sobj obj" |
|
760 |
apply (case_tac obj) |
|
761 |
apply (auto simp add:cf2sfile_nil_prop cq2smsga_nil_prop cqm2sms_nil_prop tainted_nil_prop |
|
762 |
cp2sproc_nil_prop cfs2sfiles_nil_prop is_init_dir_prop1 is_init_file_prop1 |
|
763 |
is_init_udp_sock_prop1 is_init_tcp_sock_prop1 ch2sshm_nil_prop |
|
2 | 764 |
same_inode_nil_prop cm2smsg_nil_prop |
765 |
dest:init_same_inode_prop1 |
|
1 | 766 |
split:option.splits) |
767 |
apply (rule_tac x = list in exI, simp add:init_same_inode_files_def) |
|
2 | 768 |
apply (simp add:init_files_props) |
6
8779d321cc2e
remove duplicated pre-condition of current_files in OS_grant, since it is property if is_file/is_dir.
chunhan
parents:
4
diff
changeset
|
769 |
apply (auto simp:is_dir_nil is_file_nil init_files_prop4 dest:init_file_dir_conflict) |
2 | 770 |
done |
1 | 771 |
|
772 |
lemma s2ss_nil_prop: |
|
773 |
"s2ss [] = init_static_state" |
|
774 |
using co2sobj_nil_prop init_alive_prop |
|
775 |
by (auto simp add:s2ss_def init_static_state_def) |
|
776 |
||
777 |
end |
|
778 |
||
779 |
(*<*) |
|
780 |
end |
|
781 |
(*>*) |