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