Co2sobj_prop.thy
author chunhan
Fri, 03 May 2013 08:20:21 +0100
changeset 1 7d9c0ed02b56
child 3 b6ee5f35c41f
permissions -rw-r--r--
thy files
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     1
(*<*)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     2
theory Co2sobj_prop
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     3
imports Main Flask Flask_type Static Static_type Sectxt_prop Init_prop Current_files_prop Current_sockets_prop
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     4
begin
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     5
(*<*)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     6
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     7
context tainting_s begin
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     8
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
     9
(************ simpset for cf2sfile ***************)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    10
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    11
declare get_parentfs_ctxts.simps [simp del]
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    12
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    13
lemma cf2sfile_open_none:
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    14
  "valid (Open p f flag fd None # s) \<Longrightarrow> cf2sfile (Open p f flag fd None # s) f b = cf2sfile s f b"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    15
apply (frule vd_cons, frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    16
apply (frule noroot_events)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    17
by (auto split:if_splits option.splits    dest!:current_has_sec'
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    18
          simp:cf2sfile_def is_file_simps is_dir_simps current_files_simps sectxt_of_obj_simps 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    19
               get_parentfs_ctxts_simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    20
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    21
lemma cf2sfile_open_some1:
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    22
  "\<lbrakk>valid (Open p f flag fd (Some inum) # s); f' \<in> current_files s\<rbrakk>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    23
   \<Longrightarrow> cf2sfile (Open p f flag fd (Some inum) # s) f' = cf2sfile s f'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    24
apply (frule vd_cons, frule vt_grant_os, frule noroot_events, rule ext)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    25
apply (induct f')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    26
apply (auto  split:if_splits option.splits    dest!:current_has_sec'
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    27
          simp:cf2sfile_def is_file_simps is_dir_simps current_files_simps sectxt_of_obj_simps 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    28
               get_parentfs_ctxts_simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    29
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    30
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    31
lemma cf2sfile_open_some2:
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    32
  "\<lbrakk>valid (Open p f flag fd (Some inum) # s); is_file s f'\<rbrakk>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    33
   \<Longrightarrow> cf2sfile (Open p f flag fd (Some inum) # s) f' True = cf2sfile s f' True"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    34
apply (frule vd_cons, drule is_file_in_current)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    35
by (simp add:cf2sfile_open_some1)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    36
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    37
lemma cf2sfile_open_some3:
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    38
  "\<lbrakk>valid (Open p f flag fd (Some inum) # s); is_dir s f'\<rbrakk>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    39
   \<Longrightarrow> cf2sfile (Open p f flag fd (Some inum) # s) f' False = cf2sfile s f' False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    40
apply (frule vd_cons, drule is_dir_in_current)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    41
by (simp add:cf2sfile_open_some1)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    42
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    43
lemma cf2sfile_open_some:
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    44
  "valid (Open p f flag fd (Some inum) # s) \<Longrightarrow> cf2sfile (Open p f flag fd (Some inum) # s) f True = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    45
     case (parent f) of
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    46
       Some pf \<Rightarrow> (case (sectxt_of_obj (Open p f flag fd (Some inum) # s) (O_file f), sectxt_of_obj s (O_dir pf), 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    47
                         get_parentfs_ctxts s pf) of
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    48
                    (Some sec, Some psec, Some asecs) \<Rightarrow> Some (Created, sec, Some psec, set asecs)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    49
                  | _ \<Rightarrow> None)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    50
     | None \<Rightarrow> None)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    51
apply (frule vd_cons, frule vt_grant_os, frule noroot_events)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    52
apply (auto split:if_splits option.splits    dest!:current_has_sec'
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    53
          simp:cf2sfile_def is_file_simps is_dir_simps current_files_simps sectxt_of_obj_simps 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    54
               get_parentfs_ctxts_simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    55
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    56
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    57
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    58
lemma cf2sfile_open:
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    59
  "valid (Open p f flag fd opt # s) \<Longrightarrow> cf2sfile (Open p f flag fd opt # s) = (\<lambda> f' b. 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    60
     if (opt = None) then cf2sfile s f' b
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    61
     else if (f' = f \<and> b = True) 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    62
     then (case (parent f) of
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    63
             Some pf \<Rightarrow> (case (sectxt_of_obj s (O_file f), sectxt_of_obj s (O_dir pf), 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    64
                 get_parentfs_ctxts s pf) of
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    65
                          (Some sec, Some psec, Some asecs) \<Rightarrow>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    66
                              Some (if (\<not> deleted (O_file f) s \<and> f \<in> init_files) 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    67
                                    then Init f else Created, sec, Some psec, set asecs)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    68
                        | _ \<Rightarrow> None)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    69
           | None \<Rightarrow> None)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    70
     else cf2sfile s f' b)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    71
apply (frule vd_cons, frule vt_grant_os, rule ext, rule ext)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    72
apply (auto split:if_splits option.splits 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    73
             simp:sectxt_of_obj_simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    74
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    75
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    76
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    77
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    78
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    79
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    80
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    81
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    82
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    83
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    84
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    85
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    86
lemma cf2sfile_keep_path: "\<lbrakk>f \<preceq> f'; \<tau> \<in> vt rc_cs\<rbrakk> \<Longrightarrow> cf2sfile \<tau> f \<preceq> cf2sfile \<tau> f'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    87
apply (induct f', simp add:no_junior_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    88
apply (case_tac "f = a # f'", simp add:cf2sfile.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    89
apply (drule no_junior_noteq, simp, simp add:cf2sfile.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    90
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    91
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    92
lemma ckp'_aux: "\<not> f \<preceq> a # f' \<Longrightarrow> \<not> f \<preceq> f'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    93
by (auto simp:no_junior_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    94
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    95
lemma cf2sfile_keep_path': "\<lbrakk>\<not> f \<preceq> f'; \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>; f' \<in> current_files \<tau>\<rbrakk> \<Longrightarrow> \<not> cf2sfile \<tau> f \<preceq> cf2sfile \<tau> f'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    96
apply (induct f', simp add:no_junior_def cf2sfile.simps, rule notI, drule cf2sfile_root_file, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    97
apply (case_tac "f = a # f'", simp add:cf2sfile.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    98
apply (rule notI)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
    99
apply (frule ckp'_aux, simp, frule parentf_in_current', simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   100
apply (case_tac "cf2sfile \<tau> f = cf2sfile \<tau> (a # f')", drule cf2sfile_inj, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   101
apply (simp add:cf2sfile.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   102
by (drule no_junior_noteq, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   103
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   104
lemma cf2sfile_keep_path'': "\<lbrakk>cf2sfile \<tau> f \<preceq> cf2sfile \<tau> f'; \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>; f' \<in> current_files \<tau>\<rbrakk> \<Longrightarrow> f \<preceq> f'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   105
using cf2sfile_keep_path'
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   106
by (auto)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   107
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   108
lemma cf2sfile_open_some': "\<lbrakk>f \<in> current_files \<tau>; Open p f' flags fd (Some inum) # \<tau> \<in> vt rc_cs\<rbrakk> \<Longrightarrow> cf2sfile (Open p f' flags fd (Some inum) # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   109
apply (frule vt_cons')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   110
apply (drule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   111
apply (induct f)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   112
apply (simp add:cf2sfile.simps)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   113
apply (frule parentf_in_current', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   114
apply (auto simp:os_grant.simps index_of_file.simps split:option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   115
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   116
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   117
lemma cf2sfile_open_some: "\<lbrakk>Open p f flags fd (Some inum) # \<tau> \<in> vt rc_cs; parent f = Some pf\<rbrakk> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   118
                           \<Longrightarrow> cf2sfile (Open p f flags fd (Some inum) # \<tau>) f = (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf))"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   119
apply (case_tac f, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   120
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   121
apply (simp add:cf2sfile.simps os_grant.simps current_files_simps index_of_file.simps cf2sfile_open_some')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   122
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   123
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   124
lemma cf2sfile_open_none: "cf2sfile (Open p f flags fd None # \<tau>) f' = cf2sfile \<tau> f'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   125
apply (induct f')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   126
by (simp add:cf2sfile.simps index_of_file.simps split:option.splits nat.splits)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   127
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   128
lemma cf2sfile_open: "\<lbrakk>Open p f flags fd opt # \<tau> \<in> vt rc_cs; f' \<in> current_files (Open p f flags fd opt # \<tau>)\<rbrakk> \<Longrightarrow> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   129
                       cf2sfile (Open p f flags fd opt # \<tau>) f' = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   130
                         if (opt = None) then cf2sfile \<tau> f'
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   131
                         else if (f' = f) then (case (parent f) of
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   132
                                                  Some pf \<Rightarrow> (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf))
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   133
                                                | _       \<Rightarrow> [])
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   134
                              else cf2sfile \<tau> f'                                                          )"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   135
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   136
by (auto simp:os_grant.simps current_files_simps intro:cf2sfile_open_none cf2sfile_open_some cf2sfile_open_some' split:if_splits option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   137
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   138
lemma cf2sfile_mkdir_some': "\<lbrakk>Mkdir p f' inum # \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>\<rbrakk> \<Longrightarrow> cf2sfile (Mkdir p f' inum # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   139
apply (frule vt_cons', drule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   140
apply (induct f, (simp add:cf2sfile.simps)+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   141
apply (frule parentf_in_current', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   142
apply (auto simp:os_grant.simps index_of_file.simps split:option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   143
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   144
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   145
lemma cf2sfile_mkdir_some: "\<lbrakk>Mkdir p f inum # \<tau> \<in> vt rc_cs; parent f = Some pf\<rbrakk>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   146
                             \<Longrightarrow> cf2sfile (Mkdir p f inum # \<tau>) f = (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf))"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   147
apply (case_tac f, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   148
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   149
apply (simp add:cf2sfile.simps os_grant.simps current_files_simps index_of_file.simps cf2sfile_mkdir_some')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   150
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   151
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   152
lemma cf2sfile_mkdir: "\<lbrakk>Mkdir p f inum # \<tau> \<in> vt rc_cs; f' \<in> current_files (Mkdir p f inum # \<tau>)\<rbrakk> \<Longrightarrow>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   153
                        cf2sfile (Mkdir p f inum # \<tau>) f' = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   154
                          if (f' = f) then (case (parent f) of
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   155
                                              Some pf \<Rightarrow> (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf))
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   156
                                            | _       \<Rightarrow> [])
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   157
                          else cf2sfile \<tau> f'               ) "
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   158
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   159
by (auto simp:os_grant.simps current_files_simps intro:cf2sfile_mkdir_some cf2sfile_mkdir_some' split:if_splits option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   160
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   161
lemma cf2sfile_linkhard_none: "\<lbrakk>LinkHard p f\<^isub>1 f\<^isub>2 # \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>\<rbrakk> \<Longrightarrow> cf2sfile (LinkHard p f\<^isub>1 f\<^isub>2 # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   162
apply (frule vt_cons')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   163
apply (drule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   164
apply (induct f)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   165
apply (simp add:cf2sfile.simps)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   166
apply (frule parentf_in_current', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   167
apply (auto simp:os_grant.simps index_of_file.simps split:option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   168
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   169
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   170
lemma cf2sfile_linkhard_some: 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   171
  "\<lbrakk>LinkHard p f\<^isub>1 f\<^isub>2 # \<tau> \<in> vt rc_cs; parent f\<^isub>2 = Some pf\<^isub>2\<rbrakk> \<Longrightarrow> cf2sfile (LinkHard p f\<^isub>1 f\<^isub>2 # \<tau>) f\<^isub>2 = (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>2))"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   172
apply (case_tac f\<^isub>2, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   173
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   174
apply (simp add:cf2sfile.simps os_grant.simps current_files_simps index_of_file.simps cf2sfile_linkhard_none)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   175
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   176
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   177
lemma cf2sfile_linkhard: "\<lbrakk>LinkHard p f\<^isub>1 f\<^isub>2 # \<tau> \<in> vt rc_cs; f \<in> current_files (LinkHard p f\<^isub>1 f\<^isub>2 # \<tau>)\<rbrakk> \<Longrightarrow>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   178
                           cf2sfile (LinkHard p f\<^isub>1 f\<^isub>2 # \<tau>) f = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   179
                             if (f = f\<^isub>2) then (case (parent f\<^isub>2) of
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   180
                                                 Some pf\<^isub>2 \<Rightarrow> SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>2)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   181
                                               | _        \<Rightarrow> [])
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   182
                             else cf2sfile \<tau> f                 )"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   183
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   184
by (auto simp:os_grant.simps current_files_simps intro:cf2sfile_linkhard_none cf2sfile_linkhard_some split:if_splits option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   185
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   186
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   187
lemma no_junior_aux: "\<not> f\<^isub>2 \<preceq> a # f \<Longrightarrow> \<not> f\<^isub>2 \<preceq> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   188
by (auto simp:no_junior_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   189
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   190
lemma cf2sfile_rename_aux: "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>\<rbrakk> \<Longrightarrow> f \<noteq> f\<^isub>3 \<and> \<not> f\<^isub>3 \<preceq> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   191
apply (frule vt_grant_os, simp add:os_grant.simps, (erule exE|erule conjE)+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   192
apply (rule conjI, rule notI, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   193
apply (rule notI, drule vt_cons', simp add:ancenf_in_current)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   194
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   195
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   196
lemma cf2sfile_rename'1: 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   197
  "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>; \<not> (f\<^isub>2 \<preceq> f)\<rbrakk> \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   198
apply (frule vt_cons',frule vt_grant_os,  induct f)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   199
apply (simp add:cf2sfile.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   200
apply (frule parentf_in_current', simp, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   201
apply (frule no_junior_aux, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   202
apply (simp add:os_grant.simps, (erule exE|erule conjE)+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   203
apply (drule cf2sfile_rename_aux, simp, erule conjE)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   204
apply (auto simp add:cf2sfile.simps index_of_file.simps split:option.splits nat.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   205
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   206
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   207
lemma cf2sfile_rename'2: 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   208
  "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; \<not> (f\<^isub>3 \<preceq> f)\<rbrakk> \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   209
apply (frule vt_cons', induct f)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   210
by (auto simp add:index_of_file.simps cf2sfile.simps no_junior_def split:option.splits nat.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   211
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   212
lemma cf2sfile_rename1:
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   213
  "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; parent f\<^isub>3 = Some pf\<^isub>3\<rbrakk> \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) f\<^isub>3 = SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   214
apply (case_tac f\<^isub>3, simp add:cf2sfile.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   215
apply (auto dest!:cf2sfile_rename'2 simp add:no_junior_def cf2sfile.simps index_of_file.simps split:option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   216
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   217
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   218
lemma index_of_file_rename1: "\<lbrakk>f\<^isub>2 \<preceq> f; f \<noteq> f\<^isub>2\<rbrakk> \<Longrightarrow> index_of_file (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) (file_after_rename f\<^isub>2 f\<^isub>3 f) = index_of_file \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   219
apply (clarsimp simp add:index_of_file.simps split:option.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   220
by (frule_tac f\<^isub>3 = f\<^isub>3 in file_renaming_prop3, simp, erule conjE, simp add:file_renaming_prop5)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   221
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   222
lemma cf2sfile_rename2: "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; (file_before_rename f\<^isub>2 f\<^isub>3 f) \<in> current_files \<tau>; parent f\<^isub>3 = Some pf\<^isub>3; f\<^isub>3 \<preceq> f\<rbrakk> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   223
   \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) f = file_after_rename (cf2sfile \<tau> f\<^isub>2) (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)) (cf2sfile \<tau> (file_before_rename f\<^isub>2 f\<^isub>3 f))"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   224
apply (induct f, simp add:no_junior_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   225
apply (case_tac "a # f = f\<^isub>3", simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   226
apply (drule cf2sfile_rename1, simp, simp add:file_renaming_prop0' file_renaming_prop0)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   227
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   228
apply (frule no_junior_noteq, simp, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   229
apply (frule_tac file_renaming_prop1')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   230
apply (frule_tac f = f\<^isub>2 and \<tau> = \<tau> in cf2sfile_keep_path, simp add:vt_cons')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   231
apply (frule_tac f\<^isub>2 = f\<^isub>2 and a = a in file_renaming_prop8')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   232
apply (frule_tac f\<^isub>2 = f\<^isub>2 and a = a in file_renaming_prop6')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   233
apply (frule_tac f = "file_before_rename f\<^isub>2 f\<^isub>3 (a # f)" and \<tau> = \<tau> and f\<^isub>2 = f\<^isub>2 and f\<^isub>3 = f\<^isub>3 and p = p in index_of_file_rename1, simp add:file_before_rename_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   234
apply (drule_tac f\<^isub>3 = f\<^isub>3 and f\<^isub>1 = f and a = a and f\<^isub>2 = f\<^isub>2 in file_renaming_prop9', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   235
apply (drule parentf_in_current', simp add:vt_cons')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   236
apply (simp add:cf2sfile.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   237
apply (erule file_renaming_prop6[THEN sym])
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   238
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   239
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   240
lemma cf2sfile_rename2': "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>; parent f\<^isub>3 = Some pf\<^isub>3; f\<^isub>2 \<preceq> f\<rbrakk> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   241
   \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) (file_after_rename f\<^isub>2 f\<^isub>3 f) = file_after_rename (cf2sfile \<tau> f\<^isub>2) (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)) (cf2sfile \<tau> f)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   242
apply (frule_tac f\<^isub>3 = f\<^isub>3 in file_renaming_prop5)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   243
apply (frule_tac f\<^isub>3 = f\<^isub>3 in file_renaming_prop1)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   244
apply (drule_tac f = "file_after_rename f\<^isub>2 f\<^isub>3 f" in cf2sfile_rename2, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   245
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   246
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   247
lemma cf2sfile_rename3: "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; f \<in> current_files \<tau>; parent f\<^isub>3 = Some pf\<^isub>3\<rbrakk> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   248
   \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) (file_after_rename f\<^isub>2 f\<^isub>3 f) = file_after_rename (cf2sfile \<tau> f\<^isub>2) (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)) (cf2sfile \<tau> f)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   249
apply (case_tac "f\<^isub>2 \<preceq> f")
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   250
apply (rule cf2sfile_rename2', simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   251
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   252
apply (frule_tac \<tau> = \<tau> in cf2sfile_keep_path', simp add:vt_cons', simp add:os_grant.simps, simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   253
apply (simp add:file_after_rename_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   254
by (rule cf2sfile_rename'1, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   255
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   256
lemma cf2sfile_rename: "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; f \<in> current_files (Rename p f\<^isub>2 f\<^isub>3 # \<tau>)\<rbrakk> \<Longrightarrow>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   257
                         cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) f = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   258
                           if (f\<^isub>3 \<preceq> f) then (case (parent f\<^isub>3) of 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   259
                                               Some pf\<^isub>3 \<Rightarrow> file_after_rename (cf2sfile \<tau> f\<^isub>2) (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)) (cf2sfile \<tau> (file_before_rename f\<^isub>2 f\<^isub>3 f))
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   260
                                             | _        \<Rightarrow> [])
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   261
                           else cf2sfile \<tau> f               )"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   262
apply (frule vt_grant_os)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   263
apply (case_tac "f = f\<^isub>3", clarsimp simp:os_grant.simps, drule cf2sfile_rename1, simp+, simp add:file_renaming_prop0' file_renaming_prop0)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   264
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   265
apply (auto simp:os_grant.simps current_files_simps intro:cf2sfile_rename'2 cf2sfile_rename1 split:if_splits option.splits) 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   266
apply (rule cf2sfile_rename2, simp, drule rename_renaming_decom, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   267
apply (drule_tac f\<^isub>2 = f\<^isub>2 and f\<^isub>1 = f\<^isub>1 and f\<^isub>3 = f\<^isub>3 in file_renaming_prop5, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   268
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   269
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   270
lemma cf2sfile_other: "\<lbrakk>
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   271
                        \<forall> p f flags fd opt. e \<noteq> Open p f flags fd opt;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   272
                        \<forall> p f im. e \<noteq> Mkdir p f im;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   273
                        \<forall> p f\<^isub>1 f\<^isub>2. e \<noteq> LinkHard p f\<^isub>1 f\<^isub>2;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   274
                        \<forall> p f\<^isub>2 f\<^isub>3. e \<noteq> Rename p f\<^isub>2 f\<^isub>3\<rbrakk> \<Longrightarrow> cf2sfile (e # \<tau>) f' = cf2sfile \<tau> f'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   275
apply (induct f', simp add:cf2sfile.simps index_of_file.simps split:option.splits nat.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   276
apply (case_tac e, auto simp add:cf2sfile.simps index_of_file.simps split:option.splits nat.splits)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   277
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   278
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   279
lemmas cf2sfile_nil = init_cf2sfile
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   280
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   281
lemma cf2sfile_nil': "f \<in> current_files [] \<Longrightarrow> cf2sfile [] f = map SInit f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   282
by (simp add:cf2sfile_nil current_files_simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   283
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   284
lemmas cf2sfile_simps = cf2sfile_nil cf2sfile_nil' cf2sfile_open cf2sfile_mkdir cf2sfile_linkhard cf2sfile_rename cf2sfile_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   285
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   286
lemmas cf2sfile_simpss = cf2sfile_nil cf2sfile_nil' cf2sfile_open_some' cf2sfile_open_some cf2sfile_open_none cf2sfile_open cf2sfile_mkdir_some' cf2sfile_mkdir_some
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   287
                         cf2sfile_mkdir cf2sfile_linkhard_none cf2sfile_linkhard_some cf2sfile_linkhard cf2sfile_rename'1 cf2sfile_rename'2 cf2sfile_rename1
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   288
                         cf2sfile_rename2 cf2sfile_rename2' cf2sfile_rename3 cf2sfile_rename cf2sfile_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   289
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   290
lemma cf2sfile_open_some'_inum: "\<lbrakk>Open p f' flags fd (Some inum) # \<tau> \<in> vt rc_cs; inum_of_file \<tau> f = Some im\<rbrakk> \<Longrightarrow> cf2sfile (Open p f' flags fd (Some inum) # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   291
by (simp add:cf2sfile_open_some' current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   292
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   293
lemma cf2sfile_mkdir_some'_inum: "\<lbrakk>Mkdir p f' inum # \<tau> \<in> vt rc_cs; inum_of_file \<tau> f = Some im\<rbrakk> \<Longrightarrow> cf2sfile (Mkdir p f' inum # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   294
by (simp add:cf2sfile_mkdir_some' current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   295
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   296
lemma cf2sfile_linkhard_none_inum: "\<lbrakk>LinkHard p f\<^isub>1 f\<^isub>2 # \<tau> \<in> vt rc_cs; inum_of_file \<tau> f = Some im\<rbrakk> \<Longrightarrow> cf2sfile (LinkHard p f\<^isub>1 f\<^isub>2 # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   297
by (simp add:cf2sfile_linkhard_none current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   298
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   299
lemma cf2sfile_rename'1_inum: 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   300
  "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; inum_of_file \<tau> f = Some im ; \<not> (f\<^isub>2 \<preceq> f)\<rbrakk> \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) f = cf2sfile \<tau> f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   301
by (simp add:cf2sfile_rename'1 current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   302
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   303
lemma cf2sfile_rename2_inum: "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; inum_of_file \<tau> (file_before_rename f\<^isub>2 f\<^isub>3 f) = Some im; parent f\<^isub>3 = Some pf\<^isub>3; f\<^isub>3 \<preceq> f\<rbrakk> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   304
   \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) f = file_after_rename (cf2sfile \<tau> f\<^isub>2) (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)) (cf2sfile \<tau> (file_before_rename f\<^isub>2 f\<^isub>3 f))"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   305
by (simp add:cf2sfile_rename2 current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   306
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   307
lemma cf2sfile_rename2'_inum: "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; inum_of_file \<tau> f = Some im; parent f\<^isub>3 = Some pf\<^isub>3; f\<^isub>2 \<preceq> f\<rbrakk> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   308
   \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) (file_after_rename f\<^isub>2 f\<^isub>3 f) = file_after_rename (cf2sfile \<tau> f\<^isub>2) (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)) (cf2sfile \<tau> f)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   309
by (simp add:cf2sfile_rename2' current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   310
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   311
lemma cf2sfile_rename3_inum: "\<lbrakk>Rename p f\<^isub>2 f\<^isub>3 # \<tau> \<in> vt rc_cs; inum_of_file \<tau> f = Some im; parent f\<^isub>3 = Some pf\<^isub>3\<rbrakk> 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   312
   \<Longrightarrow> cf2sfile (Rename p f\<^isub>2 f\<^isub>3 # \<tau>) (file_after_rename f\<^isub>2 f\<^isub>3 f) = file_after_rename (cf2sfile \<tau> f\<^isub>2) (SCrea (Suc (length \<tau>)) # (cf2sfile \<tau> pf\<^isub>3)) (cf2sfile \<tau> f)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   313
by (simp add:cf2sfile_rename3 current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   314
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   315
lemma cf2sfile_nil'_inum: "inum_of_file [] f = Some im \<Longrightarrow> cf2sfile [] f = map SInit f"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   316
by (simp add:cf2sfile_nil' current_files_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   317
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   318
lemmas cf2sfile_simps_inum = cf2sfile_nil cf2sfile_nil'_inum cf2sfile_open_some'_inum cf2sfile_open_some cf2sfile_open_none cf2sfile_open cf2sfile_mkdir_some'_inum cf2sfile_mkdir_some
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   319
                         cf2sfile_mkdir cf2sfile_linkhard_none_inum cf2sfile_linkhard_some cf2sfile_linkhard cf2sfile_rename'1_inum cf2sfile_rename'2 cf2sfile_rename1
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   320
                         cf2sfile_rename2_inum cf2sfile_rename2'_inum cf2sfile_rename3_inum cf2sfile_rename cf2sfile_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   321
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   322
(*************** cp2sproc simpset *********************)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   323
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   324
lemma cp2sproc_nil: "p \<in> init_processes \<Longrightarrow> cp2sproc [] p = SInit p"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   325
by (simp add:cp2sproc_def index_of_proc.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   326
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   327
lemma cp2sproc_nil': "p \<in> current_procs [] \<Longrightarrow> cp2sproc [] p = SInit p"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   328
by (simp add:cp2sproc_nil current_procs.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   329
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   330
lemma cp2sproc_clone: "cp2sproc (Clone p p' # \<tau>) p'' = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   331
                         if (p'' = p') then SCrea (Suc (length \<tau>))
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   332
                         else cp2sproc \<tau> p''           )"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   333
by (auto simp:cp2sproc_def index_of_proc.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   334
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   335
lemma cp2sproc_other: "\<forall> p p'. e \<noteq> Clone p p' \<Longrightarrow> cp2sproc (e # \<tau>) p'' = cp2sproc \<tau> p''"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   336
apply (case_tac e)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   337
by (auto simp:cp2sproc_def index_of_proc.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   338
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   339
lemmas cp2sproc_simps = cp2sproc_nil cp2sproc_nil' cp2sproc_clone cp2sproc_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   340
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   341
(******************** ch2sshm simpset **************************)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   342
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   343
lemma ch2sshm_nil: "h \<in> init_shms \<Longrightarrow> ch2sshm [] h = SInit h"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   344
by (simp add:ch2sshm_def index_of_shm.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   345
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   346
lemma ch2sshm_nil': "h \<in> current_shms [] \<Longrightarrow> ch2sshm [] h = SInit h"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   347
by (simp add:ch2sshm_nil current_shms.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   348
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   349
lemma ch2sshm_createshm: "ch2sshm (CreateShM p h # \<tau>) h' = (if (h' = h) then SCrea (Suc (length \<tau>)) else ch2sshm \<tau> h')"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   350
by (simp add:ch2sshm_def index_of_shm.simps d2s_aux.simps) 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   351
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   352
lemma ch2sshm_other: "\<forall> p h. e \<noteq> CreateShM p h \<Longrightarrow> ch2sshm (e # \<tau>) h' = ch2sshm \<tau> h'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   353
apply (case_tac e)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   354
by (auto simp add:ch2sshm_def index_of_shm.simps d2s_aux.simps) 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   355
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   356
lemmas ch2sshm_simps = ch2sshm_nil ch2sshm_nil' ch2sshm_createshm ch2sshm_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   357
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   358
(********************* cm2smsg simpset ***********************)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   359
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   360
lemma cm2smsg_nil: "m \<in> init_msgs \<Longrightarrow> cm2smsg [] m = SInit m"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   361
by (simp add:cm2smsg_def index_of_msg.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   362
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   363
lemma cm2smsg_nil': "m \<in> current_msgs [] \<Longrightarrow> cm2smsg [] m = SInit m"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   364
by (simp add:cm2smsg_nil current_msgs.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   365
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   366
lemma cm2smsg_createmsg: "cm2smsg (CreateMsg p m # \<tau>) m' = (if (m' = m) then SCrea (Suc (length \<tau>)) else cm2smsg \<tau> m')"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   367
by (simp add:cm2smsg_def index_of_msg.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   368
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   369
lemma cm2smsg_other: "\<forall> p m. e \<noteq> CreateMsg p m \<Longrightarrow> cm2smsg (e # \<tau>) m' = cm2smsg \<tau> m'"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   370
apply (case_tac e)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   371
by (auto simp:cm2smsg_def index_of_msg.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   372
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   373
lemmas cm2smsg_simps = cm2smsg_nil cm2smsg_nil' cm2smsg_createmsg cm2smsg_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   374
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   375
(********************** cfd2fd_s simpset ******************************)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   376
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   377
lemma cfd2fd_s_nil: "fd \<in> init_fds_of_proc p \<Longrightarrow> cfd2fd_s [] p fd = SInit fd"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   378
by (simp add:cfd2fd_s_def index_of_fd.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   379
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   380
lemma cfd2fd_s_nil': "fd \<in> current_proc_fds [] p \<Longrightarrow> cfd2fd_s [] p fd = SInit fd"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   381
by (simp add:cfd2fd_s_nil current_proc_fds.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   382
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   383
lemma cfd2fd_s_open: "cfd2fd_s (Open p f flags fd opt # \<tau>) p' fd' = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   384
                        if (p = p') then (if (fd = fd') then SCrea (Suc (length \<tau>)) 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   385
                                          else cfd2fd_s \<tau> p' fd')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   386
                        else cfd2fd_s \<tau> p' fd'                      )"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   387
by (simp add:cfd2fd_s_def index_of_fd.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   388
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   389
lemma cfd2fd_s_createsock: "cfd2fd_s (CreateSock p af st fd im # \<tau>) p' fd' = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   390
                              if (p = p') then (if (fd = fd') then SCrea (Suc (length \<tau>)) 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   391
                                          else cfd2fd_s \<tau> p' fd')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   392
                              else cfd2fd_s \<tau> p' fd'                         )"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   393
by (simp add:cfd2fd_s_def index_of_fd.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   394
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   395
lemma cfd2fd_s_accept: "cfd2fd_s (Accept p fd addr port fd' im # \<tau>) p' fd'' = (
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   396
                          if (p' = p) then (if (fd'' = fd') then SCrea (Suc (length \<tau>))
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   397
                                            else cfd2fd_s \<tau> p' fd'')
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   398
                          else cfd2fd_s \<tau> p' fd''                             )"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   399
by (simp add:cfd2fd_s_def index_of_fd.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   400
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   401
lemma cfd2fd_s_clone: "cfd2fd_s (Clone p p' # \<tau>) p'' fd = (if (p'' = p') then cfd2fd_s \<tau> p fd else cfd2fd_s \<tau> p'' fd)"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   402
by (simp add:cfd2fd_s_def index_of_fd.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   403
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   404
lemma cfd2fd_s_other: "\<lbrakk>\<forall> p f flags fd opt. e \<noteq> Open p f flags fd opt;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   405
                        \<forall> p af st fd im. e \<noteq> CreateSock p af st fd im;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   406
                        \<forall> p fd addr port fd' im. e \<noteq> Accept p fd addr port fd' im;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   407
                        \<forall> p p'. e \<noteq> Clone p p'\<rbrakk> \<Longrightarrow> cfd2fd_s (e # \<tau>) p'' fd'' = cfd2fd_s \<tau> p'' fd''"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   408
by (case_tac e, auto simp:cfd2fd_s_def index_of_fd.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   409
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   410
lemmas cfd2fd_s_simps = cfd2fd_s_nil cfd2fd_s_nil' cfd2fd_s_open cfd2fd_s_createsock cfd2fd_s_accept cfd2fd_s_clone cfd2fd_s_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   411
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   412
(************* cim2im_s simpset **************************)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   413
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   414
(* no such lemma
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   415
lemma cim2im_s_nil: "init_itag_of_inum im = Some tag \<Longrightarrow> cim2im_s [] im = SInit im"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   416
by (simp add:cim2im_s_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   417
*)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   418
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   419
lemma cim2im_s_open: "cim2im_s (Open p f flags fd (Some im) # \<tau>) im' = (if (im' = im) then SCrea (Suc (length \<tau>)) else cim2im_s \<tau> im')"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   420
by (simp add:cim2im_s_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   421
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   422
lemma cim2im_s_open': "cim2im_s (Open p f flags fd None # \<tau>) im = cim2im_s \<tau> im"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   423
by (simp add:cim2im_s_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   424
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   425
lemma cim2im_s_mkdir: "cim2im_s (Mkdir p f im # \<tau>) im' = (if (im' = im) then SCrea (Suc (length \<tau>)) else cim2im_s \<tau> im')"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   426
by (simp add:cim2im_s_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   427
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   428
lemma cim2im_s_createsock: "cim2im_s (CreateSock p sf st fd im # \<tau>) im' = (if (im' = im) then SCrea (Suc (length \<tau>)) else cim2im_s \<tau> im')"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   429
by (simp add:cim2im_s_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   430
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   431
lemma cim2im_s_accept: "cim2im_s (Accept p fd addr port fd' im # \<tau>) im' = (if (im' = im) then SCrea (Suc (length \<tau>)) else cim2im_s \<tau> im')"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   432
by (simp add:cim2im_s_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   433
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   434
lemma cim2im_s_other: "\<lbrakk>\<forall> p f flags fd opt. e \<noteq> Open p f flags fd opt;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   435
                        \<forall> p f im. e \<noteq> Mkdir p f im;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   436
                        \<forall> p sf st fd im. e \<noteq> CreateSock p sf st fd im;
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   437
                        \<forall> p fd addr port fd' im. e \<noteq> Accept p fd addr port fd' im\<rbrakk> \<Longrightarrow> cim2im_s (e # \<tau>) im = cim2im_s \<tau> im"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   438
by (case_tac e, auto simp:cim2im_s_def)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   439
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   440
lemmas cim2im_s_simps = cim2im_s_open cim2im_s_open' cim2im_s_mkdir cim2im_s_createsock cim2im_s_accept cim2im_s_other
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   441
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   442
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   443
lemma cig2ig_s_simp: "cig2ig_s (e # \<tau>) tag = cig2ig_s \<tau> tag"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   444
apply (case_tac tag)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   445
by auto
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   446
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   447
(******************* cobj2sobj no Suc (length \<tau>) ***********************)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   448
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   449
lemma cf2sfile_le_len: "\<lbrakk>cf2sfile \<tau> f = SCrea (Suc (length \<tau>)) # spf; f \<in> current_files \<tau>; \<tau> \<in> vt rc_cs\<rbrakk> \<Longrightarrow> False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   450
apply (case_tac f, (simp add:cf2sfile.simps d2s_aux.simps)+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   451
apply (case_tac "index_of_file \<tau> (a # list)", (simp add:d2s_aux.simps)+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   452
by (drule index_of_file_le_length', simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   453
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   454
lemma cf2sfile_le_len': "\<lbrakk>SCrea (Suc (length \<tau>)) # spf \<preceq> cf2sfile \<tau> f; f \<in> current_files \<tau>; \<tau> \<in> vt rc_cs\<rbrakk> \<Longrightarrow> False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   455
apply (induct f)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   456
apply (simp add:no_junior_def cf2sfile.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   457
apply (case_tac "cf2sfile \<tau> (a # f) = SCrea (Suc (length \<tau>)) # spf") 
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   458
apply (drule_tac f = "a # f" in cf2sfile_le_len, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   459
apply (simp only:cf2sfile.simps d2s_aux.simps)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   460
apply (drule_tac no_junior_noteq, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   461
apply (rule impI, erule impE, simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   462
apply (drule parentf_in_current', simp+)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   463
done
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   464
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   465
lemma cp2sproc_le_len: "cp2sproc \<tau> p = SCrea (Suc (length \<tau>)) \<Longrightarrow> False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   466
apply (simp add:cp2sproc_def, case_tac "index_of_proc \<tau> p")
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   467
apply (simp add:d2s_aux.simps)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   468
by (drule index_of_proc_le_length', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   469
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   470
lemma ch2sshm_le_len: "ch2sshm \<tau> h = SCrea (Suc (length \<tau>)) \<Longrightarrow> False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   471
apply (simp add:ch2sshm_def, case_tac "index_of_shm \<tau> h")
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   472
apply (simp add:d2s_aux.simps)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   473
by (drule index_of_shm_le_length', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   474
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   475
lemma cm2smsg_le_len: "cm2smsg \<tau> m = SCrea (Suc (length \<tau>)) \<Longrightarrow> False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   476
apply (simp add:cm2smsg_def, case_tac "index_of_msg \<tau> m")
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   477
apply (simp add:d2s_aux.simps)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   478
by (drule index_of_msg_le_length', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   479
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   480
lemma cim2im_s_le_len: "cim2im_s \<tau> im = SCrea (Suc (length \<tau>)) \<Longrightarrow> False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   481
apply (simp add:cim2im_s_def, case_tac "inum2ind \<tau> im")
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   482
apply (simp add:d2s_aux.simps)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   483
by (drule inum2ind_le_length', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   484
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   485
lemma cfd2fd_s_le_len: "cfd2fd_s \<tau> p fd = SCrea (Suc (length \<tau>)) \<Longrightarrow> False"
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   486
apply (simp add:cfd2fd_s_def, case_tac "index_of_fd \<tau> p fd")
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   487
apply (simp add:d2s_aux.simps)+
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   488
by (drule index_of_fd_le_length', simp)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   489
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   490
end
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   491
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   492
(*<*)
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   493
end
7d9c0ed02b56 thy files
chunhan
parents:
diff changeset
   494
(*>*)