author | nipkow |
Sat, 07 Mar 1998 16:29:29 +0100 | |
changeset 4686 | 74a12e86b20b |
parent 4633 | d4a074973715 |
child 5076 | fbc9d95b62ba |
permissions | -rw-r--r-- |
2320 | 1 |
(* Title: HOL/Auth/Shared |
1934 | 2 |
ID: $Id$ |
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1996 University of Cambridge |
|
5 |
||
6 |
Theory of Shared Keys (common to all symmetric-key protocols) |
|
7 |
||
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
8 |
Shared, long-term keys; initial states of agents |
2032 | 9 |
*) |
10 |
||
1934 | 11 |
|
12 |
open Shared; |
|
13 |
||
3472
fb3c38c88c08
Deleted the obsolete operators newK, newN and nPair
paulson
parents:
3465
diff
changeset
|
14 |
(*** Basic properties of shrK ***) |
1934 | 15 |
|
3472
fb3c38c88c08
Deleted the obsolete operators newK, newN and nPair
paulson
parents:
3465
diff
changeset
|
16 |
(*Injectiveness: Agents' long-term keys are distinct.*) |
fb3c38c88c08
Deleted the obsolete operators newK, newN and nPair
paulson
parents:
3465
diff
changeset
|
17 |
AddIffs [inj_shrK RS inj_eq]; |
2376
f5c61fd9b9b6
Temporary additions (random) for the nested Otway-Rees protocol
paulson
parents:
2320
diff
changeset
|
18 |
|
3472
fb3c38c88c08
Deleted the obsolete operators newK, newN and nPair
paulson
parents:
3465
diff
changeset
|
19 |
(* invKey(shrK A) = shrK A *) |
fb3c38c88c08
Deleted the obsolete operators newK, newN and nPair
paulson
parents:
3465
diff
changeset
|
20 |
Addsimps [rewrite_rule [isSymKey_def] isSym_keys]; |
2320 | 21 |
|
1934 | 22 |
(** Rewrites should not refer to initState(Friend i) |
23 |
-- not in normal form! **) |
|
24 |
||
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3512
diff
changeset
|
25 |
goalw thy [keysFor_def] "keysFor (parts (initState C)) = {}"; |
3667 | 26 |
by (induct_tac "C" 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4423
diff
changeset
|
27 |
by Auto_tac; |
1934 | 28 |
qed "keysFor_parts_initState"; |
29 |
Addsimps [keysFor_parts_initState]; |
|
30 |
||
4509
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
31 |
(*Specialized to shared-key model: no need for addss in protocol proofs*) |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
32 |
goal thy "!!X. [| K: keysFor (parts (insert X H)); X : synth (analz H) |] \ |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
33 |
\ ==> K : keysFor (parts H) | Key K : parts H"; |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
34 |
by (fast_tac |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
35 |
(claset() addSDs [impOfSubs (parts_insert_subset_Un RS keysFor_mono), |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
36 |
impOfSubs (analz_subset_parts RS keysFor_mono)] |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
37 |
addIs [impOfSubs analz_subset_parts] |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
38 |
addss (simpset())) 1); |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
39 |
qed "keysFor_parts_insert"; |
828148415197
Making proofs faster, especially using keysFor_parts_insert
paulson
parents:
4477
diff
changeset
|
40 |
|
4238
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4156
diff
changeset
|
41 |
goal thy "!!H. Crypt K X : H ==> K : keysFor H"; |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4156
diff
changeset
|
42 |
by (dtac Crypt_imp_invKey_keysFor 1); |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4156
diff
changeset
|
43 |
by (Asm_full_simp_tac 1); |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4156
diff
changeset
|
44 |
qed "Crypt_imp_keysFor"; |
679a233fb206
Crypt_imp_keysFor: version of Crypt_imp_invKey_keysFor for shared keys
paulson
parents:
4156
diff
changeset
|
45 |
|
2032 | 46 |
|
3683 | 47 |
(*** Function "spies" ***) |
1934 | 48 |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3512
diff
changeset
|
49 |
(*Spy sees shared keys of agents!*) |
3683 | 50 |
goal thy "!!A. A: bad ==> Key (shrK A) : spies evs"; |
3667 | 51 |
by (induct_tac "evs" 1); |
3683 | 52 |
by (ALLGOALS (asm_simp_tac |
4091 | 53 |
(simpset() addsimps [imageI, spies_Cons] |
4686 | 54 |
addsplits [expand_event_case]))); |
3683 | 55 |
qed "Spy_spies_bad"; |
1934 | 56 |
|
3683 | 57 |
AddSIs [Spy_spies_bad]; |
2032 | 58 |
|
3683 | 59 |
(*For not_bad_tac*) |
60 |
goal thy "!!A. [| Crypt (shrK A) X : analz (spies evs); A: bad |] \ |
|
61 |
\ ==> X : analz (spies evs)"; |
|
4091 | 62 |
by (fast_tac (claset() addSDs [analz.Decrypt] addss (simpset())) 1); |
3683 | 63 |
qed "Crypt_Spy_analz_bad"; |
2072 | 64 |
|
3443 | 65 |
(*Prove that the agent is uncompromised by the confidentiality of |
66 |
a component of a message she's said.*) |
|
3683 | 67 |
fun not_bad_tac s = |
68 |
case_tac ("(" ^ s ^ ") : bad") THEN' |
|
3443 | 69 |
SELECT_GOAL |
3683 | 70 |
(REPEAT_DETERM (dtac (Says_imp_spies RS analz.Inj) 1) THEN |
3443 | 71 |
REPEAT_DETERM (etac MPair_analz 1) THEN |
72 |
THEN_BEST_FIRST |
|
3683 | 73 |
(dres_inst_tac [("A", s)] Crypt_Spy_analz_bad 1 THEN assume_tac 1) |
3443 | 74 |
(has_fewer_prems 1, size_of_thm) |
75 |
(Step_tac 1)); |
|
1934 | 76 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
77 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
78 |
(** Fresh keys never clash with long-term shared keys **) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
79 |
|
3683 | 80 |
(*Agents see their own shared keys!*) |
81 |
goal thy "Key (shrK A) : initState A"; |
|
82 |
by (induct_tac "A" 1); |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4423
diff
changeset
|
83 |
by Auto_tac; |
3683 | 84 |
qed "shrK_in_initState"; |
85 |
AddIffs [shrK_in_initState]; |
|
86 |
||
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
87 |
goal thy "Key (shrK A) : used evs"; |
4423 | 88 |
by (rtac initState_into_used 1); |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2922
diff
changeset
|
89 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
90 |
qed "shrK_in_used"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
91 |
AddIffs [shrK_in_used]; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
92 |
|
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2922
diff
changeset
|
93 |
(*Used in parts_induct_tac and analz_Fake_tac to distinguish session keys |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
94 |
from long-term shared keys*) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
95 |
goal thy "!!K. Key K ~: used evs ==> K ~: range shrK"; |
3121
cbb6c0c1c58a
Conversion to use blast_tac (with other improvements)
paulson
parents:
2922
diff
changeset
|
96 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
97 |
qed "Key_not_used"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
98 |
|
3961 | 99 |
goal thy "!!K. Key K ~: used evs ==> shrK B ~= K"; |
2891 | 100 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
101 |
qed "shrK_neq"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
102 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
103 |
Addsimps [Key_not_used, shrK_neq, shrK_neq RS not_sym]; |
3961 | 104 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
105 |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
106 |
(*** Fresh nonces ***) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
107 |
|
3519
ab0a9fbed4c0
Changing "lost" from a parameter of protocol definitions to a constant.
paulson
parents:
3512
diff
changeset
|
108 |
goal thy "Nonce N ~: parts (initState B)"; |
3667 | 109 |
by (induct_tac "B" 1); |
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4423
diff
changeset
|
110 |
by Auto_tac; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
111 |
qed "Nonce_notin_initState"; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
112 |
AddIffs [Nonce_notin_initState]; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
113 |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
114 |
goal thy "Nonce N ~: used []"; |
4091 | 115 |
by (simp_tac (simpset() addsimps [used_Nil]) 1); |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
116 |
qed "Nonce_notin_used_empty"; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
117 |
Addsimps [Nonce_notin_used_empty]; |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
118 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
119 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
120 |
(*** Supply fresh nonces for possibility theorems. ***) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
121 |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
122 |
(*In any trace, there is an upper bound N on the greatest nonce in use.*) |
3683 | 123 |
goal thy "EX N. ALL n. N<=n --> Nonce n ~: used evs"; |
3667 | 124 |
by (induct_tac "evs" 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
125 |
by (res_inst_tac [("x","0")] exI 1); |
3683 | 126 |
by (ALLGOALS (asm_simp_tac |
4091 | 127 |
(simpset() addsimps [used_Cons] |
4686 | 128 |
addsplits [expand_event_case]))); |
3730 | 129 |
by Safe_tac; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
3479
diff
changeset
|
130 |
by (ALLGOALS (rtac (msg_Nonce_supply RS exE))); |
4091 | 131 |
by (ALLGOALS (blast_tac (claset() addSEs [add_leE]))); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
132 |
val lemma = result(); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
133 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
134 |
goal thy "EX N. Nonce N ~: used evs"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
135 |
by (rtac (lemma RS exE) 1); |
2891 | 136 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
137 |
qed "Nonce_supply1"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
138 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
139 |
goal thy "EX N N'. Nonce N ~: used evs & Nonce N' ~: used evs' & N ~= N'"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
140 |
by (cut_inst_tac [("evs","evs")] lemma 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
141 |
by (cut_inst_tac [("evs","evs'")] lemma 1); |
3708 | 142 |
by (Clarify_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
143 |
by (res_inst_tac [("x","N")] exI 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
144 |
by (res_inst_tac [("x","Suc (N+Na)")] exI 1); |
4091 | 145 |
by (asm_simp_tac (simpset() addsimps [less_not_refl2 RS not_sym, |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
146 |
le_add2, le_add1, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
147 |
le_eq_less_Suc RS sym]) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
148 |
qed "Nonce_supply2"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
149 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
150 |
goal thy "EX N N' N''. Nonce N ~: used evs & Nonce N' ~: used evs' & \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
151 |
\ Nonce N'' ~: used evs'' & N ~= N' & N' ~= N'' & N ~= N''"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
152 |
by (cut_inst_tac [("evs","evs")] lemma 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
153 |
by (cut_inst_tac [("evs","evs'")] lemma 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
154 |
by (cut_inst_tac [("evs","evs''")] lemma 1); |
3708 | 155 |
by (Clarify_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
156 |
by (res_inst_tac [("x","N")] exI 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
157 |
by (res_inst_tac [("x","Suc (N+Na)")] exI 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
158 |
by (res_inst_tac [("x","Suc (Suc (N+Na+Nb))")] exI 1); |
4091 | 159 |
by (asm_simp_tac (simpset() addsimps [less_not_refl2 RS not_sym, |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
160 |
le_add2, le_add1, |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
161 |
le_eq_less_Suc RS sym]) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
162 |
qed "Nonce_supply3"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
163 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
164 |
goal thy "Nonce (@ N. Nonce N ~: used evs) ~: used evs"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
165 |
by (rtac (lemma RS exE) 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
166 |
by (rtac selectI 1); |
2891 | 167 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
168 |
qed "Nonce_supply"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
169 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
170 |
(*** Supply fresh keys for possibility theorems. ***) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
171 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
172 |
goal thy "EX K. Key K ~: used evs"; |
3414
804c8a178a7f
Modified a few defs and proofs because of the changes to theory Finite.thy.
nipkow
parents:
3207
diff
changeset
|
173 |
by (rtac (Finites.emptyI RS Key_supply_ax RS exE) 1); |
2891 | 174 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
175 |
qed "Key_supply1"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
176 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
177 |
goal thy "EX K K'. Key K ~: used evs & Key K' ~: used evs' & K ~= K'"; |
3414
804c8a178a7f
Modified a few defs and proofs because of the changes to theory Finite.thy.
nipkow
parents:
3207
diff
changeset
|
178 |
by (cut_inst_tac [("evs","evs")] (Finites.emptyI RS Key_supply_ax) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
179 |
by (etac exE 1); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
180 |
by (cut_inst_tac [("evs","evs'")] |
3414
804c8a178a7f
Modified a few defs and proofs because of the changes to theory Finite.thy.
nipkow
parents:
3207
diff
changeset
|
181 |
(Finites.emptyI RS Finites.insertI RS Key_supply_ax) 1); |
4633
d4a074973715
corrected problem with auto_tac: now uses a variant of depth_tac that avoids
oheimb
parents:
4509
diff
changeset
|
182 |
by (Asm_full_simp_tac 1 THEN depth_tac (claset()) 2 1); (* replaces Auto_tac *) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
183 |
qed "Key_supply2"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
184 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
185 |
goal thy "EX K K' K''. Key K ~: used evs & Key K' ~: used evs' & \ |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
186 |
\ Key K'' ~: used evs'' & K ~= K' & K' ~= K'' & K ~= K''"; |
3414
804c8a178a7f
Modified a few defs and proofs because of the changes to theory Finite.thy.
nipkow
parents:
3207
diff
changeset
|
187 |
by (cut_inst_tac [("evs","evs")] (Finites.emptyI RS Key_supply_ax) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
188 |
by (etac exE 1); |
4156 | 189 |
(*Blast_tac requires instantiation of the keys for some reason*) |
190 |
by (cut_inst_tac [("evs","evs'"), ("a1","K")] |
|
3414
804c8a178a7f
Modified a few defs and proofs because of the changes to theory Finite.thy.
nipkow
parents:
3207
diff
changeset
|
191 |
(Finites.emptyI RS Finites.insertI RS Key_supply_ax) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
192 |
by (etac exE 1); |
4156 | 193 |
by (cut_inst_tac [("evs","evs''"), ("a1","Ka"), ("a2","K")] |
3414
804c8a178a7f
Modified a few defs and proofs because of the changes to theory Finite.thy.
nipkow
parents:
3207
diff
changeset
|
194 |
(Finites.emptyI RS Finites.insertI RS Finites.insertI RS Key_supply_ax) 1); |
4156 | 195 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
196 |
qed "Key_supply3"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
197 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
198 |
goal thy "Key (@ K. Key K ~: used evs) ~: used evs"; |
3414
804c8a178a7f
Modified a few defs and proofs because of the changes to theory Finite.thy.
nipkow
parents:
3207
diff
changeset
|
199 |
by (rtac (Finites.emptyI RS Key_supply_ax RS exE) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
200 |
by (rtac selectI 1); |
2891 | 201 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
202 |
qed "Key_supply"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
203 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
204 |
(*** Tactics for possibility theorems ***) |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
205 |
|
3673
3b06747c3f37
Having "addcongs [if_weak_cong]" in analz_image_..._ss makes simplification
paulson
parents:
3667
diff
changeset
|
206 |
(*Omitting used_Says makes the tactic much faster: it leaves expressions |
3b06747c3f37
Having "addcongs [if_weak_cong]" in analz_image_..._ss makes simplification
paulson
parents:
3667
diff
changeset
|
207 |
such as Nonce ?N ~: used evs that match Nonce_supply*) |
3542
db5e9aceea49
Now possibility_tac and basic_possibility_tac are explicit functions, in order
paulson
parents:
3519
diff
changeset
|
208 |
fun possibility_tac st = st |> |
3673
3b06747c3f37
Having "addcongs [if_weak_cong]" in analz_image_..._ss makes simplification
paulson
parents:
3667
diff
changeset
|
209 |
(REPEAT |
4091 | 210 |
(ALLGOALS (simp_tac (simpset() delsimps [used_Says] setSolver safe_solver)) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
211 |
THEN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
212 |
REPEAT_FIRST (eq_assume_tac ORELSE' |
3542
db5e9aceea49
Now possibility_tac and basic_possibility_tac are explicit functions, in order
paulson
parents:
3519
diff
changeset
|
213 |
resolve_tac [refl, conjI, Nonce_supply, Key_supply]))); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
214 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
215 |
(*For harder protocols (such as Recur) where we have to set up some |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
216 |
nonces and keys initially*) |
3542
db5e9aceea49
Now possibility_tac and basic_possibility_tac are explicit functions, in order
paulson
parents:
3519
diff
changeset
|
217 |
fun basic_possibility_tac st = st |> |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
218 |
REPEAT |
4091 | 219 |
(ALLGOALS (asm_simp_tac (simpset() setSolver safe_solver)) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
220 |
THEN |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
221 |
REPEAT_FIRST (resolve_tac [refl, conjI])); |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
222 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
223 |
|
3472
fb3c38c88c08
Deleted the obsolete operators newK, newN and nPair
paulson
parents:
3465
diff
changeset
|
224 |
(*** Specialized rewriting for analz_insert_freshK ***) |
2320 | 225 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
226 |
goal thy "!!A. A <= Compl (range shrK) ==> shrK x ~: A"; |
2891 | 227 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
228 |
qed "subset_Compl_range"; |
2045
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
229 |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
230 |
goal thy "insert (Key K) H = Key `` {K} Un H"; |
2891 | 231 |
by (Blast_tac 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
232 |
qed "insert_Key_singleton"; |
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
233 |
|
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
234 |
goal thy "insert (Key K) (Key``KK Un C) = Key `` (insert K KK) Un C"; |
2891 | 235 |
by (Blast_tac 1); |
236 |
qed "insert_Key_image"; |
|
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
237 |
|
3451
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3443
diff
changeset
|
238 |
(*Reverse the normal simplification of "image" to build up (not break down) |
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3443
diff
changeset
|
239 |
the set of keys. Use analz_insert_eq with (Un_upper2 RS analz_mono) to |
d10f100676d8
Made proofs more concise by replacing calls to spy_analz_tac by uses of
paulson
parents:
3443
diff
changeset
|
240 |
erase occurrences of forwarded message components (X).*) |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
241 |
val analz_image_freshK_ss = |
4091 | 242 |
simpset() addcongs [if_weak_cong] |
3673
3b06747c3f37
Having "addcongs [if_weak_cong]" in analz_image_..._ss makes simplification
paulson
parents:
3667
diff
changeset
|
243 |
delsimps [image_insert, image_Un] |
3680
7588653475b2
Removed the simprule imp_disjL from the analz_image_..._ss to boost speed
paulson
parents:
3673
diff
changeset
|
244 |
delsimps [imp_disjL] (*reduces blow-up*) |
3479
2aacd6f10654
Reordered rules in analz_image_freshK_ss to improve clarity
paulson
parents:
3472
diff
changeset
|
245 |
addsimps ([image_insert RS sym, image_Un RS sym, |
2aacd6f10654
Reordered rules in analz_image_freshK_ss to improve clarity
paulson
parents:
3472
diff
changeset
|
246 |
analz_insert_eq, impOfSubs (Un_upper2 RS analz_mono), |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
247 |
insert_Key_singleton, subset_Compl_range, |
3479
2aacd6f10654
Reordered rules in analz_image_freshK_ss to improve clarity
paulson
parents:
3472
diff
changeset
|
248 |
Key_not_used, insert_Key_image, Un_assoc RS sym] |
4686 | 249 |
@disj_comms); |
2045
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
250 |
|
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
251 |
(*Lemma for the trivial direction of the if-and-only-if*) |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
252 |
goal thy |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
253 |
"!!evs. (Key K : analz (Key``nE Un H)) --> (K : nE | Key K : analz H) ==> \ |
ae1030e66745
Removed some dead wood. Transferred lemmas used to prove analz_image_newK
paulson
parents:
2032
diff
changeset
|
254 |
\ (Key K : analz (Key``nE Un H)) = (K : nE | Key K : analz H)"; |
4091 | 255 |
by (blast_tac (claset() addIs [impOfSubs analz_mono]) 1); |
2516
4d68fbe6378b
Now with Andy Gordon's treatment of freshness to replace newN/K
paulson
parents:
2451
diff
changeset
|
256 |
qed "analz_image_freshK_lemma"; |