src/HOL/Auth/Guard/Guard_Shared.thy
changeset 35416 d8d7d1b785af
parent 21404 eb85850d3eb7
child 41413 64cd30d6b0b8
equal deleted inserted replaced
35342:4dc65845eab3 35416:d8d7d1b785af
    23   Ciph :: "agent => msg => msg" where
    23   Ciph :: "agent => msg => msg" where
    24   "Ciph A X == Crypt (shrK A) X"
    24   "Ciph A X == Crypt (shrK A) X"
    25 
    25 
    26 subsubsection{*agent associated to a key*}
    26 subsubsection{*agent associated to a key*}
    27 
    27 
    28 constdefs agt :: "key => agent"
    28 definition agt :: "key => agent" where
    29 "agt K == @A. K = shrK A"
    29 "agt K == @A. K = shrK A"
    30 
    30 
    31 lemma agt_shrK [simp]: "agt (shrK A) = A"
    31 lemma agt_shrK [simp]: "agt (shrK A) = A"
    32 by (simp add: agt_def)
    32 by (simp add: agt_def)
    33 
    33 
    50 lemma keyset_init [iff]: "keyset (initState A)"
    50 lemma keyset_init [iff]: "keyset (initState A)"
    51 by (cases A, auto simp: keyset_def initState.simps)
    51 by (cases A, auto simp: keyset_def initState.simps)
    52 
    52 
    53 subsubsection{*sets of symmetric keys*}
    53 subsubsection{*sets of symmetric keys*}
    54 
    54 
    55 constdefs shrK_set :: "key set => bool"
    55 definition shrK_set :: "key set => bool" where
    56 "shrK_set Ks == ALL K. K:Ks --> (EX A. K = shrK A)"
    56 "shrK_set Ks == ALL K. K:Ks --> (EX A. K = shrK A)"
    57 
    57 
    58 lemma in_shrK_set: "[| shrK_set Ks; K:Ks |] ==> EX A. K = shrK A"
    58 lemma in_shrK_set: "[| shrK_set Ks; K:Ks |] ==> EX A. K = shrK A"
    59 by (simp add: shrK_set_def)
    59 by (simp add: shrK_set_def)
    60 
    60 
    64 lemma shrK_set2 [iff]: "shrK_set {shrK A, shrK B}"
    64 lemma shrK_set2 [iff]: "shrK_set {shrK A, shrK B}"
    65 by (simp add: shrK_set_def)
    65 by (simp add: shrK_set_def)
    66 
    66 
    67 subsubsection{*sets of good keys*}
    67 subsubsection{*sets of good keys*}
    68 
    68 
    69 constdefs good :: "key set => bool"
    69 definition good :: "key set => bool" where
    70 "good Ks == ALL K. K:Ks --> agt K ~:bad"
    70 "good Ks == ALL K. K:Ks --> agt K ~:bad"
    71 
    71 
    72 lemma in_good: "[| good Ks; K:Ks |] ==> agt K ~:bad"
    72 lemma in_good: "[| good Ks; K:Ks |] ==> agt K ~:bad"
    73 by (simp add: good_def)
    73 by (simp add: good_def)
    74 
    74 
   152 apply (rule_tac H="knows_max (Friend C) evs" in GuardK_mono)
   152 apply (rule_tac H="knows_max (Friend C) evs" in GuardK_mono)
   153 by (auto simp: knows_max_def)
   153 by (auto simp: knows_max_def)
   154 
   154 
   155 subsubsection{*regular protocols*}
   155 subsubsection{*regular protocols*}
   156 
   156 
   157 constdefs regular :: "event list set => bool"
   157 definition regular :: "event list set => bool" where
   158 "regular p == ALL evs A. evs:p --> (Key (shrK A):parts (spies evs)) = (A:bad)"
   158 "regular p == ALL evs A. evs:p --> (Key (shrK A):parts (spies evs)) = (A:bad)"
   159 
   159 
   160 lemma shrK_parts_iff_bad [simp]: "[| evs:p; regular p |] ==>
   160 lemma shrK_parts_iff_bad [simp]: "[| evs:p; regular p |] ==>
   161 (Key (shrK A):parts (spies evs)) = (A:bad)"
   161 (Key (shrK A):parts (spies evs)) = (A:bad)"
   162 by (auto simp: regular_def)
   162 by (auto simp: regular_def)