no_shm_selinux/Enrich2.thy
changeset 86 690636b7b6f1
parent 85 1d1aa5bdd37d
child 87 8d18cfc845dd
equal deleted inserted replaced
85:1d1aa5bdd37d 86:690636b7b6f1
   254      (\<forall>q. q \<in> current_msgqs s \<longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q) \<and>
   254      (\<forall>q. q \<in> current_msgqs s \<longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q) \<and>
   255      (\<forall>tp fd. fd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd) \<and>     
   255      (\<forall>tp fd. fd \<in> proc_file_fds s tp \<longrightarrow> cfd2sfd (enrich_proc s p p') tp fd = cfd2sfd s tp fd) \<and>     
   256      (cp2sproc (enrich_proc s p p') p' = cp2sproc s p) \<and>
   256      (cp2sproc (enrich_proc s p p') p' = cp2sproc s p) \<and>
   257      (\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd)"
   257      (\<forall> fd. fd \<in> proc_file_fds s p \<longrightarrow> cfd2sfd (enrich_proc s p p') p' fd = cfd2sfd s p fd)"
   258     using vd all_procs nodel by auto
   258     using vd all_procs nodel by auto
       
   259   
       
   260   from pre have pre_vd: "is_created_proc s p \<Longrightarrow> valid (enrich_proc s p p')" by simp
       
   261   have vd_enrich:"is_created_proc s p \<Longrightarrow> valid (e # enrich_proc s p p')" 
       
   262     apply (frule pre_vd)
       
   263     apply (erule_tac s = s and obj' = "E_proc p'" in enrich_valid_intro_cons)
       
   264     apply (simp_all add: pre nodel_cons all_procs_cons vd_cons')
       
   265     apply (clarsimp simp:enrich_proc_alive nodel all_procs vd)
       
   266     apply (rule allI, rule impI, erule enrich_proc_not_alive)
       
   267     apply (simp_all add:nodel all_procs vd enrich_proc_hungs enrich_proc_cur_msgs)
       
   268     apply ((rule allI| rule impI)+, erule enrich_proc_filefd)
       
   269     apply (simp_all add:nodel all_procs vd)
       
   270     apply ((rule allI| rule impI)+, erule enrich_proc_flagfd)
       
   271     apply (simp_all add:nodel all_procs vd)
       
   272     done  
   259   have vd_enrich_cons: "valid (enrich_proc (e # s) p p')"
   273   have vd_enrich_cons: "valid (enrich_proc (e # s) p p')"
   260   proof-
   274   proof-
   261     from pre have pre': "is_created_proc s p \<Longrightarrow> valid (enrich_proc s p p')" by simp
   275     have "\<And>f fds. \<lbrakk>valid (Execve p f fds # enrich_proc s p p'); is_created_proc s p; 
   262     have "is_created_proc s p \<Longrightarrow> valid (e # enrich_proc s p p')" 
       
   263       apply (frule pre')
       
   264       apply (erule_tac s = s and obj' = "E_proc p'" in enrich_valid_intro_cons)
       
   265       apply (simp_all add: pre nodel_cons all_procs_cons vd_cons')
       
   266       apply (clarsimp simp:enrich_proc_alive nodel all_procs vd)
       
   267       apply (rule allI, rule impI, erule enrich_proc_not_alive)
       
   268       apply (simp_all add:nodel all_procs vd enrich_proc_hungs enrich_proc_cur_msgs)
       
   269       apply ((rule allI| rule impI)+, erule enrich_proc_filefd)
       
   270       apply (simp_all add:nodel all_procs vd)
       
   271       apply ((rule allI| rule impI)+, erule enrich_proc_flagfd)
       
   272       apply (simp_all add:nodel all_procs vd)
       
   273       done
       
   274     moreover have "\<And>f fds. \<lbrakk>valid (Execve p f fds # enrich_proc s p p'); is_created_proc s p; 
       
   275       valid (Execve p f fds # s); p' \<notin> all_procs s\<rbrakk>
   276       valid (Execve p f fds # s); p' \<notin> all_procs s\<rbrakk>
   276       \<Longrightarrow> valid (Execve p' f (fds \<inter> proc_file_fds s p) # Execve p f fds # enrich_proc s p p')"
   277       \<Longrightarrow> valid (Execve p' f (fds \<inter> proc_file_fds s p) # Execve p f fds # enrich_proc s p p')"
   277     proof-
   278     proof-
   278       fix f fds
   279       fix f fds
   279       assume a1: "valid (Execve p f fds # enrich_proc s p p')" and a2: "is_created_proc s p"
   280       assume a1: "valid (Execve p f fds # enrich_proc s p p')" and a2: "is_created_proc s p"
   515           show ?thesis
   516           show ?thesis
   516             using parent a1 Some nsf
   517             using parent a1 Some nsf
   517             apply (erule_tac search_check_leveling_f)
   518             apply (erule_tac search_check_leveling_f)
   518             apply (simp_all)
   519             apply (simp_all)
   519             apply (simp add:search_check_file_def)
   520             apply (simp add:search_check_file_def)
       
   521             (* create new file, grant only check pf's SEARCH permission, not newfile itself, so we make assumptions of this case in the locale *)
   520             apply (simp add:permission_check.simps)
   522             apply (simp add:permission_check.simps)
   521             sorry
   523             sorry
   522         qed
   524         qed
   523         thus ?thesis using a0 a5 a6 a7 a1 Some
   525         thus ?thesis using a0 a5 a6 a7 a1 Some
   524           apply (rule_tac valid.intros(2))
   526           apply (rule_tac valid.intros(2))
   541       from a4 a3 have a0: "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3)
   543       from a4 a3 have a0: "p' \<noteq> p" by (auto dest!:vt_grant_os not_all_procs_prop3)
   542       have "p' \<in> current_procs (enrich_proc s p p')" 
   544       have "p' \<in> current_procs (enrich_proc s p p')" 
   543         using a2 a3 vd
   545         using a2 a3 vd
   544         by (auto intro:enrich_proc_dup_in)
   546         by (auto intro:enrich_proc_dup_in)
   545       moreover have "fd \<in> current_proc_fds (enrich_proc s p p') p'"      
   547       moreover have "fd \<in> current_proc_fds (enrich_proc s p p') p'"      
   546         using a5 a2 a3 vd pre' nodel
   548         using a5 a2 a3 vd pre_vd nodel
   547         apply (simp)
   549         apply (simp)
   548         apply (drule_tac s = "enrich_proc s p p'" and p = p' in file_fds_subset_pfds)
   550         apply (drule_tac s = "enrich_proc s p p'" and p = p' in file_fds_subset_pfds)
   549         apply (erule set_mp)
   551         apply (erule set_mp)
   550         apply (simp add:enrich_proc_dup_ffds)
   552         apply (simp add:enrich_proc_dup_ffds)
   551         done
   553         done
   552       ultimately show "valid (CloseFd p' fd # CloseFd p fd # enrich_proc s p p')"
   554       ultimately show "valid (CloseFd p' fd # CloseFd p fd # enrich_proc s p p')"
   553         apply (rule_tac valid.intros(2))
   555         apply (rule_tac valid.intros(2))
   554         apply (simp_all add:a1 a0 a2 pre')
   556         apply (simp_all add:a1 a0 a2 pre_vd)
   555         done
   557         done
   556     qed
   558     qed
   557     moreover have "\<And> fd. \<lbrakk>valid (ReadFile p fd # enrich_proc s p p');
   559     moreover have "\<And> fd. \<lbrakk>valid (ReadFile p fd # enrich_proc s p p');
   558             is_created_proc s p; valid (ReadFile p fd # s); p' \<notin> all_procs s\<rbrakk>
   560             is_created_proc s p; valid (ReadFile p fd # s); p' \<notin> all_procs s\<rbrakk>
   559            \<Longrightarrow> valid (ReadFile p' fd # ReadFile p fd # enrich_proc s p p')"
   561            \<Longrightarrow> valid (ReadFile p' fd # ReadFile p fd # enrich_proc s p p')"
   641           using a1
   643           using a1
   642           by (erule_tac valid.intros(2), simp+)
   644           by (erule_tac valid.intros(2), simp+)
   643       qed
   645       qed
   644     qed
   646     qed
   645     ultimately show ?thesis 
   647     ultimately show ?thesis 
   646       using created_cons vd_cons' all_procs_cons
   648       using vd_enrich created_cons vd_cons' all_procs_cons
   647       apply (case_tac e)
   649       apply (case_tac e)
   648       apply (auto simp:is_created_proc_simps split:if_splits)
   650       apply (auto simp:is_created_proc_simps split:if_splits)
   649       done
   651       done
   650   qed
   652   qed
       
   653   have sec_proc:
       
   654     "\<And> tp. \<lbrakk>tp \<in> current_procs s; is_created_proc s p\<rbrakk> 
       
   655     \<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_proc tp) = sectxt_of_obj s (O_proc tp)"
       
   656     using pre 
       
   657     apply (clarsimp)
       
   658     apply (erule_tac x = tp in allE, auto simp:cp2sproc_def split:option.splits)
       
   659     done
   651   have sf_cons:
   660   have sf_cons:
   652     "\<forall>f. f \<in> current_files (e # s) \<longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
   661     "\<forall>f. f \<in> current_files (e # s) \<longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
   653   proof clarify
   662   proof clarify
   654     fix f 
   663     fix f 
   655     assume a1: "f \<in> current_files (e # s)"
   664     assume a1: "f \<in> current_files (e # s)"
   657       \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f"
   666       \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f"
   658       by auto
   667       by auto
   659     from a1 have a1': "f \<in> current_files (enrich_proc (e # s) p p')"
   668     from a1 have a1': "f \<in> current_files (enrich_proc (e # s) p p')"
   660       using vd_cons' nodel_cons
   669       using vd_cons' nodel_cons
   661       by (simp add:enrich_proc_cur_files)
   670       by (simp add:enrich_proc_cur_files)
       
   671     from a1 have a1'': "f \<in> current_files (e # enrich_proc s p p')"
       
   672       using vd_cons' nodel_cons os vd vd_enrich created_cons
       
   673       apply (case_tac e)
       
   674       apply (auto simp:enrich_proc_cur_files current_files_simps is_created_proc_simps
       
   675         dest:is_file_in_current is_dir_in_current split:option.splits)
       
   676       done
       
   677     
       
   678     have sec_dir:
       
   679       "\<And> tf. \<lbrakk>is_dir s tf; is_created_proc s p\<rbrakk>
       
   680       \<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_dir tf) = sectxt_of_obj s (O_dir tf)"
       
   681     proof-
       
   682       fix tf 
       
   683       assume a1: "is_dir s tf" and a2: "is_created_proc s p"
       
   684       from a2 pre
       
   685       have pre': "\<And>f. f \<in> current_files s \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f"
       
   686         and vd_enrich: "valid (enrich_proc s p p')"
       
   687         by auto
       
   688       hence csf: "cf2sfile (enrich_proc s p p') tf = cf2sfile s tf"
       
   689         using a1 by (auto simp:is_dir_in_current)
       
   690       from a1 obtain sf where csf_some: "cf2sfile s tf = Some sf"
       
   691         apply (case_tac "cf2sfile s tf")
       
   692         apply (drule current_file_has_sfile')
       
   693         apply (simp add:vd, simp add:is_dir_in_current, simp)
       
   694         done      
       
   695       from a1 have a1': "is_dir (enrich_proc s p p') tf"
       
   696         using enrich_proc_is_dir vd nodel all_procs by simp
       
   697       from a1 have a3: "\<not> is_file s tf" using vd by (simp add:is_dir_not_file)
       
   698       from a1' vd have a3': "\<not> is_file (enrich_proc s p p') tf" by (simp add:is_dir_not_file)  
       
   699       show "sectxt_of_obj (enrich_proc s p p') (O_dir tf) = sectxt_of_obj s (O_dir tf)"
       
   700         using csf csf_some a3 a3' vd_enrich vd
       
   701         apply (auto simp:cf2sfile_def split:option.splits)
       
   702         apply (case_tac tf)
       
   703         apply (simp add:root_sec_remains, simp)
       
   704         done
       
   705     qed
       
   706     have sec_file:
       
   707       "\<And> tf. \<lbrakk>is_file s tf; is_created_proc s p\<rbrakk>
       
   708       \<Longrightarrow> sectxt_of_obj (enrich_proc s p p') (O_file tf) = sectxt_of_obj s (O_file tf)"
       
   709     proof-
       
   710       fix tf 
       
   711       assume a1: "is_file s tf" and a2: "is_created_proc s p"
       
   712       from a2 pre
       
   713       have pre': "\<And>f. f \<in> current_files s \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f"
       
   714         and vd_enrich: "valid (enrich_proc s p p')"
       
   715         by auto
       
   716       hence csf: "cf2sfile (enrich_proc s p p') tf = cf2sfile s tf"
       
   717         using a1 by (auto simp:is_file_in_current)
       
   718       from a1 obtain sf where csf_some: "cf2sfile s tf = Some sf"
       
   719         apply (case_tac "cf2sfile s tf")
       
   720         apply (drule current_file_has_sfile')
       
   721         apply (simp add:vd, simp add:is_file_in_current, simp)
       
   722         done
       
   723       from a1 have a1': "is_file (enrich_proc s p p') tf"
       
   724         using vd nodel all_procs by (simp add:enrich_proc_is_file)
       
   725       show "sectxt_of_obj (enrich_proc s p p') (O_file tf) = sectxt_of_obj s (O_file tf)"
       
   726         using csf csf_some vd_enrich vd a1 a1'
       
   727         apply (auto simp:cf2sfile_def split:option.splits if_splits)
       
   728         apply (case_tac tf, simp_all)
       
   729         apply (drule root_is_dir', simp+)
       
   730         done
       
   731     qed
       
   732     have secs_dir:
       
   733       "\<And> tf ctxts'. \<lbrakk>is_dir s tf; is_created_proc s p; get_parentfs_ctxts s tf = Some ctxts'\<rbrakk>
       
   734        \<Longrightarrow> \<exists> ctxts. get_parentfs_ctxts (enrich_proc s p p') tf = Some ctxts \<and> set ctxts = set ctxts'"
       
   735     proof-
       
   736       fix tf ctxts'
       
   737       assume a1: "is_dir s tf" and a2: "is_created_proc s p" 
       
   738         and a4: "get_parentfs_ctxts s tf = Some ctxts'"
       
   739       from a2 pre
       
   740       have pre': "\<And>f. f \<in> current_files s \<Longrightarrow> cf2sfile (enrich_proc s p p') f = cf2sfile s f"
       
   741         and vd_enrich': "valid (enrich_proc s p p')"
       
   742         by auto
       
   743       hence csf: "cf2sfile (enrich_proc s p p') tf = cf2sfile s tf"
       
   744         using a1 by (auto simp:is_dir_in_current)
       
   745       from a1 obtain sf where csf_some: "cf2sfile s tf = Some sf"
       
   746         apply (case_tac "cf2sfile s tf")
       
   747         apply (drule current_file_has_sfile')
       
   748         apply (simp add:vd, simp add:is_dir_in_current, simp)
       
   749         done      
       
   750       from a1 have a1': "is_dir (enrich_proc s p p') tf"
       
   751         using enrich_proc_is_dir vd nodel all_procs by simp
       
   752       from a1 have a5: "\<not> is_file s tf" using vd by (simp add:is_dir_not_file)
       
   753       from a1' vd have a5': "\<not> is_file (enrich_proc s p p') tf" by (simp add:is_dir_not_file) 
   662       
   754       
       
   755       from a1' pre_vd a2 obtain ctxts 
       
   756         where a3: "get_parentfs_ctxts (enrich_proc s p p') tf = Some ctxts"
       
   757         apply (case_tac "get_parentfs_ctxts (enrich_proc s p p') tf")
       
   758         apply (drule get_pfs_secs_prop', simp+)
       
   759         done
       
   760       moreover have "set ctxts = set ctxts'"
       
   761       proof (cases tf)
       
   762         case Nil          
       
   763         with a3 a4 vd vd_enrich'
       
   764         show ?thesis
       
   765           by (simp add:get_parentfs_ctxts.simps root_sec_remains split:option.splits)
       
   766       next
       
   767         case (Cons a ff)
       
   768         with csf csf_some a5 a5' vd_enrich' vd a3 a4
       
   769         show ?thesis
       
   770           apply (auto simp:cf2sfile_def split:option.splits if_splits)
       
   771           done
       
   772       qed
       
   773       ultimately 
       
   774       show "\<exists> ctxts. get_parentfs_ctxts (enrich_proc s p p') tf = Some ctxts \<and> set ctxts = set ctxts'"
       
   775         by auto        
       
   776     qed
       
   777     have b1: "\<And> proc f' flags fd' opt. e = Open proc f' flags fd' opt 
       
   778       \<Longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
       
   779     proof-
       
   780       fix proc f' flags fd' opt
       
   781       assume ev: "e = Open proc f' flags fd' opt"
       
   782       have b1': "cf2sfile (e # enrich_proc s p p') f = cf2sfile (e # s) f"
       
   783       proof (cases opt)
       
   784         case None
       
   785         thus ?thesis
       
   786           using vd_cons' vd_enrich a1 created_cons 
       
   787           by (simp add:cf2sfile_open_none ev pre_sf 
       
   788             is_created_proc_simps current_files_simps)
       
   789       next
       
   790         case (Some inum)
       
   791         show ?thesis
       
   792         proof (cases "f' = f")
       
   793           case True
       
   794           from a1 obtain sf where csf: "cf2sfile (e # s) f = Some sf"
       
   795             apply (case_tac "cf2sfile (e # s) f")
       
   796             apply (drule current_file_has_sfile')
       
   797             apply (simp add:vd_cons', simp, simp)
       
   798             done
       
   799           from a1 ev os Some True obtain pf where parent: "parent f = Some pf"
       
   800             and pdir: "is_dir s pf" and proc_in: "proc \<in> current_procs s" by auto
       
   801           have f_in: "f \<in> current_files (e # enrich_proc s p p')"
       
   802             using ev True Some
       
   803             by (simp add:current_files_open)
       
   804           thus ?thesis using ev Some csf vd_enrich True created_cons vd_cons' a1 parent pdir proc_in
       
   805             apply (simp add:is_created_proc_simps cf2sfile_open)
       
   806             apply (simp add:sectxt_of_obj_simps sec_dir sec_proc split:option.splits)
       
   807             apply (drule_tac tf = pf in secs_dir, simp+) 
       
   808             apply (erule exE, erule conjE, simp)
       
   809             apply (case_tac aa, simp)
       
   810             done
       
   811         next
       
   812           case False
       
   813           have f_in: "f \<in> current_files (e # enrich_proc s p p')"
       
   814             using ev False Some vd_enrich a1 created_cons nodel vd
       
   815             by (simp add:current_files_open is_created_proc_simps enrich_proc_cur_files)
       
   816           with ev Some a1 vd_enrich vd_cons' created_cons False
       
   817           show ?thesis
       
   818             apply (simp add:is_created_proc_simps cf2sfile_open)
       
   819             apply (simp add:current_files_simps pre_sf)
       
   820             done
       
   821         qed
       
   822       qed
       
   823       show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f" 
       
   824         using ev vd_enrich_cons
       
   825         apply simp
       
   826         apply (rule conjI, rule impI)
       
   827         apply (simp add:cf2sfile_open_none)
       
   828         using b1' apply (auto dest:vd_cons)
       
   829         done
       
   830     qed
       
   831     have b2: "\<And> proc f' inum. e = Mkdir proc f' inum
       
   832       \<Longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
       
   833     proof-
       
   834       fix proc f' inum
       
   835       assume ev: "e = Mkdir proc f' inum"
       
   836       
       
   837       show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
       
   838       proof (cases "f' = f")
       
   839         case True
       
   840         from a1 obtain sf where csf: "cf2sfile (e # s) f = Some sf"
       
   841           apply (case_tac "cf2sfile (e # s) f")
       
   842           apply (drule current_file_has_sfile')
       
   843           apply (simp add:vd_cons', simp, simp)
       
   844           done
       
   845         from a1 ev os True obtain pf where parent: "parent f = Some pf"
       
   846           and pdir: "is_dir s pf" and proc_in: "proc \<in> current_procs s" by auto
       
   847         have f_in: "f \<in> current_files (e # enrich_proc s p p')"
       
   848           using ev True
       
   849           by (simp add:current_files_mkdir)
       
   850         thus ?thesis using ev csf vd_enrich True created_cons vd_cons' a1 parent pdir proc_in
       
   851           apply (simp add:is_created_proc_simps cf2sfile_mkdir)
       
   852           apply (simp add:sectxt_of_obj_simps sec_dir sec_proc split:option.splits)
       
   853           apply (drule_tac tf = pf in secs_dir, simp+) 
       
   854           apply (erule exE, erule conjE, simp)
       
   855           apply (case_tac aa, simp)
       
   856           done
       
   857       next
       
   858         case False
       
   859         have f_in: "f \<in> current_files (e # enrich_proc s p p')"
       
   860           using ev False vd_enrich a1 created_cons nodel vd
       
   861           by (simp add:current_files_mkdir is_created_proc_simps enrich_proc_cur_files)
       
   862         with ev a1 vd_enrich vd_cons' created_cons False
       
   863         show ?thesis
       
   864           apply (simp add:is_created_proc_simps cf2sfile_mkdir)
       
   865           apply (simp add:current_files_simps pre_sf)
       
   866           done
       
   867       qed
       
   868     qed
       
   869     have b3: "\<And> proc f' f''. e = LinkHard proc f' f''
       
   870       \<Longrightarrow> cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
       
   871     proof-
       
   872       fix proc f' f'' 
       
   873       assume ev: "e = LinkHard proc f' f''"      
       
   874       show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
       
   875       proof (cases "f'' = f")
       
   876         case True
       
   877         from a1 obtain sf where csf: "cf2sfile (e # s) f = Some sf"
       
   878           apply (case_tac "cf2sfile (e # s) f")
       
   879           apply (drule current_file_has_sfile')
       
   880           apply (simp add:vd_cons', simp, simp)
       
   881           done
       
   882         from a1 ev os True obtain pf where parent: "parent f'' = Some pf"
       
   883           and pdir: "is_dir s pf" and proc_in: "proc \<in> current_procs s" by auto
       
   884         have f_in: "f \<in> current_files (e # enrich_proc s p p')"
       
   885           using ev True vd_enrich created_cons
       
   886           by (simp add:current_files_simps is_created_proc_simps)
       
   887         thus ?thesis using ev csf vd_enrich True created_cons vd_cons' a1 parent pdir proc_in
       
   888           apply (simp add:is_created_proc_simps cf2sfile_linkhard)
       
   889           apply (simp add:sectxt_of_obj_simps sec_dir sec_proc split:option.splits)
       
   890           apply (drule_tac tf = pf in secs_dir, simp+) 
       
   891           apply (erule exE, erule conjE, simp)
       
   892           apply (case_tac aa, simp)
       
   893           done
       
   894       next
       
   895         case False
       
   896         have f_in: "f \<in> current_files (e # enrich_proc s p p')"
       
   897           using ev False vd_enrich a1 created_cons nodel vd vd_cons'
       
   898           by (simp add:current_files_linkhard is_created_proc_simps enrich_proc_cur_files)
       
   899         with ev a1 vd_enrich vd_cons' created_cons False
       
   900         show ?thesis
       
   901           apply (simp add:is_created_proc_simps cf2sfile_linkhard)
       
   902           apply (simp add:current_files_simps pre_sf)
       
   903           done
       
   904       qed      
       
   905     qed
   663     show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
   906     show "cf2sfile (enrich_proc (e # s) p p') f = cf2sfile (e # s) f"
   664         apply (case_tac e)
   907       apply (case_tac e) 
   665         using vd created_cons nodel_cons vd_enrich_cons vd_cons' a1 a1'
   908       prefer 6 apply (erule b1)
   666         apply (auto intro!:pre_sf simp:cf2sfile_simps is_created_proc_simps 
   909       prefer 11 apply (erule b2)
   667           split:if_splits dest:vd_cons)
   910       prefer 11 apply (erule b3)
   668         thm cf2sfile_other
   911       using vd created_cons nodel_cons vd_enrich_cons vd_cons' a1 a1'
   669         apply (simp_all)
   912       apply (auto intro!:pre_sf simp:cf2sfile_simps is_created_proc_simps current_files_simps
   670         done
   913         split:if_splits dest:vd_cons cf2sfile_other')
   671       
   914       done
   672     
   915   qed
   673     sorry
       
   674   moreover have "\<forall>tp fd. fd \<in> proc_file_fds (e # s) tp \<longrightarrow> 
   916   moreover have "\<forall>tp fd. fd \<in> proc_file_fds (e # s) tp \<longrightarrow> 
   675     cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd"
   917     cfd2sfd (enrich_proc (e # s) p p') tp fd = cfd2sfd (e # s) tp fd"
   676   proof clarify
   918   proof clarify
   677     fix tp fd 
   919     fix tp fd 
   678     assume a1: "fd \<in> proc_file_fds (e # s) tp"
   920     assume a1: "fd \<in> proc_file_fds (e # s) tp"
   797           simp del:file_of_proc_fd.simps split:if_splits dest:vd_cons enrich_proc_filefd)
  1039           simp del:file_of_proc_fd.simps split:if_splits dest:vd_cons enrich_proc_filefd)
   798         apply (simp_all)
  1040         apply (simp_all)
   799         done
  1041         done
   800     qed
  1042     qed
   801   qed
  1043   qed
       
  1044   moreover have "\<forall>q. q \<in> current_msgqs (e # s) \<longrightarrow> cq2smsgq (enrich_proc (e # s) p p') q = cq2smsgq (e # s) q"
       
  1045   proof clarify
       
  1046     fix q
       
  1047     assume a1: "q \<in> current_msgqs (e # s)"
       
  1048     from pre have pre_smsgq: "\<And> q. \<lbrakk>q \<in> current_msgqs s; is_created_proc s p\<rbrakk>
       
  1049       \<Longrightarrow> cq2smsgq (enrich_proc s p p') q = cq2smsgq s q"
       
  1050       by auto 
       
  1051     show "cq2smsgq (enrich_proc (e # s) p p') q = cq2smsgq (e # s) q"
       
  1052       using vd_enrich_cons a1 created_cons nodel_cons vd_cons' os
       
  1053       apply (case_tac e) 
       
  1054       apply (auto simp:cq2smsgq_simps cq2smsg_createmsgq is_created_proc_simps sec_proc 
       
  1055         dest:cq2smsgq_other intro!:pre_smsgq split:if_splits dest:vd_cons)
       
  1056       
       
  1057       apply (simp add:sectxt_of_obj_simps split:option.splits)
       
  1058       
       
  1059       thm sec_proc
       
  1060       thm cq2smsgq_simps
       
  1061       thm cq2smsg_createmsgq
       
  1062     sorry
   802   moreover have "\<forall>tp. tp \<in> current_procs (e # s) \<longrightarrow> cp2sproc (enrich_proc (e # s) p p') tp = cp2sproc (e # s) tp"
  1063   moreover have "\<forall>tp. tp \<in> current_procs (e # s) \<longrightarrow> cp2sproc (enrich_proc (e # s) p p') tp = cp2sproc (e # s) tp"
   803     sorry
       
   804   moreover have "\<forall>q. q \<in> current_msgqs (e # s) \<longrightarrow> cq2smsgq (enrich_proc (e # s) p p') q = cq2smsgq (e # s) q"
       
   805     sorry
  1064     sorry
   806   moreover have "cp2sproc (enrich_proc (e # s) p p') p' = cp2sproc (e # s) p"
  1065   moreover have "cp2sproc (enrich_proc (e # s) p p') p' = cp2sproc (e # s) p"
   807   proof-
  1066   proof-
   808     from pre have b0: "is_created_proc s p \<Longrightarrow> cp2sproc (enrich_proc s p p') p' = cp2sproc s p" by simp
  1067     from pre have b0: "is_created_proc s p \<Longrightarrow> cp2sproc (enrich_proc s p p') p' = cp2sproc s p" by simp
   809     have b1: "\<And> tp f fds. \<lbrakk>valid (enrich_proc (Execve tp f fds # s) p p'); valid (Execve tp f fds # s);
  1068     have b1: "\<And> tp f fds. \<lbrakk>valid (enrich_proc (Execve tp f fds # s) p p'); valid (Execve tp f fds # s);