Flask.thy
changeset 13 7b5e9fbeaf93
parent 12 47a4b2ae0556
child 14 cc1e46225a81
equal deleted inserted replaced
12:47a4b2ae0556 13:7b5e9fbeaf93
   432 | "procs_of_shm (CreateShM p h # \<tau>) = 
   432 | "procs_of_shm (CreateShM p h # \<tau>) = 
   433     (procs_of_shm \<tau>) (h := {})"  (* creator may not be the sharer of the shm *)
   433     (procs_of_shm \<tau>) (h := {})"  (* creator may not be the sharer of the shm *)
   434 | "procs_of_shm (Attach p h flag # \<tau>) = 
   434 | "procs_of_shm (Attach p h flag # \<tau>) = 
   435     (procs_of_shm \<tau>) (h := insert (p, flag) (procs_of_shm \<tau> h))"
   435     (procs_of_shm \<tau>) (h := insert (p, flag) (procs_of_shm \<tau> h))"
   436 | "procs_of_shm (Detach p h # \<tau>) =
   436 | "procs_of_shm (Detach p h # \<tau>) =
   437     (procs_of_shm \<tau>) (h := (procs_of_shm \<tau> h) - {(p,flag). \<exists> flag. (p, flag) \<in> procs_of_shm \<tau> h})"
   437     (procs_of_shm \<tau>) (h := (procs_of_shm \<tau> h) - {(p,flag) | flag. (p, flag) \<in> procs_of_shm \<tau> h})"
   438 | "procs_of_shm (DeleteShM p h # \<tau>) = (procs_of_shm \<tau>) (h := {})"
   438 | "procs_of_shm (DeleteShM p h # \<tau>) = (procs_of_shm \<tau>) (h := {})"
   439 | "procs_of_shm (Clone p p' fds shms # \<tau>) = 
   439 | "procs_of_shm (Clone p p' fds shms # \<tau>) = 
   440     (\<lambda> h. if (h \<in> shms) 
   440     (\<lambda> h. if (h \<in> shms) 
   441           then (procs_of_shm \<tau> h) \<union> {(p', flag). \<exists> flag. (p, flag) \<in> procs_of_shm \<tau> h}
   441           then (procs_of_shm \<tau> h) \<union> {(p', flag) | flag. (p, flag) \<in> procs_of_shm \<tau> h}
   442           else procs_of_shm \<tau> h)"
   442           else procs_of_shm \<tau> h)"
   443 | "procs_of_shm (Execve p f fds # \<tau>) = 
   443 | "procs_of_shm (Execve p f fds # \<tau>) = 
   444     (\<lambda> h. procs_of_shm \<tau> h - {(p, flag). \<exists> flag. (p, flag) \<in> procs_of_shm \<tau> h})"
   444     (\<lambda> h. procs_of_shm \<tau> h - {(p, flag) | flag. (p, flag) \<in> procs_of_shm \<tau> h})"
   445 | "procs_of_shm (e # \<tau>)          = procs_of_shm \<tau>"
   445 | "procs_of_shm (Kill p p' # s) = 
       
   446     (\<lambda> h. (procs_of_shm s h) - {(p', flag) | flag. (p', flag) \<in> procs_of_shm s h})"
       
   447 | "procs_of_shm (Exit p # s) = 
       
   448     (\<lambda> h. (procs_of_shm s h) - {(p, flag) | flag. (p, flag) \<in> procs_of_shm s h})"
       
   449 | "procs_of_shm (e # \<tau>) = procs_of_shm \<tau>"
   446 
   450 
   447 definition info_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool"
   451 definition info_flow_shm :: "t_state \<Rightarrow> t_process \<Rightarrow> t_process \<Rightarrow> bool"
   448 where
   452 where
   449   "info_flow_shm \<tau> from to \<equiv> (from = to) \<or> (\<exists> h \<in> current_shms \<tau>. \<exists> toflag. 
   453   "info_flow_shm \<tau> from to \<equiv> (from = to) \<or> (\<exists> h \<in> current_shms \<tau>. \<exists> toflag. 
   450     (((from, SHM_RDWR) \<in> procs_of_shm \<tau> h) \<and> ((to, toflag) \<in> procs_of_shm \<tau> h)))"
   454     (((from, SHM_RDWR) \<in> procs_of_shm \<tau> h) \<and> ((to, toflag) \<in> procs_of_shm \<tau> h)))"
   763 where
   767 where
   764   "proc_file_fds s p \<equiv> {fd. \<exists> f. file_of_proc_fd s p fd = Some f}"
   768   "proc_file_fds s p \<equiv> {fd. \<exists> f. file_of_proc_fd s p fd = Some f}"
   765 
   769 
   766 
   770 
   767 definition init_proc_file_fds:: "t_process \<Rightarrow> t_fd set"
   771 definition init_proc_file_fds:: "t_process \<Rightarrow> t_fd set"
       
   772 where
   768   "init_proc_file_fds p \<equiv> {fd. \<exists> f. init_file_of_proc_fd p fd = Some f}"
   773   "init_proc_file_fds p \<equiv> {fd. \<exists> f. init_file_of_proc_fd p fd = Some f}"
   769 
   774 
   770 end
   775 end
   771 
   776 
   772 
   777