src/HOL/Auth/Shared.ML
changeset 2124 9677fdf5fc23
parent 2109 fabc35243cea
child 2132 aeba09ebd8bc
equal deleted inserted replaced
2123:959f791b6f0f 2124:9677fdf5fc23
   115 by (list.induct_tac "evs" 1);
   115 by (list.induct_tac "evs" 1);
   116 by (Auto_tac());
   116 by (Auto_tac());
   117 qed "Spy_sees_lost";
   117 qed "Spy_sees_lost";
   118 
   118 
   119 AddSIs [sees_own_shrK, Spy_sees_lost];
   119 AddSIs [sees_own_shrK, Spy_sees_lost];
       
   120 
       
   121 (*Added for Yahalom/lost_tac*)
       
   122 goal thy "!!A. [| Crypt X (shrK A) : analz (sees lost Spy evs);  A: lost |] \
       
   123 \              ==> X : analz (sees lost Spy evs)";
       
   124 by (fast_tac (!claset addSDs [analz.Decrypt] addss (!simpset)) 1);
       
   125 qed "Crypt_Spy_analz_lost";
   120 
   126 
   121 (** Specialized rewrite rules for (sees lost A (Says...#evs)) **)
   127 (** Specialized rewrite rules for (sees lost A (Says...#evs)) **)
   122 
   128 
   123 goal thy "sees lost B (Says A B X # evs) = insert X (sees lost B evs)";
   129 goal thy "sees lost B (Says A B X # evs) = insert X (sees lost B evs)";
   124 by (Simp_tac 1);
   130 by (Simp_tac 1);
   240 fun safe_solver prems =
   246 fun safe_solver prems =
   241     match_tac (TrueI::refl::prems) ORELSE' eq_assume_tac
   247     match_tac (TrueI::refl::prems) ORELSE' eq_assume_tac
   242     ORELSE' etac FalseE;
   248     ORELSE' etac FalseE;
   243 
   249 
   244 (*Analysis of Fake cases and of messages that forward unknown parts
   250 (*Analysis of Fake cases and of messages that forward unknown parts
   245   Abstraction over i is ESSENTIAL: it delays the dereferencing of claset*)
   251   Abstraction over i is ESSENTIAL: it delays the dereferencing of claset
       
   252   DEPENDS UPON "X" REFERRING TO THE FRADULENT MESSAGE *)
   246 fun spy_analz_tac i =
   253 fun spy_analz_tac i =
   247   SELECT_GOAL 
   254   SELECT_GOAL 
   248    (EVERY [  (*push in occurrences of X...*)
   255    (EVERY [  (*push in occurrences of X...*)
   249            (REPEAT o CHANGED)
   256            (REPEAT o CHANGED)
   250              (res_inst_tac [("x1","X")] (insert_commute RS ssubst) 1),
   257              (res_inst_tac [("x1","X")] (insert_commute RS ssubst) 1),
   251              (*...allowing further simplifications*)
   258              (*...allowing further simplifications*)
   252            simp_tac (!simpset setloop split_tac [expand_if]) 1,
   259            simp_tac (!simpset setloop split_tac [expand_if]) 1,
   253            REPEAT (resolve_tac [impI,notI] 1),
   260            REPEAT (resolve_tac [allI,impI,notI] 1),
   254            dtac (impOfSubs Fake_analz_insert) 1,
   261            dtac (impOfSubs Fake_analz_insert) 1,
   255            eresolve_tac [asm_rl, synth.Inj] 1,
   262            eresolve_tac [asm_rl, synth.Inj] 1,
   256            Fast_tac 1,
   263            Fast_tac 1,
   257            Asm_full_simp_tac 1,
   264            Asm_full_simp_tac 1,
   258            IF_UNSOLVED (deepen_tac (!claset addIs [impOfSubs analz_mono]) 0 1)
   265            IF_UNSOLVED (depth_tac (!claset addIs [impOfSubs analz_mono]) 2 1)
   259            ]) i;
   266            ]) i;
   260 
   267 
   261 
   268 
   262 (** Simplifying   parts (insert X (sees lost A evs))
   269 (** Simplifying   parts (insert X (sees lost A evs))
   263       = parts {X} Un parts (sees lost A evs) -- since general case loops*)
   270       = parts {X} Un parts (sees lost A evs) -- since general case loops*)
   274 by (rtac (invKey_eq RS iffD1) 1);
   281 by (rtac (invKey_eq RS iffD1) 1);
   275 by (Simp_tac 1);
   282 by (Simp_tac 1);
   276 val newK_invKey = result();
   283 val newK_invKey = result();
   277 
   284 
   278 AddSDs [newK_invKey];
   285 AddSDs [newK_invKey];
       
   286 AddSDs [sym RS newK_invKey];
   279 
   287 
   280 Delsimps [image_insert];
   288 Delsimps [image_insert];
   281 Addsimps [image_insert RS sym];
   289 Addsimps [image_insert RS sym];
   282 
   290 
   283 Delsimps [image_Un];
   291 Delsimps [image_Un];
   299 \        (Key K : analz (Key``nE Un H)) = (K : nE | Key K : analz H)";
   307 \        (Key K : analz (Key``nE Un H)) = (K : nE | Key K : analz H)";
   300 by (fast_tac (!claset addSEs [impOfSubs analz_mono]) 1);
   308 by (fast_tac (!claset addSEs [impOfSubs analz_mono]) 1);
   301 qed "analz_image_newK_lemma";
   309 qed "analz_image_newK_lemma";
   302 
   310 
   303 
   311 
       
   312 (*Useful in many uniqueness proofs*)
       
   313 fun ex_strip_tac i = REPEAT (ares_tac [exI, conjI] i) THEN assume_tac (i+1);
       
   314