author | haftmann |
Wed, 08 Sep 2010 19:21:46 +0200 | |
changeset 39246 | 9e58f0499f57 |
parent 35416 | d8d7d1b785af |
child 41413 | 64cd30d6b0b8 |
permissions | -rw-r--r-- |
32631 | 1 |
(* Author: Giampaolo Bella, Catania University |
18886 | 2 |
*) |
3 |
||
4 |
header{*Theory of smartcards*} |
|
5 |
||
32631 | 6 |
theory Smartcard |
7 |
imports EventSC All_Symmetric |
|
8 |
begin |
|
18886 | 9 |
|
10 |
text{* |
|
11 |
As smartcards handle long-term (symmetric) keys, this theoy extends and |
|
12 |
supersedes theory Private.thy |
|
13 |
||
14 |
An agent is bad if she reveals her PIN to the spy, not the shared key that |
|
15 |
is embedded in her card. An agent's being bad implies nothing about her |
|
16 |
smartcard, which independently may be stolen or cloned. |
|
17 |
*} |
|
18 |
||
19 |
consts |
|
20 |
shrK :: "agent => key" (*long-term keys saved in smart cards*) |
|
21 |
crdK :: "card => key" (*smart cards' symmetric keys*) |
|
22 |
pin :: "agent => key" (*pin to activate the smart cards*) |
|
23 |
||
24 |
(*Mostly for Shoup-Rubin*) |
|
25 |
Pairkey :: "agent * agent => nat" |
|
26 |
pairK :: "agent * agent => key" |
|
27 |
||
28 |
axioms |
|
29 |
inj_shrK: "inj shrK" --{*No two smartcards store the same key*} |
|
30 |
inj_crdK: "inj crdK" --{*Nor do two cards*} |
|
31 |
inj_pin : "inj pin" --{*Nor do two agents have the same pin*} |
|
32 |
||
33 |
(*pairK is injective on each component, if we assume encryption to be a PRF |
|
34 |
or at least collision free *) |
|
35 |
inj_pairK [iff]: "(pairK(A,B) = pairK(A',B')) = (A = A' & B = B')" |
|
36 |
comm_Pairkey [iff]: "Pairkey(A,B) = Pairkey(B,A)" |
|
37 |
||
38 |
(*long-term keys differ from each other*) |
|
39 |
pairK_disj_crdK [iff]: "pairK(A,B) \<noteq> crdK C" |
|
40 |
pairK_disj_shrK [iff]: "pairK(A,B) \<noteq> shrK P" |
|
41 |
pairK_disj_pin [iff]: "pairK(A,B) \<noteq> pin P" |
|
42 |
shrK_disj_crdK [iff]: "shrK P \<noteq> crdK C" |
|
43 |
shrK_disj_pin [iff]: "shrK P \<noteq> pin Q" |
|
44 |
crdK_disj_pin [iff]: "crdK C \<noteq> pin P" |
|
45 |
||
35416
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents:
32960
diff
changeset
|
46 |
definition legalUse :: "card => bool" ("legalUse (_)") where |
18886 | 47 |
"legalUse C == C \<notin> stolen" |
48 |
||
35416
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents:
32960
diff
changeset
|
49 |
primrec illegalUse :: "card => bool" where |
d8d7d1b785af
replaced a couple of constsdefs by definitions (also some old primrecs by modern ones)
haftmann
parents:
32960
diff
changeset
|
50 |
illegalUse_def: "illegalUse (Card A) = ( (Card A \<in> stolen \<and> A \<in> bad) \<or> Card A \<in> cloned )" |
18886 | 51 |
|
52 |
||
53 |
text{*initState must be defined with care*} |
|
39246 | 54 |
|
55 |
overloading |
|
56 |
initState \<equiv> initState |
|
57 |
begin |
|
58 |
||
59 |
primrec initState where |
|
18886 | 60 |
(*Server knows all long-term keys; adding cards' keys may be redundant but |
61 |
helps prove crdK_in_initState and crdK_in_used to distinguish cards' keys |
|
62 |
from fresh (session) keys*) |
|
63 |
initState_Server: "initState Server = |
|
64 |
(Key`(range shrK \<union> range crdK \<union> range pin \<union> range pairK)) \<union> |
|
39246 | 65 |
(Nonce`(range Pairkey))" | |
18886 | 66 |
|
67 |
(*Other agents know only their own*) |
|
39246 | 68 |
initState_Friend: "initState (Friend i) = {Key (pin (Friend i))}" | |
18886 | 69 |
|
70 |
(*Spy knows bad agents' pins, cloned cards' keys, pairKs, and Pairkeys *) |
|
71 |
initState_Spy: "initState Spy = |
|
72 |
(Key`((pin`bad) \<union> (pin `{A. Card A \<in> cloned}) \<union> |
|
73 |
(shrK`{A. Card A \<in> cloned}) \<union> |
|
74 |
(crdK`cloned) \<union> |
|
75 |
(pairK`{(X,A). Card A \<in> cloned}))) |
|
76 |
\<union> (Nonce`(Pairkey`{(A,B). Card A \<in> cloned & Card B \<in> cloned}))" |
|
77 |
||
39246 | 78 |
end |
18886 | 79 |
|
80 |
text{*Still relying on axioms*} |
|
81 |
axioms |
|
82 |
Key_supply_ax: "finite KK \<Longrightarrow> \<exists> K. K \<notin> KK & Key K \<notin> used evs" |
|
83 |
||
84 |
(*Needed because of Spy's knowledge of Pairkeys*) |
|
85 |
Nonce_supply_ax: "finite NN \<Longrightarrow> \<exists> N. N \<notin> NN & Nonce N \<notin> used evs" |
|
86 |
||
87 |
||
88 |
||
89 |
||
90 |
||
91 |
||
92 |
||
93 |
subsection{*Basic properties of shrK*} |
|
94 |
||
95 |
(*Injectiveness: Agents' long-term keys are distinct.*) |
|
96 |
declare inj_shrK [THEN inj_eq, iff] |
|
97 |
declare inj_crdK [THEN inj_eq, iff] |
|
98 |
declare inj_pin [THEN inj_eq, iff] |
|
99 |
||
100 |
lemma invKey_K [simp]: "invKey K = K" |
|
101 |
apply (insert isSym_keys) |
|
102 |
apply (simp add: symKeys_def) |
|
103 |
done |
|
104 |
||
105 |
||
106 |
lemma analz_Decrypt' [dest]: |
|
107 |
"\<lbrakk> Crypt K X \<in> analz H; Key K \<in> analz H \<rbrakk> \<Longrightarrow> X \<in> analz H" |
|
108 |
by auto |
|
109 |
||
110 |
text{*Now cancel the @{text dest} attribute given to |
|
111 |
@{text analz.Decrypt} in its declaration.*} |
|
112 |
declare analz.Decrypt [rule del] |
|
113 |
||
114 |
text{*Rewrites should not refer to @{term "initState(Friend i)"} because |
|
115 |
that expression is not in normal form.*} |
|
116 |
||
117 |
text{*Added to extend initstate with set of nonces*} |
|
118 |
lemma parts_image_Nonce [simp]: "parts (Nonce`N) = Nonce`N" |
|
119 |
apply auto |
|
120 |
apply (erule parts.induct) |
|
121 |
apply auto |
|
122 |
done |
|
123 |
||
124 |
lemma keysFor_parts_initState [simp]: "keysFor (parts (initState C)) = {}" |
|
125 |
apply (unfold keysFor_def) |
|
126 |
apply (induct_tac "C", auto) |
|
127 |
done |
|
128 |
||
129 |
(*Specialized to shared-key model: no @{term invKey}*) |
|
130 |
lemma keysFor_parts_insert: |
|
131 |
"\<lbrakk> K \<in> keysFor (parts (insert X G)); X \<in> synth (analz H) \<rbrakk> |
|
132 |
\<Longrightarrow> K \<in> keysFor (parts (G \<union> H)) | Key K \<in> parts H"; |
|
133 |
by (force dest: EventSC.keysFor_parts_insert) |
|
134 |
||
135 |
lemma Crypt_imp_keysFor: "Crypt K X \<in> H \<Longrightarrow> K \<in> keysFor H" |
|
136 |
by (drule Crypt_imp_invKey_keysFor, simp) |
|
137 |
||
138 |
||
139 |
subsection{*Function "knows"*} |
|
140 |
||
141 |
(*Spy knows the pins of bad agents!*) |
|
142 |
lemma Spy_knows_bad [intro!]: "A \<in> bad \<Longrightarrow> Key (pin A) \<in> knows Spy evs" |
|
143 |
apply (induct_tac "evs") |
|
144 |
apply (simp_all (no_asm_simp) add: imageI knows_Cons split add: event.split) |
|
145 |
done |
|
146 |
||
147 |
(*Spy knows the long-term keys of cloned cards!*) |
|
148 |
lemma Spy_knows_cloned [intro!]: |
|
149 |
"Card A \<in> cloned \<Longrightarrow> Key (crdK (Card A)) \<in> knows Spy evs & |
|
150 |
Key (shrK A) \<in> knows Spy evs & |
|
151 |
Key (pin A) \<in> knows Spy evs & |
|
152 |
(\<forall> B. Key (pairK(B,A)) \<in> knows Spy evs)" |
|
153 |
apply (induct_tac "evs") |
|
154 |
apply (simp_all (no_asm_simp) add: imageI knows_Cons split add: event.split) |
|
155 |
done |
|
156 |
||
157 |
lemma Spy_knows_cloned1 [intro!]: "C \<in> cloned \<Longrightarrow> Key (crdK C) \<in> knows Spy evs" |
|
158 |
apply (induct_tac "evs") |
|
159 |
apply (simp_all (no_asm_simp) add: imageI knows_Cons split add: event.split) |
|
160 |
done |
|
161 |
||
162 |
lemma Spy_knows_cloned2 [intro!]: "\<lbrakk> Card A \<in> cloned; Card B \<in> cloned \<rbrakk> |
|
163 |
\<Longrightarrow> Nonce (Pairkey(A,B))\<in> knows Spy evs" |
|
164 |
apply (induct_tac "evs") |
|
165 |
apply (simp_all (no_asm_simp) add: imageI knows_Cons split add: event.split) |
|
166 |
done |
|
167 |
||
168 |
(*Spy only knows pins of bad agents!*) |
|
169 |
lemma Spy_knows_Spy_bad [intro!]: "A\<in> bad \<Longrightarrow> Key (pin A) \<in> knows Spy evs" |
|
170 |
apply (induct_tac "evs") |
|
171 |
apply (simp_all (no_asm_simp) add: imageI knows_Cons split add: event.split) |
|
172 |
done |
|
173 |
||
174 |
||
175 |
(*For case analysis on whether or not an agent is compromised*) |
|
176 |
lemma Crypt_Spy_analz_bad: |
|
177 |
"\<lbrakk> Crypt (pin A) X \<in> analz (knows Spy evs); A\<in>bad \<rbrakk> |
|
178 |
\<Longrightarrow> X \<in> analz (knows Spy evs)" |
|
179 |
apply (force dest!: analz.Decrypt) |
|
180 |
done |
|
181 |
||
182 |
(** Fresh keys never clash with other keys **) |
|
183 |
||
184 |
lemma shrK_in_initState [iff]: "Key (shrK A) \<in> initState Server" |
|
185 |
apply (induct_tac "A") |
|
186 |
apply auto |
|
187 |
done |
|
188 |
||
189 |
lemma shrK_in_used [iff]: "Key (shrK A) \<in> used evs" |
|
190 |
apply (rule initState_into_used) |
|
191 |
apply blast |
|
192 |
done |
|
193 |
||
194 |
lemma crdK_in_initState [iff]: "Key (crdK A) \<in> initState Server" |
|
195 |
apply (induct_tac "A") |
|
196 |
apply auto |
|
197 |
done |
|
198 |
||
199 |
lemma crdK_in_used [iff]: "Key (crdK A) \<in> used evs" |
|
200 |
apply (rule initState_into_used) |
|
201 |
apply blast |
|
202 |
done |
|
203 |
||
204 |
lemma pin_in_initState [iff]: "Key (pin A) \<in> initState A" |
|
205 |
apply (induct_tac "A") |
|
206 |
apply auto |
|
207 |
done |
|
208 |
||
209 |
lemma pin_in_used [iff]: "Key (pin A) \<in> used evs" |
|
210 |
apply (rule initState_into_used) |
|
211 |
apply blast |
|
212 |
done |
|
213 |
||
214 |
lemma pairK_in_initState [iff]: "Key (pairK X) \<in> initState Server" |
|
215 |
apply (induct_tac "X") |
|
216 |
apply auto |
|
217 |
done |
|
218 |
||
219 |
lemma pairK_in_used [iff]: "Key (pairK X) \<in> used evs" |
|
220 |
apply (rule initState_into_used) |
|
221 |
apply blast |
|
222 |
done |
|
223 |
||
224 |
||
225 |
||
226 |
(*Used in parts_induct_tac and analz_Fake_tac to distinguish session keys |
|
227 |
from long-term shared keys*) |
|
228 |
lemma Key_not_used [simp]: "Key K \<notin> used evs \<Longrightarrow> K \<notin> range shrK" |
|
229 |
by blast |
|
230 |
||
231 |
lemma shrK_neq [simp]: "Key K \<notin> used evs \<Longrightarrow> shrK B \<noteq> K" |
|
232 |
by blast |
|
233 |
||
234 |
lemma crdK_not_used [simp]: "Key K \<notin> used evs \<Longrightarrow> K \<notin> range crdK" |
|
235 |
apply clarify |
|
236 |
done |
|
237 |
||
238 |
lemma crdK_neq [simp]: "Key K \<notin> used evs \<Longrightarrow> crdK C \<noteq> K" |
|
239 |
apply clarify |
|
240 |
done |
|
241 |
||
242 |
lemma pin_not_used [simp]: "Key K \<notin> used evs \<Longrightarrow> K \<notin> range pin" |
|
243 |
apply clarify |
|
244 |
done |
|
245 |
||
246 |
lemma pin_neq [simp]: "Key K \<notin> used evs \<Longrightarrow> pin A \<noteq> K" |
|
247 |
apply clarify |
|
248 |
done |
|
249 |
||
250 |
lemma pairK_not_used [simp]: "Key K \<notin> used evs \<Longrightarrow> K \<notin> range pairK" |
|
251 |
apply clarify |
|
252 |
done |
|
253 |
||
254 |
lemma pairK_neq [simp]: "Key K \<notin> used evs \<Longrightarrow> pairK(A,B) \<noteq> K" |
|
255 |
apply clarify |
|
256 |
done |
|
257 |
||
258 |
declare shrK_neq [THEN not_sym, simp] |
|
259 |
declare crdK_neq [THEN not_sym, simp] |
|
260 |
declare pin_neq [THEN not_sym, simp] |
|
261 |
declare pairK_neq [THEN not_sym, simp] |
|
262 |
||
263 |
||
264 |
subsection{*Fresh nonces*} |
|
265 |
||
266 |
lemma Nonce_notin_initState [iff]: "Nonce N \<notin> parts (initState (Friend i))" |
|
267 |
by auto |
|
268 |
||
269 |
||
270 |
(*This lemma no longer holds of smartcard protocols, where the cards can store |
|
271 |
nonces. |
|
272 |
||
273 |
lemma Nonce_notin_used_empty [simp]: "Nonce N \<notin> used []" |
|
274 |
apply (simp (no_asm) add: used_Nil) |
|
275 |
done |
|
276 |
||
277 |
So, we must use old-style supply fresh nonce theorems relying on the appropriate axiom*) |
|
278 |
||
279 |
||
280 |
subsection{*Supply fresh nonces for possibility theorems.*} |
|
281 |
||
282 |
||
283 |
lemma Nonce_supply1: "\<exists>N. Nonce N \<notin> used evs" |
|
22265 | 284 |
apply (rule finite.emptyI [THEN Nonce_supply_ax, THEN exE], blast) |
18886 | 285 |
done |
286 |
||
287 |
lemma Nonce_supply2: |
|
288 |
"\<exists>N N'. Nonce N \<notin> used evs & Nonce N' \<notin> used evs' & N \<noteq> N'" |
|
22265 | 289 |
apply (cut_tac evs = evs in finite.emptyI [THEN Nonce_supply_ax]) |
18886 | 290 |
apply (erule exE) |
22265 | 291 |
apply (cut_tac evs = evs' in finite.emptyI [THEN finite.insertI, THEN Nonce_supply_ax]) |
18886 | 292 |
apply auto |
293 |
done |
|
294 |
||
295 |
||
296 |
lemma Nonce_supply3: "\<exists>N N' N''. Nonce N \<notin> used evs & Nonce N' \<notin> used evs' & |
|
297 |
Nonce N'' \<notin> used evs'' & N \<noteq> N' & N' \<noteq> N'' & N \<noteq> N''" |
|
22265 | 298 |
apply (cut_tac evs = evs in finite.emptyI [THEN Nonce_supply_ax]) |
18886 | 299 |
apply (erule exE) |
22265 | 300 |
apply (cut_tac evs = evs' and a1 = N in finite.emptyI [THEN finite.insertI, THEN Nonce_supply_ax]) |
18886 | 301 |
apply (erule exE) |
22265 | 302 |
apply (cut_tac evs = evs'' and a1 = Na and a2 = N in finite.emptyI [THEN finite.insertI, THEN finite.insertI, THEN Nonce_supply_ax]) |
18886 | 303 |
apply blast |
304 |
done |
|
305 |
||
306 |
lemma Nonce_supply: "Nonce (@ N. Nonce N \<notin> used evs) \<notin> used evs" |
|
22265 | 307 |
apply (rule finite.emptyI [THEN Nonce_supply_ax, THEN exE]) |
18886 | 308 |
apply (rule someI, blast) |
309 |
done |
|
310 |
||
311 |
||
312 |
||
313 |
text{*Unlike the corresponding property of nonces, we cannot prove |
|
314 |
@{term "finite KK \<Longrightarrow> \<exists>K. K \<notin> KK & Key K \<notin> used evs"}. |
|
315 |
We have infinitely many agents and there is nothing to stop their |
|
316 |
long-term keys from exhausting all the natural numbers. Instead, |
|
317 |
possibility theorems must assume the existence of a few keys.*} |
|
318 |
||
319 |
||
320 |
subsection{*Specialized Rewriting for Theorems About @{term analz} and Image*} |
|
321 |
||
322 |
lemma subset_Compl_range_shrK: "A \<subseteq> - (range shrK) \<Longrightarrow> shrK x \<notin> A" |
|
323 |
by blast |
|
324 |
||
325 |
lemma subset_Compl_range_crdK: "A \<subseteq> - (range crdK) \<Longrightarrow> crdK x \<notin> A" |
|
326 |
apply blast |
|
327 |
done |
|
328 |
||
329 |
lemma subset_Compl_range_pin: "A \<subseteq> - (range pin) \<Longrightarrow> pin x \<notin> A" |
|
330 |
apply blast |
|
331 |
done |
|
332 |
||
333 |
lemma subset_Compl_range_pairK: "A \<subseteq> - (range pairK) \<Longrightarrow> pairK x \<notin> A" |
|
334 |
apply blast |
|
335 |
done |
|
336 |
lemma insert_Key_singleton: "insert (Key K) H = Key ` {K} \<union> H" |
|
337 |
by blast |
|
338 |
||
339 |
lemma insert_Key_image: "insert (Key K) (Key`KK \<union> C) = Key`(insert K KK) \<union> C" |
|
340 |
by blast |
|
341 |
||
342 |
(** Reverse the normal simplification of "image" to build up (not break down) |
|
343 |
the set of keys. Use analz_insert_eq with (Un_upper2 RS analz_mono) to |
|
344 |
erase occurrences of forwarded message components (X). **) |
|
345 |
||
346 |
lemmas analz_image_freshK_simps = |
|
347 |
simp_thms mem_simps --{*these two allow its use with @{text "only:"}*} |
|
348 |
disj_comms |
|
349 |
image_insert [THEN sym] image_Un [THEN sym] empty_subsetI insert_subset |
|
350 |
analz_insert_eq Un_upper2 [THEN analz_mono, THEN [2] rev_subsetD] |
|
351 |
insert_Key_singleton subset_Compl_range_shrK subset_Compl_range_crdK |
|
352 |
subset_Compl_range_pin subset_Compl_range_pairK |
|
353 |
Key_not_used insert_Key_image Un_assoc [THEN sym] |
|
354 |
||
355 |
(*Lemma for the trivial direction of the if-and-only-if*) |
|
356 |
lemma analz_image_freshK_lemma: |
|
357 |
"(Key K \<in> analz (Key`nE \<union> H)) \<longrightarrow> (K \<in> nE | Key K \<in> analz H) \<Longrightarrow> |
|
358 |
(Key K \<in> analz (Key`nE \<union> H)) = (K \<in> nE | Key K \<in> analz H)" |
|
359 |
by (blast intro: analz_mono [THEN [2] rev_subsetD]) |
|
360 |
||
24122 | 361 |
|
362 |
subsection{*Tactics for possibility theorems*} |
|
363 |
||
18886 | 364 |
ML |
365 |
{* |
|
24122 | 366 |
structure Smartcard = |
367 |
struct |
|
368 |
||
369 |
(*Omitting used_Says makes the tactic much faster: it leaves expressions |
|
370 |
such as Nonce ?N \<notin> used evs that match Nonce_supply*) |
|
371 |
fun possibility_tac ctxt = |
|
372 |
(REPEAT |
|
32149
ef59550a55d3
renamed simpset_of to global_simpset_of, and local_simpset_of to simpset_of -- same for claset and clasimpset;
wenzelm
parents:
30549
diff
changeset
|
373 |
(ALLGOALS (simp_tac (simpset_of ctxt |
24122 | 374 |
delsimps [@{thm used_Says}, @{thm used_Notes}, @{thm used_Gets}, |
375 |
@{thm used_Inputs}, @{thm used_C_Gets}, @{thm used_Outpts}, @{thm used_A_Gets}] |
|
376 |
setSolver safe_solver)) |
|
377 |
THEN |
|
378 |
REPEAT_FIRST (eq_assume_tac ORELSE' |
|
379 |
resolve_tac [refl, conjI, @{thm Nonce_supply}]))) |
|
380 |
||
381 |
(*For harder protocols (such as Recur) where we have to set up some |
|
382 |
nonces and keys initially*) |
|
383 |
fun basic_possibility_tac ctxt = |
|
384 |
REPEAT |
|
32149
ef59550a55d3
renamed simpset_of to global_simpset_of, and local_simpset_of to simpset_of -- same for claset and clasimpset;
wenzelm
parents:
30549
diff
changeset
|
385 |
(ALLGOALS (asm_simp_tac (simpset_of ctxt setSolver safe_solver)) |
24122 | 386 |
THEN |
387 |
REPEAT_FIRST (resolve_tac [refl, conjI])) |
|
18886 | 388 |
|
389 |
val analz_image_freshK_ss = |
|
23894
1a4167d761ac
tactics: avoid dynamic reference to accidental theory context (via ML_Context.the_context etc.);
wenzelm
parents:
22265
diff
changeset
|
390 |
@{simpset} delsimps [image_insert, image_Un] |
32960
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32631
diff
changeset
|
391 |
delsimps [@{thm imp_disjL}] (*reduces blow-up*) |
69916a850301
eliminated hard tabulators, guessing at each author's individual tab-width;
wenzelm
parents:
32631
diff
changeset
|
392 |
addsimps @{thms analz_image_freshK_simps} |
24122 | 393 |
end |
18886 | 394 |
*} |
395 |
||
396 |
||
397 |
(*Lets blast_tac perform this step without needing the simplifier*) |
|
398 |
lemma invKey_shrK_iff [iff]: |
|
399 |
"(Key (invKey K) \<in> X) = (Key K \<in> X)" |
|
400 |
by auto |
|
401 |
||
402 |
(*Specialized methods*) |
|
403 |
||
404 |
method_setup analz_freshK = {* |
|
30549 | 405 |
Scan.succeed (fn ctxt => |
30510
4120fc59dd85
unified type Proof.method and pervasive METHOD combinators;
wenzelm
parents:
24122
diff
changeset
|
406 |
(SIMPLE_METHOD |
21588 | 407 |
(EVERY [REPEAT_FIRST (resolve_tac [allI, ballI, impI]), |
24122 | 408 |
REPEAT_FIRST (rtac @{thm analz_image_freshK_lemma}), |
409 |
ALLGOALS (asm_simp_tac (Simplifier.context ctxt Smartcard.analz_image_freshK_ss))]))) *} |
|
18886 | 410 |
"for proving the Session Key Compromise theorem" |
411 |
||
412 |
method_setup possibility = {* |
|
30549 | 413 |
Scan.succeed (fn ctxt => |
30510
4120fc59dd85
unified type Proof.method and pervasive METHOD combinators;
wenzelm
parents:
24122
diff
changeset
|
414 |
SIMPLE_METHOD (Smartcard.possibility_tac ctxt)) *} |
23894
1a4167d761ac
tactics: avoid dynamic reference to accidental theory context (via ML_Context.the_context etc.);
wenzelm
parents:
22265
diff
changeset
|
415 |
"for proving possibility theorems" |
1a4167d761ac
tactics: avoid dynamic reference to accidental theory context (via ML_Context.the_context etc.);
wenzelm
parents:
22265
diff
changeset
|
416 |
|
1a4167d761ac
tactics: avoid dynamic reference to accidental theory context (via ML_Context.the_context etc.);
wenzelm
parents:
22265
diff
changeset
|
417 |
method_setup basic_possibility = {* |
30549 | 418 |
Scan.succeed (fn ctxt => |
30510
4120fc59dd85
unified type Proof.method and pervasive METHOD combinators;
wenzelm
parents:
24122
diff
changeset
|
419 |
SIMPLE_METHOD (Smartcard.basic_possibility_tac ctxt)) *} |
18886 | 420 |
"for proving possibility theorems" |
421 |
||
422 |
lemma knows_subset_knows_Cons: "knows A evs \<subseteq> knows A (e # evs)" |
|
23894
1a4167d761ac
tactics: avoid dynamic reference to accidental theory context (via ML_Context.the_context etc.);
wenzelm
parents:
22265
diff
changeset
|
423 |
by (induct e) (auto simp: knows_Cons) |
18886 | 424 |
|
425 |
(*Needed for actual protocols that will follow*) |
|
426 |
declare shrK_disj_crdK[THEN not_sym, iff] |
|
427 |
declare shrK_disj_pin[THEN not_sym, iff] |
|
428 |
declare pairK_disj_shrK[THEN not_sym, iff] |
|
429 |
declare pairK_disj_crdK[THEN not_sym, iff] |
|
430 |
declare pairK_disj_pin[THEN not_sym, iff] |
|
431 |
declare crdK_disj_pin[THEN not_sym, iff] |
|
432 |
||
433 |
declare legalUse_def [iff] illegalUse_def [iff] |
|
434 |
||
435 |
end |