Current_prop.thy
author chunhan
Thu, 06 Jun 2013 08:00:20 +0800
changeset 19 ced0fcfbcf8e
parent 18 9b42765ce554
child 23 25e55731ed01
permissions -rw-r--r--
reprove the top-level dynamic2static
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
     1
(*<*)
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     2
theory Current_prop
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     3
imports Main Flask_type Flask My_list_prefix Init_prop Valid_prop Delete_prop
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     4
begin
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
     5
(*>*)
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     6
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     7
context flask begin
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     8
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
     9
lemma procs_of_shm_prop1: "\<lbrakk> p_flag \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> h \<in> current_shms s"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    10
apply (induct s arbitrary:p_flag)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    11
apply (case_tac p_flag, simp, drule init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    12
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    13
apply (case_tac a, auto split:if_splits option.splits)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    14
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    15
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    16
lemma procs_of_shm_prop2: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> p \<in> current_procs s"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    17
apply (induct s arbitrary:p flag)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    18
apply (simp, drule init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    19
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    20
apply (case_tac a, auto split:if_splits option.splits)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    21
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    22
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    23
lemma procs_of_shm_prop3: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; (p, flag') \<in> procs_of_shm s h; valid s\<rbrakk>
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    24
  \<Longrightarrow> flag = flag'"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    25
apply (induct s arbitrary:p flag flag')
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    26
apply (simp, drule_tac flag = flag in init_procs_has_shm, drule_tac flag = flag' in init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    27
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    28
apply (case_tac a, auto split:if_splits option.splits dest:procs_of_shm_prop2)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    29
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    30
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    31
lemma procs_of_shm_prop4: "\<lbrakk>(p, flag) \<in> procs_of_shm s h; valid s\<rbrakk> \<Longrightarrow> flag_of_proc_shm s p h = Some flag"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    32
apply (induct s arbitrary:p flag)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    33
apply (simp, drule init_procs_has_shm, simp)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    34
apply (frule vd_cons, frule vt_grant_os)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    35
apply (case_tac a, auto split:if_splits option.splits dest:procs_of_shm_prop2)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    36
done
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    37
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    38
lemma procs_of_shm_prop4':
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    39
  "\<lbrakk>flag_of_proc_shm s p h = None; valid s\<rbrakk> \<Longrightarrow> \<forall> flag. (p, flag) \<notin> procs_of_shm s h"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    40
by (auto dest:procs_of_shm_prop4)
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    41
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    42
lemma not_init_intro_proc:
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    43
  "\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> deleted (O_proc p) s \<or> p \<notin> init_procs"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    44
using not_deleted_init_proc by auto
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    45
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    46
lemma not_init_intro_proc':
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    47
  "\<lbrakk>p \<notin> current_procs s; valid s\<rbrakk> \<Longrightarrow> \<not> (\<not> deleted (O_proc p) s \<and> p \<in> init_procs)"
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    48
using not_deleted_init_proc by auto
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    49
19
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    50
lemma has_same_inode_in_current:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    51
  "\<lbrakk>has_same_inode s f f'; valid s\<rbrakk> \<Longrightarrow> f \<in> current_files s \<and> f' \<in> current_files s"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    52
by (auto simp add:has_same_inode_def current_files_def)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    53
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    54
lemma has_same_inode_prop1:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    55
  "\<lbrakk>has_same_inode s f f'; is_file s f; valid s\<rbrakk> \<Longrightarrow> is_file s f'"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    56
by (auto simp:has_same_inode_def is_file_def)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    57
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    58
lemma has_same_inode_prop1':
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    59
  "\<lbrakk>has_same_inode s f f'; is_file s f'; valid s\<rbrakk> \<Longrightarrow> is_file s f"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    60
by (auto simp:has_same_inode_def is_file_def)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    61
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    62
lemma has_same_inode_prop2:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    63
  "\<lbrakk>has_same_inode s f f'; file_of_proc_fd s p fd = Some f; valid s\<rbrakk> \<Longrightarrow> is_file s f'"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    64
apply (drule has_same_inode_prop1)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    65
apply (simp add:file_of_pfd_is_file, simp+)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    66
done
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    67
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    68
lemma has_same_inode_prop2':
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    69
  "\<lbrakk>has_same_inode s f f'; file_of_proc_fd s p fd = Some f'; valid s\<rbrakk> \<Longrightarrow> is_file s f"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    70
apply (drule has_same_inode_prop1')
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    71
apply (simp add:file_of_pfd_is_file, simp+)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    72
done
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    73
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    74
lemma tobj_in_init_alive:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    75
  "tobj_in_init obj \<Longrightarrow> init_alive obj"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    76
by (case_tac obj, auto)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    77
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    78
lemma tobj_in_alive:
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    79
  "tobj_in_init obj \<Longrightarrow> alive [] obj"
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    80
by (case_tac obj, auto simp:is_file_nil)
ced0fcfbcf8e reprove the top-level dynamic2static
chunhan
parents: 18
diff changeset
    81
18
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    82
end
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    83
9b42765ce554 info_flow did NOT guarantee in current_procs
chunhan
parents:
diff changeset
    84
end