| author | wenzelm | 
| Fri, 27 Jan 2006 19:03:19 +0100 | |
| changeset 18812 | a4554848b59e | 
| parent 18570 | ffce25f9aa7f | 
| child 20768 | 1d478c2d621f | 
| permissions | -rw-r--r-- | 
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 1 | (* Title: HOL/Auth/Event | 
| 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 2 | ID: $Id$ | 
| 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 3 | Author: Lawrence C Paulson, Cambridge University Computer Laboratory | 
| 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 4 | Copyright 1996 University of Cambridge | 
| 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 5 | |
| 3683 | 6 | Datatype of events; function "spies"; freshness | 
| 3678 | 7 | |
| 3683 | 8 | "bad" agents have been broken by the Spy; their private keys and internal | 
| 3678 | 9 | stores are visible to him | 
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 10 | *) | 
| 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 11 | |
| 13956 | 12 | header{*Theory of Events for Security Protocols*}
 | 
| 13 | ||
| 16417 | 14 | theory Event imports Message begin | 
| 11104 | 15 | |
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 16 | consts (*Initial states of agents -- parameter of the construction*) | 
| 11104 | 17 | initState :: "agent => msg set" | 
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 18 | |
| 6399 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 19 | datatype | 
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 20 | event = Says agent agent msg | 
| 6399 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 21 | | Gets agent msg | 
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 22 | | Notes agent msg | 
| 6308 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 23 | |
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 24 | consts | 
| 11104 | 25 | bad :: "agent set" (*compromised agents*) | 
| 26 | knows :: "agent => event list => msg set" | |
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 27 | |
| 6308 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 28 | |
| 14126 
28824746d046
Tidying and replacement of some axioms by specifications
 paulson parents: 
13956diff
changeset | 29 | text{*The constant "spies" is retained for compatibility's sake*}
 | 
| 6308 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 30 | syntax | 
| 11104 | 31 | spies :: "event list => msg set" | 
| 3519 
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
 paulson parents: 
3512diff
changeset | 32 | |
| 6308 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 33 | translations | 
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 34 | "spies" => "knows Spy" | 
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 35 | |
| 14126 
28824746d046
Tidying and replacement of some axioms by specifications
 paulson parents: 
13956diff
changeset | 36 | text{*Spy has access to his own key for spoof messages, but Server is secure*}
 | 
| 
28824746d046
Tidying and replacement of some axioms by specifications
 paulson parents: 
13956diff
changeset | 37 | specification (bad) | 
| 14200 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14126diff
changeset | 38 | Spy_in_bad [iff]: "Spy \<in> bad" | 
| 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14126diff
changeset | 39 | Server_not_bad [iff]: "Server \<notin> bad" | 
| 14126 
28824746d046
Tidying and replacement of some axioms by specifications
 paulson parents: 
13956diff
changeset | 40 |     by (rule exI [of _ "{Spy}"], simp)
 | 
| 6308 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 41 | |
| 5183 | 42 | primrec | 
| 11104 | 43 | knows_Nil: "knows A [] = initState A" | 
| 44 | knows_Cons: | |
| 6399 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 45 | "knows A (ev # evs) = | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 46 | (if A = Spy then | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 47 | (case ev of | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 48 | Says A' B X => insert X (knows Spy evs) | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 49 | | Gets A' X => knows Spy evs | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 50 | | Notes A' X => | 
| 13922 | 51 | if A' \<in> bad then insert X (knows Spy evs) else knows Spy evs) | 
| 6399 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 52 | else | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 53 | (case ev of | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 54 | Says A' B X => | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 55 | if A'=A then insert X (knows A evs) else knows A evs | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 56 | | Gets A' X => | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 57 | if A'=A then insert X (knows A evs) else knows A evs | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 58 | | Notes A' X => | 
| 
4a9040b85e2e
exchanged the order of Gets and Notes in datatype event
 paulson parents: 
6308diff
changeset | 59 | if A'=A then insert X (knows A evs) else knows A evs))" | 
| 6308 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 60 | |
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 61 | (* | 
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 62 | Case A=Spy on the Gets event | 
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 63 | enforces the fact that if a message is received then it must have been sent, | 
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 64 | therefore the oops case must use Notes | 
| 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 65 | *) | 
| 3678 | 66 | |
| 3683 | 67 | consts | 
| 68 | (*Set of items that might be visible to somebody: | |
| 69 | complement of the set of fresh items*) | |
| 11104 | 70 | used :: "event list => msg set" | 
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 71 | |
| 5183 | 72 | primrec | 
| 11104 | 73 | used_Nil: "used [] = (UN B. parts (initState B))" | 
| 74 | used_Cons: "used (ev # evs) = | |
| 75 | (case ev of | |
| 13935 | 76 | 			Says A B X => parts {X} \<union> used evs
 | 
| 11104 | 77 | | Gets A X => used evs | 
| 13935 | 78 | 		      | Notes A X  => parts {X} \<union> used evs)"
 | 
| 79 |     --{*The case for @{term Gets} seems anomalous, but @{term Gets} always
 | |
| 80 |         follows @{term Says} in real protocols.  Seems difficult to change.
 | |
| 81 |         See @{text Gets_correct} in theory @{text "Guard/Extensions.thy"}. *}
 | |
| 6308 
76f3865a2b1d
Added Bella's "Gets" model for Otway_Rees.  Also affects some other theories.
 paulson parents: 
5183diff
changeset | 82 | |
| 13926 | 83 | lemma Notes_imp_used [rule_format]: "Notes A X \<in> set evs --> X \<in> used evs" | 
| 84 | apply (induct_tac evs) | |
| 11463 | 85 | apply (auto split: event.split) | 
| 86 | done | |
| 87 | ||
| 13926 | 88 | lemma Says_imp_used [rule_format]: "Says A B X \<in> set evs --> X \<in> used evs" | 
| 89 | apply (induct_tac evs) | |
| 11463 | 90 | apply (auto split: event.split) | 
| 91 | done | |
| 92 | ||
| 13926 | 93 | |
| 94 | subsection{*Function @{term knows}*}
 | |
| 95 | ||
| 13956 | 96 | (*Simplifying | 
| 97 |  parts(insert X (knows Spy evs)) = parts{X} \<union> parts(knows Spy evs).
 | |
| 98 | This version won't loop with the simplifier.*) | |
| 13935 | 99 | lemmas parts_insert_knows_A = parts_insert [of _ "knows A evs", standard] | 
| 13926 | 100 | |
| 101 | lemma knows_Spy_Says [simp]: | |
| 102 | "knows Spy (Says A B X # evs) = insert X (knows Spy evs)" | |
| 103 | by simp | |
| 104 | ||
| 14200 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14126diff
changeset | 105 | text{*Letting the Spy see "bad" agents' notes avoids redundant case-splits
 | 
| 
d8598e24f8fa
Removal of the Key_supply axiom (affects many possbility proofs) and minor
 paulson parents: 
14126diff
changeset | 106 |       on whether @{term "A=Spy"} and whether @{term "A\<in>bad"}*}
 | 
| 13926 | 107 | lemma knows_Spy_Notes [simp]: | 
| 108 | "knows Spy (Notes A X # evs) = | |
| 109 | (if A:bad then insert X (knows Spy evs) else knows Spy evs)" | |
| 110 | by simp | |
| 111 | ||
| 112 | lemma knows_Spy_Gets [simp]: "knows Spy (Gets A X # evs) = knows Spy evs" | |
| 113 | by simp | |
| 114 | ||
| 115 | lemma knows_Spy_subset_knows_Spy_Says: | |
| 13935 | 116 | "knows Spy evs \<subseteq> knows Spy (Says A B X # evs)" | 
| 13926 | 117 | by (simp add: subset_insertI) | 
| 118 | ||
| 119 | lemma knows_Spy_subset_knows_Spy_Notes: | |
| 13935 | 120 | "knows Spy evs \<subseteq> knows Spy (Notes A X # evs)" | 
| 13926 | 121 | by force | 
| 122 | ||
| 123 | lemma knows_Spy_subset_knows_Spy_Gets: | |
| 13935 | 124 | "knows Spy evs \<subseteq> knows Spy (Gets A X # evs)" | 
| 13926 | 125 | by (simp add: subset_insertI) | 
| 126 | ||
| 127 | text{*Spy sees what is sent on the traffic*}
 | |
| 128 | lemma Says_imp_knows_Spy [rule_format]: | |
| 129 | "Says A B X \<in> set evs --> X \<in> knows Spy evs" | |
| 130 | apply (induct_tac "evs") | |
| 131 | apply (simp_all (no_asm_simp) split add: event.split) | |
| 132 | done | |
| 133 | ||
| 134 | lemma Notes_imp_knows_Spy [rule_format]: | |
| 135 | "Notes A X \<in> set evs --> A: bad --> X \<in> knows Spy evs" | |
| 136 | apply (induct_tac "evs") | |
| 137 | apply (simp_all (no_asm_simp) split add: event.split) | |
| 138 | done | |
| 139 | ||
| 140 | ||
| 141 | text{*Elimination rules: derive contradictions from old Says events containing
 | |
| 142 | items known to be fresh*} | |
| 143 | lemmas knows_Spy_partsEs = | |
| 144 | Says_imp_knows_Spy [THEN parts.Inj, THEN revcut_rl, standard] | |
| 145 | parts.Body [THEN revcut_rl, standard] | |
| 146 | ||
| 18570 | 147 | lemmas Says_imp_analz_Spy = Says_imp_knows_Spy [THEN analz.Inj] | 
| 148 | ||
| 13926 | 149 | text{*Compatibility for the old "spies" function*}
 | 
| 150 | lemmas spies_partsEs = knows_Spy_partsEs | |
| 151 | lemmas Says_imp_spies = Says_imp_knows_Spy | |
| 13935 | 152 | lemmas parts_insert_spies = parts_insert_knows_A [of _ Spy] | 
| 13926 | 153 | |
| 154 | ||
| 155 | subsection{*Knowledge of Agents*}
 | |
| 156 | ||
| 157 | lemma knows_Says: "knows A (Says A B X # evs) = insert X (knows A evs)" | |
| 158 | by simp | |
| 159 | ||
| 160 | lemma knows_Notes: "knows A (Notes A X # evs) = insert X (knows A evs)" | |
| 161 | by simp | |
| 162 | ||
| 163 | lemma knows_Gets: | |
| 164 | "A \<noteq> Spy --> knows A (Gets A X # evs) = insert X (knows A evs)" | |
| 165 | by simp | |
| 166 | ||
| 167 | ||
| 13935 | 168 | lemma knows_subset_knows_Says: "knows A evs \<subseteq> knows A (Says A' B X # evs)" | 
| 169 | by (simp add: subset_insertI) | |
| 13926 | 170 | |
| 13935 | 171 | lemma knows_subset_knows_Notes: "knows A evs \<subseteq> knows A (Notes A' X # evs)" | 
| 172 | by (simp add: subset_insertI) | |
| 13926 | 173 | |
| 13935 | 174 | lemma knows_subset_knows_Gets: "knows A evs \<subseteq> knows A (Gets A' X # evs)" | 
| 175 | by (simp add: subset_insertI) | |
| 13926 | 176 | |
| 177 | text{*Agents know what they say*}
 | |
| 178 | lemma Says_imp_knows [rule_format]: "Says A B X \<in> set evs --> X \<in> knows A evs" | |
| 179 | apply (induct_tac "evs") | |
| 180 | apply (simp_all (no_asm_simp) split add: event.split) | |
| 181 | apply blast | |
| 182 | done | |
| 183 | ||
| 184 | text{*Agents know what they note*}
 | |
| 185 | lemma Notes_imp_knows [rule_format]: "Notes A X \<in> set evs --> X \<in> knows A evs" | |
| 186 | apply (induct_tac "evs") | |
| 187 | apply (simp_all (no_asm_simp) split add: event.split) | |
| 188 | apply blast | |
| 189 | done | |
| 190 | ||
| 191 | text{*Agents know what they receive*}
 | |
| 192 | lemma Gets_imp_knows_agents [rule_format]: | |
| 193 | "A \<noteq> Spy --> Gets A X \<in> set evs --> X \<in> knows A evs" | |
| 194 | apply (induct_tac "evs") | |
| 195 | apply (simp_all (no_asm_simp) split add: event.split) | |
| 196 | done | |
| 197 | ||
| 198 | ||
| 199 | text{*What agents DIFFERENT FROM Spy know 
 | |
| 200 | was either said, or noted, or got, or known initially*} | |
| 201 | lemma knows_imp_Says_Gets_Notes_initState [rule_format]: | |
| 202 | "[| X \<in> knows A evs; A \<noteq> Spy |] ==> EX B. | |
| 203 | Says A B X \<in> set evs | Gets A X \<in> set evs | Notes A X \<in> set evs | X \<in> initState A" | |
| 204 | apply (erule rev_mp) | |
| 205 | apply (induct_tac "evs") | |
| 206 | apply (simp_all (no_asm_simp) split add: event.split) | |
| 207 | apply blast | |
| 208 | done | |
| 209 | ||
| 210 | text{*What the Spy knows -- for the time being --
 | |
| 211 | was either said or noted, or known initially*} | |
| 212 | lemma knows_Spy_imp_Says_Notes_initState [rule_format]: | |
| 213 | "[| X \<in> knows Spy evs |] ==> EX A B. | |
| 214 | Says A B X \<in> set evs | Notes A X \<in> set evs | X \<in> initState Spy" | |
| 215 | apply (erule rev_mp) | |
| 216 | apply (induct_tac "evs") | |
| 217 | apply (simp_all (no_asm_simp) split add: event.split) | |
| 218 | apply blast | |
| 219 | done | |
| 220 | ||
| 13935 | 221 | lemma parts_knows_Spy_subset_used: "parts (knows Spy evs) \<subseteq> used evs" | 
| 222 | apply (induct_tac "evs", force) | |
| 223 | apply (simp add: parts_insert_knows_A knows_Cons add: event.split, blast) | |
| 13926 | 224 | done | 
| 225 | ||
| 226 | lemmas usedI = parts_knows_Spy_subset_used [THEN subsetD, intro] | |
| 227 | ||
| 228 | lemma initState_into_used: "X \<in> parts (initState B) ==> X \<in> used evs" | |
| 229 | apply (induct_tac "evs") | |
| 13935 | 230 | apply (simp_all add: parts_insert_knows_A split add: event.split, blast) | 
| 13926 | 231 | done | 
| 232 | ||
| 233 | lemma used_Says [simp]: "used (Says A B X # evs) = parts{X} \<union> used evs"
 | |
| 234 | by simp | |
| 235 | ||
| 236 | lemma used_Notes [simp]: "used (Notes A X # evs) = parts{X} \<union> used evs"
 | |
| 237 | by simp | |
| 238 | ||
| 239 | lemma used_Gets [simp]: "used (Gets A X # evs) = used evs" | |
| 240 | by simp | |
| 241 | ||
| 13935 | 242 | lemma used_nil_subset: "used [] \<subseteq> used evs" | 
| 243 | apply simp | |
| 13926 | 244 | apply (blast intro: initState_into_used) | 
| 245 | done | |
| 246 | ||
| 247 | text{*NOTE REMOVAL--laws above are cleaner, as they don't involve "case"*}
 | |
| 13935 | 248 | declare knows_Cons [simp del] | 
| 249 | used_Nil [simp del] used_Cons [simp del] | |
| 13926 | 250 | |
| 251 | ||
| 252 | text{*For proving theorems of the form @{term "X \<notin> analz (knows Spy evs) --> P"}
 | |
| 253 | New events added by induction to "evs" are discarded. Provided | |
| 254 | this information isn't needed, the proof will be much shorter, since | |
| 255 |   it will omit complicated reasoning about @{term analz}.*}
 | |
| 256 | ||
| 257 | lemmas analz_mono_contra = | |
| 258 | knows_Spy_subset_knows_Spy_Says [THEN analz_mono, THEN contra_subsetD] | |
| 259 | knows_Spy_subset_knows_Spy_Notes [THEN analz_mono, THEN contra_subsetD] | |
| 260 | knows_Spy_subset_knows_Spy_Gets [THEN analz_mono, THEN contra_subsetD] | |
| 261 | ||
| 262 | ML | |
| 263 | {*
 | |
| 264 | val analz_mono_contra_tac = | |
| 265 | let val analz_impI = inst "P" "?Y \<notin> analz (knows Spy ?evs)" impI | |
| 266 | in | |
| 267 | rtac analz_impI THEN' | |
| 268 | REPEAT1 o | |
| 269 | (dresolve_tac (thms"analz_mono_contra")) | |
| 270 | THEN' mp_tac | |
| 271 | end | |
| 272 | *} | |
| 273 | ||
| 11104 | 274 | |
| 13922 | 275 | lemma knows_subset_knows_Cons: "knows A evs \<subseteq> knows A (e # evs)" | 
| 276 | by (induct e, auto simp: knows_Cons) | |
| 277 | ||
| 13935 | 278 | lemma initState_subset_knows: "initState A \<subseteq> knows A evs" | 
| 13926 | 279 | apply (induct_tac evs, simp) | 
| 13922 | 280 | apply (blast intro: knows_subset_knows_Cons [THEN subsetD]) | 
| 281 | done | |
| 282 | ||
| 283 | ||
| 13926 | 284 | text{*For proving @{text new_keys_not_used}*}
 | 
| 13922 | 285 | lemma keysFor_parts_insert: | 
| 13926 | 286 | "[| K \<in> keysFor (parts (insert X G)); X \<in> synth (analz H) |] | 
| 287 | ==> K \<in> keysFor (parts (G \<union> H)) | Key (invKey K) \<in> parts H"; | |
| 13922 | 288 | by (force | 
| 289 | dest!: parts_insert_subset_Un [THEN keysFor_mono, THEN [2] rev_subsetD] | |
| 290 | analz_subset_parts [THEN keysFor_mono, THEN [2] rev_subsetD] | |
| 291 | intro: analz_subset_parts [THEN subsetD] parts_mono [THEN [2] rev_subsetD]) | |
| 292 | ||
| 11104 | 293 | method_setup analz_mono_contra = {*
 | 
| 294 | Method.no_args | |
| 295 | (Method.METHOD (fn facts => REPEAT_FIRST analz_mono_contra_tac)) *} | |
| 13922 | 296 | "for proving theorems of the form X \<notin> analz (knows Spy evs) --> P" | 
| 297 | ||
| 298 | subsubsection{*Useful for case analysis on whether a hash is a spoof or not*}
 | |
| 299 | ||
| 300 | ML | |
| 301 | {*
 | |
| 13926 | 302 | val knows_Cons = thm "knows_Cons" | 
| 303 | val used_Nil = thm "used_Nil" | |
| 304 | val used_Cons = thm "used_Cons" | |
| 305 | ||
| 306 | val Notes_imp_used = thm "Notes_imp_used"; | |
| 307 | val Says_imp_used = thm "Says_imp_used"; | |
| 308 | val Says_imp_knows_Spy = thm "Says_imp_knows_Spy"; | |
| 309 | val Notes_imp_knows_Spy = thm "Notes_imp_knows_Spy"; | |
| 310 | val knows_Spy_partsEs = thms "knows_Spy_partsEs"; | |
| 311 | val spies_partsEs = thms "spies_partsEs"; | |
| 312 | val Says_imp_spies = thm "Says_imp_spies"; | |
| 313 | val parts_insert_spies = thm "parts_insert_spies"; | |
| 314 | val Says_imp_knows = thm "Says_imp_knows"; | |
| 315 | val Notes_imp_knows = thm "Notes_imp_knows"; | |
| 316 | val Gets_imp_knows_agents = thm "Gets_imp_knows_agents"; | |
| 317 | val knows_imp_Says_Gets_Notes_initState = thm "knows_imp_Says_Gets_Notes_initState"; | |
| 318 | val knows_Spy_imp_Says_Notes_initState = thm "knows_Spy_imp_Says_Notes_initState"; | |
| 319 | val usedI = thm "usedI"; | |
| 320 | val initState_into_used = thm "initState_into_used"; | |
| 321 | val used_Says = thm "used_Says"; | |
| 322 | val used_Notes = thm "used_Notes"; | |
| 323 | val used_Gets = thm "used_Gets"; | |
| 324 | val used_nil_subset = thm "used_nil_subset"; | |
| 325 | val analz_mono_contra = thms "analz_mono_contra"; | |
| 326 | val knows_subset_knows_Cons = thm "knows_subset_knows_Cons"; | |
| 327 | val initState_subset_knows = thm "initState_subset_knows"; | |
| 328 | val keysFor_parts_insert = thm "keysFor_parts_insert"; | |
| 329 | ||
| 330 | ||
| 13922 | 331 | val synth_analz_mono = thm "synth_analz_mono"; | 
| 332 | ||
| 13935 | 333 | val knows_Spy_subset_knows_Spy_Says = thm "knows_Spy_subset_knows_Spy_Says"; | 
| 334 | val knows_Spy_subset_knows_Spy_Notes = thm "knows_Spy_subset_knows_Spy_Notes"; | |
| 335 | val knows_Spy_subset_knows_Spy_Gets = thm "knows_Spy_subset_knows_Spy_Gets"; | |
| 336 | ||
| 337 | ||
| 13922 | 338 | val synth_analz_mono_contra_tac = | 
| 13926 | 339 | let val syan_impI = inst "P" "?Y \<notin> synth (analz (knows Spy ?evs))" impI | 
| 13922 | 340 | in | 
| 341 | rtac syan_impI THEN' | |
| 342 | REPEAT1 o | |
| 343 | (dresolve_tac | |
| 344 | [knows_Spy_subset_knows_Spy_Says RS synth_analz_mono RS contra_subsetD, | |
| 345 | knows_Spy_subset_knows_Spy_Notes RS synth_analz_mono RS contra_subsetD, | |
| 346 | knows_Spy_subset_knows_Spy_Gets RS synth_analz_mono RS contra_subsetD]) | |
| 347 | THEN' | |
| 348 | mp_tac | |
| 349 | end; | |
| 350 | *} | |
| 351 | ||
| 352 | method_setup synth_analz_mono_contra = {*
 | |
| 353 | Method.no_args | |
| 354 | (Method.METHOD (fn facts => REPEAT_FIRST synth_analz_mono_contra_tac)) *} | |
| 355 | "for proving theorems of the form X \<notin> synth (analz (knows Spy evs)) --> P" | |
| 3512 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 356 | |
| 
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
 paulson parents: diff
changeset | 357 | end |