Proc_fd_of_file_prop.thy
changeset 70 002c34a6ff4f
parent 1 7d9c0ed02b56
child 71 db0e8601c229
equal deleted inserted replaced
69:fc7151df7f8e 70:002c34a6ff4f
     1 theory Proc_fd_of_file_prop
     1 theory Proc_fd_of_file_prop
     2 imports Main Flask Flask_type Valid_prop Current_files_prop
     2 imports Main Flask Flask_type Valid_prop Current_files_prop Current_sockets_prop
     3 begin
     3 begin
     4 
     4 
     5 context flask begin
     5 context flask begin
     6 
     6 
     7 lemma proc_fd_in_procs: "\<lbrakk>file_of_proc_fd \<tau> p fd = Some f; valid \<tau>\<rbrakk>  \<Longrightarrow> p \<in> current_procs \<tau>"
     7 lemma proc_fd_in_procs: "\<lbrakk>file_of_proc_fd \<tau> p fd = Some f; valid \<tau>\<rbrakk>  \<Longrightarrow> p \<in> current_procs \<tau>"
    43 by (auto simp:proc_fd_of_file_def)
    43 by (auto simp:proc_fd_of_file_def)
    44 
    44 
    45 lemma file_of_proc_fd_in_curf: "\<lbrakk>file_of_proc_fd \<tau> p fd = Some f; valid \<tau>\<rbrakk> \<Longrightarrow> f \<in> current_files \<tau>"
    45 lemma file_of_proc_fd_in_curf: "\<lbrakk>file_of_proc_fd \<tau> p fd = Some f; valid \<tau>\<rbrakk> \<Longrightarrow> f \<in> current_files \<tau>"
    46 by (drule procfd_of_file_non_empty, simp add:proc_fd_file_in_cur')
    46 by (drule procfd_of_file_non_empty, simp add:proc_fd_file_in_cur')
    47 
    47 
       
    48 lemma file_fds_subset_pfds:
       
    49   "valid s \<Longrightarrow> proc_file_fds s p \<subseteq> current_proc_fds s p"
       
    50 by (auto simp add:proc_file_fds_def intro:proc_fd_in_fds)
       
    51 
       
    52 lemma tcp_filefd_conflict:
       
    53   "\<lbrakk>file_of_proc_fd s p fd = Some f; is_tcp_sock s (p, fd); valid s\<rbrakk> \<Longrightarrow> False"
       
    54 apply (induct s, simp)
       
    55 apply (auto simp:is_tcp_sock_simps)
       
    56 
       
    57 
       
    58 lemma tcp_not_file_fd:
       
    59   "\<lbrakk>is_tcp_sock s (p, fd); valid s\<rbrakk> \<Longrightarrow> fd \<notin> proc_file_fds s p"
       
    60 apply (auto simp:proc_file_fds_def)
       
    61 
       
    62 lemma udp_not_file_fd:
       
    63   "\<lbrakk>is_udp_sock s (p, fd); valid s\<rbrakk> \<Longrightarrow> fd \<notin> proc_file_fds s p"
       
    64 
       
    65 lemma
    48 
    66 
    49 (******************* rebuild proc_fd_of_file simpset ***********************)
    67 (******************* rebuild proc_fd_of_file simpset ***********************)
    50 (*
    68 (*
    51 lemma proc_fd_of_file_open: "Open p f flags fd iopt # valid \<tau> \<Longrightarrow> 
    69 lemma proc_fd_of_file_open: "Open p f flags fd iopt # valid \<tau> \<Longrightarrow> 
    52   proc_fd_of_file (Open p f flags fd iopt # \<tau>) f' = (if (f' = f) then insert (p, fd) (proc_fd_of_file \<tau> f') else proc_fd_of_file \<tau> f')"
    70   proc_fd_of_file (Open p f flags fd iopt # \<tau>) f' = (if (f' = f) then insert (p, fd) (proc_fd_of_file \<tau> f') else proc_fd_of_file \<tau> f')"