src/HOL/Auth/Yahalom2.ML
changeset 2170 c5e460f1ebb4
parent 2160 ad4382e546fc
child 2264 f298678bd54a
equal deleted inserted replaced
2169:31ba286f2307 2170:c5e460f1ebb4
    78     forw_inst_tac [("lost","lost")] YM4_Key_parts_sees_Spy 7;
    78     forw_inst_tac [("lost","lost")] YM4_Key_parts_sees_Spy 7;
    79 
    79 
    80 (*For proving the easier theorems about X ~: parts (sees lost Spy evs) *)
    80 (*For proving the easier theorems about X ~: parts (sees lost Spy evs) *)
    81 fun parts_induct_tac i = SELECT_GOAL
    81 fun parts_induct_tac i = SELECT_GOAL
    82     (DETERM (etac yahalom.induct 1 THEN parts_Fake_tac THEN
    82     (DETERM (etac yahalom.induct 1 THEN parts_Fake_tac THEN
    83 	     (*Fake message*)
    83              (*Fake message*)
    84 	     TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts,
    84              TRY (best_tac (!claset addDs [impOfSubs analz_subset_parts,
    85 					   impOfSubs Fake_parts_insert]
    85                                            impOfSubs Fake_parts_insert]
    86                                     addss (!simpset)) 2)) THEN
    86                                     addss (!simpset)) 2)) THEN
    87      (*Base case*)
    87      (*Base case*)
    88      fast_tac (!claset addss (!simpset)) 1 THEN
    88      fast_tac (!claset addss (!simpset)) 1 THEN
    89      ALLGOALS Asm_simp_tac) i;
    89      ALLGOALS Asm_simp_tac) i;
    90 
    90 
   155   ...very like new_keys_not_seen*)
   155   ...very like new_keys_not_seen*)
   156 goal thy "!!evs. evs : yahalom lost ==> \
   156 goal thy "!!evs. evs : yahalom lost ==> \
   157 \                length evs <= length evs' --> \
   157 \                length evs <= length evs' --> \
   158 \                newK evs' ~: keysFor (parts (sees lost Spy evs))";
   158 \                newK evs' ~: keysFor (parts (sees lost Spy evs))";
   159 by (parts_induct_tac 1);
   159 by (parts_induct_tac 1);
   160 by (dresolve_tac [YM4_Key_parts_sees_Spy] 5);
   160 by (dtac YM4_Key_parts_sees_Spy 5);
   161 (*YM1, YM2 and YM3*)
   161 (*YM1, YM2 and YM3*)
   162 by (EVERY (map (fast_tac (!claset addDs [Suc_leD] addss (!simpset))) [4,3,2]));
   162 by (EVERY (map (fast_tac (!claset addDs [Suc_leD] addss (!simpset))) [4,3,2]));
   163 (*Fake and Oops: these messages send unknown (X) components*)
   163 (*Fake and Oops: these messages send unknown (X) components*)
   164 by (EVERY
   164 by (EVERY
   165     (map (fast_tac
   165     (map (fast_tac
   166 	  (!claset addDs [impOfSubs analz_subset_parts,
   166           (!claset addDs [impOfSubs analz_subset_parts,
   167 			  impOfSubs (analz_subset_parts RS keysFor_mono),
   167                           impOfSubs (analz_subset_parts RS keysFor_mono),
   168 			  impOfSubs (parts_insert_subset_Un RS keysFor_mono),
   168                           impOfSubs (parts_insert_subset_Un RS keysFor_mono),
   169 			  Suc_leD]
   169                           Suc_leD]
   170                    addss (!simpset))) [3,1]));
   170                    addss (!simpset))) [3,1]));
   171 (*YM4: if K was used then it had been seen, contradicting new_keys_not_seen*)
   171 (*YM4: if K was used then it had been seen, contradicting new_keys_not_seen*)
   172 by (fast_tac
   172 by (fast_tac
   173       (!claset addSEs partsEs
   173       (!claset addSEs partsEs
   174                addSDs [Says_imp_sees_Spy RS parts.Inj]
   174                addSDs [Says_imp_sees_Spy RS parts.Inj]
   305                       addss (!simpset)) 2);
   305                       addss (!simpset)) 2);
   306 (*OR4, Fake*) 
   306 (*OR4, Fake*) 
   307 by (REPEAT_FIRST (resolve_tac [conjI, impI] ORELSE' spy_analz_tac));
   307 by (REPEAT_FIRST (resolve_tac [conjI, impI] ORELSE' spy_analz_tac));
   308 (*Oops*)
   308 (*Oops*)
   309 by (fast_tac (!claset delrules [disjE] 
   309 by (fast_tac (!claset delrules [disjE] 
   310 		      addDs [unique_session_keys]
   310                       addDs [unique_session_keys]
   311 	              addss (!simpset)) 1);
   311                       addss (!simpset)) 1);
   312 val lemma = result() RS mp RS mp RSN(2,rev_notE);
   312 val lemma = result() RS mp RS mp RSN(2,rev_notE);
   313 
   313 
   314 
   314 
   315 (*Final version: Server's message in the most abstract form*)
   315 (*Final version: Server's message in the most abstract form*)
   316 goal thy 
   316 goal thy 
   390 \        ==> EX NA. Says Server A                                       \
   390 \        ==> EX NA. Says Server A                                       \
   391 \                    {|Nonce NB,                                        \
   391 \                    {|Nonce NB,                                        \
   392 \                      Crypt {|Agent B, Key K, Nonce NA|} (shrK A),     \
   392 \                      Crypt {|Agent B, Key K, Nonce NA|} (shrK A),     \
   393 \                      Crypt {|Nonce NB, Key K, Agent A|} (shrK B)|}    \
   393 \                      Crypt {|Nonce NB, Key K, Agent A|} (shrK B)|}    \
   394 \                   : set_of_list evs";
   394 \                   : set_of_list evs";
   395 be (Says_imp_sees_Spy RS parts.Inj RS MPair_parts) 1;
   395 by (etac (Says_imp_sees_Spy RS parts.Inj RS MPair_parts) 1);
   396 by (fast_tac (!claset addSDs [B_trusts_YM4_shrK]) 1);
   396 by (fast_tac (!claset addSDs [B_trusts_YM4_shrK]) 1);
   397 qed "B_trust_YM4";
   397 qed "B_trust_YM4";