tainted.thy
author Christian Urban <christian dot urban at kcl dot ac dot uk>
Thu, 25 Dec 2014 15:54:08 +0000
changeset 21 17ea9ad46257
parent 1 dcde836219bc
permissions -rw-r--r--
updated for Isabelle 2014
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
dcde836219bc add thy files
chunhan
parents:
diff changeset
     1
theory tainted 
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 begin
dcde836219bc add thy files
chunhan
parents:
diff changeset
     6
dcde836219bc add thy files
chunhan
parents:
diff changeset
     7
lemma tainted_is_valid:
dcde836219bc add thy files
chunhan
parents:
diff changeset
     8
  "obj \<in> tainted s \<Longrightarrow> valid s"
dcde836219bc add thy files
chunhan
parents:
diff changeset
     9
by (erule tainted.induct, auto simp:vs_nil)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    10
dcde836219bc add thy files
chunhan
parents:
diff changeset
    11
lemma tainted_is_current:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    12
  "obj \<in> tainted s \<Longrightarrow> exists s obj"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    13
apply (erule tainted.induct)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    14
apply (auto dest:valid_os)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    15
apply (drule seeds_in_init, case_tac obj, auto)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    16
done
dcde836219bc add thy files
chunhan
parents:
diff changeset
    17
dcde836219bc add thy files
chunhan
parents:
diff changeset
    18
lemma nodel_tainted_exists:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    19
  "\<lbrakk>no_del_event (s'@s); obj \<in> tainted s\<rbrakk> \<Longrightarrow> exists (s'@s) obj"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    20
apply (drule_tac obj = obj in nodel_imp_un_deleted)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    21
by (drule tainted_is_current, simp add:not_deleted_imp_exists')
dcde836219bc add thy files
chunhan
parents:
diff changeset
    22
dcde836219bc add thy files
chunhan
parents:
diff changeset
    23
lemma t_remain_app:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    24
  "\<lbrakk>obj \<in> tainted s'; no_del_event (s @ s'); valid (s @ s')\<rbrakk> 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    25
  \<Longrightarrow> obj \<in> tainted (s @ s')"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    26
apply (induct s, simp)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    27
apply (simp only:cons_app_simp_aux)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    28
apply (frule valid_cons, frule no_del_event_cons_D, simp)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    29
apply (rule t_remain, simp+)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    30
apply (drule tainted_is_current)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    31
apply (case_tac a, case_tac [!] obj, auto)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    32
done
dcde836219bc add thy files
chunhan
parents:
diff changeset
    33
dcde836219bc add thy files
chunhan
parents:
diff changeset
    34
end
dcde836219bc add thy files
chunhan
parents:
diff changeset
    35
dcde836219bc add thy files
chunhan
parents:
diff changeset
    36
context tainting_s_complete begin
dcde836219bc add thy files
chunhan
parents:
diff changeset
    37
dcde836219bc add thy files
chunhan
parents:
diff changeset
    38
lemma unknown_notin_tainted_s':
dcde836219bc add thy files
chunhan
parents:
diff changeset
    39
  "sobj \<in> tainted_s \<Longrightarrow> sobj \<noteq> Unknown" 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    40
apply (erule tainted_s.induct, auto) 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    41
apply (drule seeds_in_init) 
dcde836219bc add thy files
chunhan
parents:
diff changeset
    42
apply (subgoal_tac "exists [] obj")
dcde836219bc add thy files
chunhan
parents:
diff changeset
    43
apply (drule init_obj_has_sobj, simp+)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    44
apply (case_tac obj, simp+)
dcde836219bc add thy files
chunhan
parents:
diff changeset
    45
done
dcde836219bc add thy files
chunhan
parents:
diff changeset
    46
dcde836219bc add thy files
chunhan
parents:
diff changeset
    47
lemma unknown_notin_tainted_s:
dcde836219bc add thy files
chunhan
parents:
diff changeset
    48
  "Unknown \<in> tainted_s \<Longrightarrow> False"
dcde836219bc add thy files
chunhan
parents:
diff changeset
    49
by (auto dest:unknown_notin_tainted_s')
dcde836219bc add thy files
chunhan
parents:
diff changeset
    50
dcde836219bc add thy files
chunhan
parents:
diff changeset
    51
end
dcde836219bc add thy files
chunhan
parents:
diff changeset
    52
dcde836219bc add thy files
chunhan
parents:
diff changeset
    53
end