src/HOL/IMP/Sec_Typing.thy
changeset 68776 403dd13cf6e9
parent 67406 23307fd33906
child 69597 ff784d5a5bfb
equal deleted inserted replaced
68774:9fc50a3e07f6 68776:403dd13cf6e9
     1 (* Author: Tobias Nipkow *)
     1 (* Author: Tobias Nipkow *)
       
     2 
       
     3 subsection "Security Typing of Commands"
     2 
     4 
     3 theory Sec_Typing imports Sec_Type_Expr
     5 theory Sec_Typing imports Sec_Type_Expr
     4 begin
     6 begin
     5 
     7 
     6 subsection "Syntax Directed Typing"
     8 subsubsection "Syntax Directed Typing"
     7 
     9 
     8 inductive sec_type :: "nat \<Rightarrow> com \<Rightarrow> bool" ("(_/ \<turnstile> _)" [0,0] 50) where
    10 inductive sec_type :: "nat \<Rightarrow> com \<Rightarrow> bool" ("(_/ \<turnstile> _)" [0,0] 50) where
     9 Skip:
    11 Skip:
    10   "l \<turnstile> SKIP" |
    12   "l \<turnstile> SKIP" |
    11 Assign:
    13 Assign:
   172     ultimately show "s3 = t3 (\<le> l)" using \<open>s1 = t1 (\<le> l)\<close> by auto
   174     ultimately show "s3 = t3 (\<le> l)" using \<open>s1 = t1 (\<le> l)\<close> by auto
   173   qed
   175   qed
   174 qed
   176 qed
   175 
   177 
   176 
   178 
   177 subsection "The Standard Typing System"
   179 subsubsection "The Standard Typing System"
   178 
   180 
   179 text\<open>The predicate @{prop"l \<turnstile> c"} is nicely intuitive and executable. The
   181 text\<open>The predicate @{prop"l \<turnstile> c"} is nicely intuitive and executable. The
   180 standard formulation, however, is slightly different, replacing the maximum
   182 standard formulation, however, is slightly different, replacing the maximum
   181 computation by an antimonotonicity rule. We introduce the standard system now
   183 computation by an antimonotonicity rule. We introduce the standard system now
   182 and show the equivalence with our formulation.\<close>
   184 and show the equivalence with our formulation.\<close>
   211 apply (metis Seq)
   213 apply (metis Seq)
   212 apply (metis max.absorb2 If)
   214 apply (metis max.absorb2 If)
   213 apply (metis max.absorb2 While)
   215 apply (metis max.absorb2 While)
   214 by (metis anti_mono)
   216 by (metis anti_mono)
   215 
   217 
   216 subsection "A Bottom-Up Typing System"
   218 subsubsection "A Bottom-Up Typing System"
   217 
   219 
   218 inductive sec_type2 :: "com \<Rightarrow> level \<Rightarrow> bool" ("(\<turnstile> _ : _)" [0,0] 50) where
   220 inductive sec_type2 :: "com \<Rightarrow> level \<Rightarrow> bool" ("(\<turnstile> _ : _)" [0,0] 50) where
   219 Skip2:
   221 Skip2:
   220   "\<turnstile> SKIP : l" |
   222   "\<turnstile> SKIP : l" |
   221 Assign2:
   223 Assign2: