author | paulson |
Thu, 02 Jul 1998 17:48:11 +0200 | |
changeset 5114 | c729d4c299c1 |
parent 5076 | fbc9d95b62ba |
child 5223 | 4cb05273f764 |
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 |
|
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
6 |
Theory of events for security protocols |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
7 |
|
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
8 |
Datatype of events; function "sees"; freshness |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
9 |
*) |
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 |
open Event; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
12 |
|
3683 | 13 |
AddIffs [Spy_in_bad, Server_not_bad]; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
14 |
|
3683 | 15 |
(**** Function "spies" ****) |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
16 |
|
3683 | 17 |
(** Simplifying parts (insert X (spies evs)) |
18 |
= parts {X} Un parts (spies evs) -- since general case loops*) |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
19 |
|
3683 | 20 |
bind_thm ("parts_insert_spies", |
21 |
parts_insert |> |
|
22 |
read_instantiate_sg (sign_of thy) [("H", "spies evs")]); |
|
3678 | 23 |
|
24 |
||
5114
c729d4c299c1
Deleted leading parameters thanks to new Goal command
paulson
parents:
5076
diff
changeset
|
25 |
Goal "P(event_case sf nf ev) = \ |
3683 | 26 |
\ ((ALL A B X. ev = Says A B X --> P(sf A B X)) & \ |
27 |
\ (ALL A X. ev = Notes A X --> P(nf A X)))"; |
|
28 |
by (induct_tac "ev" 1); |
|
4477
b3e5857d8d99
New Auto_tac (by Oheimb), and new syntax (without parens), and expandshort
paulson
parents:
4266
diff
changeset
|
29 |
by Auto_tac; |
3683 | 30 |
qed "expand_event_case"; |
3678 | 31 |
|
5076 | 32 |
Goal "spies (Says A B X # evs) = insert X (spies evs)"; |
3683 | 33 |
by (Simp_tac 1); |
34 |
qed "spies_Says"; |
|
3678 | 35 |
|
3683 | 36 |
(*The point of letting the Spy see "bad" agents' notes is to prevent |
37 |
redundant case-splits on whether A=Spy and whether A:bad*) |
|
5076 | 38 |
Goal "spies (Notes A X # evs) = \ |
3683 | 39 |
\ (if A:bad then insert X (spies evs) else spies evs)"; |
40 |
by (Simp_tac 1); |
|
41 |
qed "spies_Notes"; |
|
3678 | 42 |
|
5076 | 43 |
Goal "spies evs <= spies (Says A B X # evs)"; |
4091 | 44 |
by (simp_tac (simpset() addsimps [subset_insertI]) 1); |
3683 | 45 |
qed "spies_subset_spies_Says"; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
46 |
|
5076 | 47 |
Goal "spies evs <= spies (Notes A X # evs)"; |
4686 | 48 |
by (Simp_tac 1); |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
49 |
by (Fast_tac 1); |
3683 | 50 |
qed "spies_subset_spies_Notes"; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
51 |
|
3678 | 52 |
(*Spy sees all traffic*) |
5076 | 53 |
Goal "Says A B X : set evs --> X : spies evs"; |
3667 | 54 |
by (induct_tac "evs" 1); |
4686 | 55 |
by (ALLGOALS (asm_simp_tac (simpset() addsplits [expand_event_case]))); |
3683 | 56 |
qed_spec_mp "Says_imp_spies"; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
57 |
|
3683 | 58 |
(*Spy sees Notes of bad agents*) |
5076 | 59 |
Goal "Notes A X : set evs --> A: bad --> X : spies evs"; |
3678 | 60 |
by (induct_tac "evs" 1); |
4686 | 61 |
by (ALLGOALS (asm_simp_tac (simpset() addsplits [expand_event_case]))); |
3683 | 62 |
qed_spec_mp "Notes_imp_spies"; |
3678 | 63 |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
64 |
(*Use with addSEs to derive contradictions from old Says events containing |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
65 |
items known to be fresh*) |
3683 | 66 |
val spies_partsEs = make_elim (Says_imp_spies RS parts.Inj) :: partsEs; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
67 |
|
3683 | 68 |
Addsimps [spies_Says, spies_Notes]; |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
69 |
|
3683 | 70 |
(**** NOTE REMOVAL--laws above are cleaner, as they don't involve "case" ****) |
71 |
Delsimps [spies_Cons]; |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
72 |
|
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
73 |
|
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
74 |
(*** Fresh nonces ***) |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
75 |
|
5076 | 76 |
Goal "parts (spies evs) <= used evs"; |
3683 | 77 |
by (induct_tac "evs" 1); |
78 |
by (ALLGOALS (asm_simp_tac |
|
4091 | 79 |
(simpset() addsimps [parts_insert_spies] |
4686 | 80 |
addsplits [expand_event_case]))); |
3683 | 81 |
by (ALLGOALS Blast_tac); |
3701
6f0ed3eef1a9
Names and saves the theorem parts_spies_subset_used
paulson
parents:
3683
diff
changeset
|
82 |
qed "parts_spies_subset_used"; |
6f0ed3eef1a9
Names and saves the theorem parts_spies_subset_used
paulson
parents:
3683
diff
changeset
|
83 |
|
6f0ed3eef1a9
Names and saves the theorem parts_spies_subset_used
paulson
parents:
3683
diff
changeset
|
84 |
bind_thm ("usedI", impOfSubs parts_spies_subset_used); |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
85 |
AddIs [usedI]; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
86 |
|
5076 | 87 |
Goal "parts (initState B) <= used evs"; |
3683 | 88 |
by (induct_tac "evs" 1); |
89 |
by (ALLGOALS (asm_simp_tac |
|
4091 | 90 |
(simpset() addsimps [parts_insert_spies] |
4686 | 91 |
addsplits [expand_event_case]))); |
3683 | 92 |
by (ALLGOALS Blast_tac); |
93 |
bind_thm ("initState_into_used", impOfSubs (result())); |
|
94 |
||
5076 | 95 |
Goal "used (Says A B X # evs) = parts{X} Un used evs"; |
3683 | 96 |
by (Simp_tac 1); |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
97 |
qed "used_Says"; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
98 |
Addsimps [used_Says]; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
99 |
|
5076 | 100 |
Goal "used (Notes A X # evs) = parts{X} Un used evs"; |
3683 | 101 |
by (Simp_tac 1); |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
102 |
qed "used_Notes"; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
103 |
Addsimps [used_Notes]; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
104 |
|
5076 | 105 |
Goal "used [] <= used evs"; |
3683 | 106 |
by (Simp_tac 1); |
4091 | 107 |
by (blast_tac (claset() addIs [initState_into_used]) 1); |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
108 |
qed "used_nil_subset"; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
109 |
|
3683 | 110 |
(**** NOTE REMOVAL--laws above are cleaner, as they don't involve "case" ****) |
111 |
Delsimps [used_Nil, used_Cons]; |
|
112 |
||
113 |
||
114 |
(*currently unused*) |
|
5076 | 115 |
Goal "used evs <= used (evs@evs')"; |
3683 | 116 |
by (induct_tac "evs" 1); |
4091 | 117 |
by (simp_tac (simpset() addsimps [used_nil_subset]) 1); |
3667 | 118 |
by (induct_tac "a" 1); |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
119 |
by (ALLGOALS Asm_simp_tac); |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
120 |
by (ALLGOALS Blast_tac); |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
121 |
qed "used_subset_append"; |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
122 |
|
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
123 |
|
3683 | 124 |
(*For proving theorems of the form X ~: analz (spies evs) --> P |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
125 |
New events added by induction to "evs" are discarded. Provided |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
126 |
this information isn't needed, the proof will be much shorter, since |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
127 |
it will omit complicated reasoning about analz.*) |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
128 |
val analz_mono_contra_tac = |
4266 | 129 |
let val analz_impI = read_instantiate_sg (sign_of thy) |
130 |
[("P", "?Y ~: analz (spies ?evs)")] impI; |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
131 |
in |
4266 | 132 |
rtac analz_impI THEN' |
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
133 |
REPEAT1 o |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
134 |
(dresolve_tac |
3683 | 135 |
[spies_subset_spies_Says RS analz_mono RS contra_subsetD, |
136 |
spies_subset_spies_Notes RS analz_mono RS contra_subsetD]) |
|
3512
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
137 |
THEN' |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
138 |
mp_tac |
9dcb4daa15e8
Moving common declarations and proofs from theories "Shared"
paulson
parents:
diff
changeset
|
139 |
end; |