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