source_prop.thy
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Fri, 06 Sep 2013 13:27:46 +0100
changeset 14 d43f46423298
parent 6 4294abb1f38c
permissions -rw-r--r--
added reviews from CPP
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
dcde836219bc add thy files
chunhan
parents:
diff changeset
     1
theory source_prop
dcde836219bc add thy files
chunhan
parents:
diff changeset
     2
imports Main rc_theory os_rc deleted_prop obj2sobj_prop
dcde836219bc add thy files
chunhan
parents:
diff changeset
     3
begin
dcde836219bc add thy files
chunhan
parents:
diff changeset
     4
dcde836219bc add thy files
chunhan
parents:
diff changeset
     5
context tainting_s_complete begin
dcde836219bc add thy files
chunhan
parents:
diff changeset
     6
dcde836219bc add thy files
chunhan
parents:
diff changeset
     7
lemma all_sobjs_srp_init'[rule_format]:
dcde836219bc add thy files
chunhan
parents:
diff changeset
     8
  "sobj \<in> all_sobjs \<Longrightarrow> \<forall> sp srp. sobj = SProc sp (Some srp) \<longrightarrow> srp \<in> init_processes"
dcde836219bc add thy files
chunhan
parents:
diff changeset
     9
apply (erule all_sobjs.induct, auto) 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    10
using init_proc_has_type 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    11
by (simp add:bidirect_in_init_def)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    12
dcde836219bc add thy files
chunhan
parents:
diff changeset
    13
lemma all_sobjs_srp_init:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    14
  "SProc sp (Some srp) \<in> all_sobjs \<Longrightarrow> srp \<in> init_processes"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    15
by (auto dest!:all_sobjs_srp_init')
dcde836219bc add thy files
chunhan
parents:
diff changeset
    16
dcde836219bc add thy files
chunhan
parents:
diff changeset
    17
(*
dcde836219bc add thy files
chunhan
parents:
diff changeset
    18
lemma tainted_sproc_srp_init:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    19
  "SProc sp (Some srp) \<in> tainted_s \<Longrightarrow> srp \<in> init_processes"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    20
by (auto dest:tainted_s_in_all_sobjs intro:all_sobjs_srp_init) *)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    21
dcde836219bc add thy files
chunhan
parents:
diff changeset
    22
lemma source_proc_of_init_remains:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    23
  "\<lbrakk>p \<in> init_processes; \<not> deleted (Proc p) s; valid s\<rbrakk> \<Longrightarrow> source_proc s p = Some p"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    24
apply (induct s, simp)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    25
apply (frule valid_cons, frule valid_os, frule not_deleted_cons_D, simp)
6
4294abb1f38c update scripts with no new_* in admissable-check
chunhan
parents: 1
diff changeset
    26
apply (case_tac a, auto dest:not_deleted_imp_exists)
1
dcde836219bc add thy files
chunhan
parents:
diff changeset
    27
done
dcde836219bc add thy files
chunhan
parents:
diff changeset
    28
dcde836219bc add thy files
chunhan
parents:
diff changeset
    29
lemma init_proc_keeps_source:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    30
  "\<lbrakk>p \<in> init_processes; \<not> deleted (Proc p) s; valid s\<rbrakk> 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    31
   \<Longrightarrow> source_of_sobj (obj2sobj s (Proc p)) = Some (Proc p)"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    32
apply (frule not_deleted_imp_exists, simp, simp only:exists.simps)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    33
apply (frule current_proc_has_sproc, simp)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    34
apply (clarsimp split:option.splits simp:source_proc_of_init_remains)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    35
done
dcde836219bc add thy files
chunhan
parents:
diff changeset
    36
dcde836219bc add thy files
chunhan
parents:
diff changeset
    37
lemma init_file_keeps_source:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    38
  "\<lbrakk>f \<in> init_files; \<not> deleted (File f) s; valid s\<rbrakk> 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    39
   \<Longrightarrow> source_of_sobj (obj2sobj s (File f)) = Some (File f)"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    40
apply (frule not_deleted_imp_exists, simp, simp only:exists.simps)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    41
apply (frule current_file_has_sfile, auto)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    42
done
dcde836219bc add thy files
chunhan
parents:
diff changeset
    43
dcde836219bc add thy files
chunhan
parents:
diff changeset
    44
lemma init_ipc_keeps_source:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    45
  "\<lbrakk>i \<in> init_ipcs; \<not> deleted (IPC i) s; valid s\<rbrakk> 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    46
   \<Longrightarrow> source_of_sobj (obj2sobj s (IPC i)) = Some (IPC i)"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    47
apply (frule not_deleted_imp_exists, simp, simp only:exists.simps)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    48
apply (frule current_ipc_has_sipc, auto)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    49
done
dcde836219bc add thy files
chunhan
parents:
diff changeset
    50
 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    51
lemma init_obj_keeps_source: 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    52
  "\<lbrakk>exists [] obj; \<not> deleted obj s; valid s\<rbrakk> \<Longrightarrow> source_of_sobj (obj2sobj s obj) = Some obj"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    53
apply (case_tac obj)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    54
by (auto intro:init_ipc_keeps_source init_proc_keeps_source init_file_keeps_source 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    55
      simp del:obj2sobj.simps)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    56
dcde836219bc add thy files
chunhan
parents:
diff changeset
    57
end
dcde836219bc add thy files
chunhan
parents:
diff changeset
    58
dcde836219bc add thy files
chunhan
parents:
diff changeset
    59
context tainting_s_sound begin
dcde836219bc add thy files
chunhan
parents:
diff changeset
    60
dcde836219bc add thy files
chunhan
parents:
diff changeset
    61
lemma source_eq:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    62
  "\<lbrakk>source_of_sobj sobj = Some obj; sobj_source_eq_obj sobj obj'\<rbrakk> \<Longrightarrow> obj = obj'"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    63
apply (case_tac obj, case_tac [!] sobj, case_tac [!] obj')
dcde836219bc add thy files
chunhan
parents:
diff changeset
    64
by (auto split:option.splits)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    65
dcde836219bc add thy files
chunhan
parents:
diff changeset
    66
lemma proc_source_eq_prop:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    67
  "\<lbrakk>obj2sobj s (Proc p) = SProc sp srp; p \<in> current_procs s;
dcde836219bc add thy files
chunhan
parents:
diff changeset
    68
    sobj_source_eq_obj (SProc sp srp) (Proc p); valid s\<rbrakk>
dcde836219bc add thy files
chunhan
parents:
diff changeset
    69
  \<Longrightarrow> srp = Some p"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    70
apply (frule current_proc_has_srp,auto split:option.splits)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    71
by (case_tac "source_proc s p", simp+)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    72
dcde836219bc add thy files
chunhan
parents:
diff changeset
    73
end
dcde836219bc add thy files
chunhan
parents:
diff changeset
    74
dcde836219bc add thy files
chunhan
parents:
diff changeset
    75
end