src/HOL/Auth/Message.ML
author paulson
Fri, 26 Jul 1996 12:19:46 +0200
changeset 1885 a18a6dc14f76
parent 1852 289ce6cb5c84
child 1893 fa58f4a06f21
permissions -rw-r--r--
Auth proofs work up to the XXX...
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/Message
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     2
    ID:         $Id$
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     5
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     6
Datatypes of agents and messages;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     7
Inductive relations "parts", "analyze" and "synthesize"
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     8
*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
     9
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    10
open Message;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    11
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    12
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    13
(**************** INSTALL CENTRALLY SOMEWHERE? ****************)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    14
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    15
(*Maybe swap the safe_tac and simp_tac lines?**)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    16
fun auto_tac (cs,ss) = 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    17
    TRY (safe_tac cs) THEN 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    18
    ALLGOALS (asm_full_simp_tac ss) THEN
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    19
    REPEAT (FIRSTGOAL (best_tac (cs addss ss)));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    20
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    21
fun Auto_tac() = auto_tac (!claset, !simpset);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    22
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    23
fun auto() = by (Auto_tac());
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    24
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
    25
fun impOfSubs th = th RSN (2, rev_subsetD);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    26
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    27
(**************** INSTALL CENTRALLY SOMEWHERE? ****************)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    28
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    29
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    30
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    31
(** Inverse of keys **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    32
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    33
goal thy "!!K K'. (invKey K = invKey K') = (K=K')";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    34
by (Step_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    35
br box_equals 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    36
by (REPEAT (rtac invKey 2));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    37
by (Asm_simp_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    38
qed "invKey_eq";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    39
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    40
Addsimps [invKey, invKey_eq];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    41
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    42
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    43
(**** keysFor operator ****)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    44
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    45
goalw thy [keysFor_def] "keysFor {} = {}";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    46
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    47
qed "keysFor_empty";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    48
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    49
goalw thy [keysFor_def] "keysFor (H Un H') = keysFor H Un keysFor H'";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    50
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    51
qed "keysFor_Un";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    52
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    53
goalw thy [keysFor_def] "keysFor (UN i. H i) = (UN i. keysFor (H i))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    54
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    55
qed "keysFor_UN";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    56
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    57
(*Monotonicity*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    58
goalw thy [keysFor_def] "!!G H. G<=H ==> keysFor(G) <= keysFor(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    59
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    60
qed "keysFor_mono";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    61
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    62
goalw thy [keysFor_def] "keysFor (insert (Agent A) H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    63
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    64
qed "keysFor_insert_Agent";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    65
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    66
goalw thy [keysFor_def] "keysFor (insert (Nonce N) H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    67
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    68
qed "keysFor_insert_Nonce";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    69
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    70
goalw thy [keysFor_def] "keysFor (insert (Key K) H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    71
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    72
qed "keysFor_insert_Key";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    73
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    74
goalw thy [keysFor_def] "keysFor (insert {|X,Y|} H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    75
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    76
qed "keysFor_insert_MPair";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    77
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    78
goalw thy [keysFor_def]
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    79
    "keysFor (insert (Crypt X K) H) = insert (invKey K) (keysFor H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    80
by (Auto_tac());
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    81
by (fast_tac (!claset addIs [image_eqI]) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    82
qed "keysFor_insert_Crypt";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    83
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    84
Addsimps [keysFor_empty, keysFor_Un, keysFor_UN, 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    85
	  keysFor_insert_Agent, keysFor_insert_Nonce,
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    86
	  keysFor_insert_Key, keysFor_insert_MPair,
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    87
	  keysFor_insert_Crypt];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    88
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    89
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    90
(**** Inductive relation "parts" ****)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    91
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    92
val major::prems = 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    93
goal thy "[| {|X,Y|} : parts H;       \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    94
\            [| X : parts H; Y : parts H |] ==> P  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    95
\         |] ==> P";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    96
by (cut_facts_tac [major] 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    97
brs prems 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    98
by (REPEAT (eresolve_tac [asm_rl, parts.Fst, parts.Snd] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    99
qed "MPair_parts";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   100
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   101
AddIs  [parts.Inj];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   102
AddSEs [MPair_parts];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   103
AddDs  [parts.Body];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   104
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   105
goal thy "H <= parts(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   106
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   107
qed "parts_increasing";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   108
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   109
(*Monotonicity*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   110
goalw thy parts.defs "!!G H. G<=H ==> parts(G) <= parts(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   111
by (rtac lfp_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   112
by (REPEAT (ares_tac basic_monos 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   113
qed "parts_mono";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   114
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   115
goal thy "parts{} = {}";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   116
by (Step_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   117
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   118
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   119
qed "parts_empty";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   120
Addsimps [parts_empty];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   121
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   122
goal thy "!!X. X: parts{} ==> P";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   123
by (Asm_full_simp_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   124
qed "parts_emptyE";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   125
AddSEs [parts_emptyE];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   126
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   127
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   128
(** Unions **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   129
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   130
goal thy "parts(G) Un parts(H) <= parts(G Un H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   131
by (REPEAT (ares_tac [Un_least, parts_mono, Un_upper1, Un_upper2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   132
val parts_Un_subset1 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   133
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   134
goal thy "parts(G Un H) <= parts(G) Un parts(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   135
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   136
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   137
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   138
val parts_Un_subset2 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   139
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   140
goal thy "parts(G Un H) = parts(G) Un parts(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   141
by (REPEAT (ares_tac [equalityI, parts_Un_subset1, parts_Un_subset2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   142
qed "parts_Un";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   143
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   144
(*TWO inserts to avoid looping.  This rewrite is better than nothing...*)
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   145
goal thy "parts (insert X (insert Y H)) = parts {X} Un parts {Y} Un parts H";
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   146
by (stac (read_instantiate [("A","H")] insert_is_Un) 1);
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   147
by (stac (read_instantiate [("A","{Y} Un H")] insert_is_Un) 1);
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   148
by (simp_tac (HOL_ss addsimps [parts_Un, Un_assoc]) 1);
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   149
qed "parts_insert2";
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   150
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   151
goal thy "(UN x:A. parts(H x)) <= parts(UN x:A. H x)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   152
by (REPEAT (ares_tac [UN_least, parts_mono, UN_upper] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   153
val parts_UN_subset1 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   154
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   155
goal thy "parts(UN x:A. H x) <= (UN x:A. parts(H x))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   156
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   157
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   158
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   159
val parts_UN_subset2 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   160
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   161
goal thy "parts(UN x:A. H x) = (UN x:A. parts(H x))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   162
by (REPEAT (ares_tac [equalityI, parts_UN_subset1, parts_UN_subset2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   163
qed "parts_UN";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   164
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   165
goal thy "parts(UN x. H x) = (UN x. parts(H x))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   166
by (simp_tac (!simpset addsimps [UNION1_def, parts_UN]) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   167
qed "parts_UN1";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   168
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   169
(*Added to simplify arguments to parts, analyze and synthesize*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   170
Addsimps [parts_Un, parts_UN, parts_UN1];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   171
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   172
goal thy "insert X (parts H) <= parts(insert X H)";
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   173
by (fast_tac (!claset addEs [impOfSubs parts_mono]) 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   174
qed "parts_insert_subset";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   175
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   176
(*Especially for reasoning about the Fake rule in traces*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   177
goal thy "!!Y. X: G ==> parts(insert X H) <= parts G Un parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   178
br ([parts_mono, parts_Un_subset2] MRS subset_trans) 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   179
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   180
qed "parts_insert_subset_Un";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   181
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   182
(** Idempotence and transitivity **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   183
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   184
goal thy "!!H. X: parts (parts H) ==> X: parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   185
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   186
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   187
qed "parts_partsE";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   188
AddSEs [parts_partsE];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   189
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   190
goal thy "parts (parts H) = parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   191
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   192
qed "parts_idem";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   193
Addsimps [parts_idem];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   194
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   195
goal thy "!!H. [| X: parts G;  G <= parts H |] ==> X: parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   196
by (dtac parts_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   197
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   198
qed "parts_trans";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   199
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   200
(*Cut*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   201
goal thy "!!H. [| X: parts H;  Y: parts (insert X H) |] ==> Y: parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   202
be parts_trans 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   203
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   204
qed "parts_cut";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   205
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   206
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   207
(** Rewrite rules for pulling out atomic messages **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   208
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   209
goal thy "parts (insert (Agent agt) H) = insert (Agent agt) (parts H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   210
by (rtac (parts_insert_subset RSN (2, equalityI)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   211
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   212
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   213
(*Simplification breaks up equalities between messages;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   214
  how to make it work for fast_tac??*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   215
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   216
qed "parts_insert_Agent";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   217
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   218
goal thy "parts (insert (Nonce N) H) = insert (Nonce N) (parts H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   219
by (rtac (parts_insert_subset RSN (2, equalityI)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   220
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   221
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   222
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   223
qed "parts_insert_Nonce";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   224
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   225
goal thy "parts (insert (Key K) H) = insert (Key K) (parts H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   226
by (rtac (parts_insert_subset RSN (2, equalityI)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   227
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   228
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   229
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   230
qed "parts_insert_Key";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   231
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   232
goal thy "parts (insert (Crypt X K) H) = \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   233
\         insert (Crypt X K) (parts (insert X H))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   234
br equalityI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   235
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   236
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   237
by (Auto_tac());
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   238
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   239
by (ALLGOALS (best_tac (!claset addIs [parts.Body])));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   240
qed "parts_insert_Crypt";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   241
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   242
goal thy "parts (insert {|X,Y|} H) = \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   243
\         insert {|X,Y|} (parts (insert X (insert Y H)))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   244
br equalityI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   245
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   246
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   247
by (Auto_tac());
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   248
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   249
by (ALLGOALS (best_tac (!claset addIs [parts.Fst, parts.Snd])));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   250
qed "parts_insert_MPair";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   251
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   252
Addsimps [parts_insert_Agent, parts_insert_Nonce, 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   253
	  parts_insert_Key, parts_insert_Crypt, parts_insert_MPair];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   254
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   255
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   256
(**** Inductive relation "analyze" ****)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   257
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   258
val major::prems = 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   259
goal thy "[| {|X,Y|} : analyze H;       \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   260
\            [| X : analyze H; Y : analyze H |] ==> P  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   261
\         |] ==> P";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   262
by (cut_facts_tac [major] 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   263
brs prems 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   264
by (REPEAT (eresolve_tac [asm_rl, analyze.Fst, analyze.Snd] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   265
qed "MPair_analyze";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   266
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   267
AddIs  [analyze.Inj];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   268
AddSEs [MPair_analyze];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   269
AddDs  [analyze.Decrypt];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   270
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   271
Addsimps [analyze.Inj];
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   272
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   273
goal thy "H <= analyze(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   274
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   275
qed "analyze_increasing";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   276
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   277
goal thy "analyze H <= parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   278
by (rtac subsetI 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   279
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   280
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   281
qed "analyze_subset_parts";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   282
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   283
bind_thm ("not_parts_not_analyze", analyze_subset_parts RS contra_subsetD);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   284
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   285
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   286
goal thy "parts (analyze H) = parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   287
br equalityI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   288
br (analyze_subset_parts RS parts_mono RS subset_trans) 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   289
by (Simp_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   290
by (fast_tac (!claset addDs [analyze_increasing RS parts_mono RS subsetD]) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   291
qed "parts_analyze";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   292
Addsimps [parts_analyze];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   293
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   294
goal thy "analyze (parts H) = parts H";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   295
by (Auto_tac());
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   296
be analyze.induct 1;
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   297
by (Auto_tac());
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   298
qed "analyze_parts";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   299
Addsimps [analyze_parts];
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   300
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   301
(*Monotonicity; Lemma 1 of Lowe*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   302
goalw thy analyze.defs "!!G H. G<=H ==> analyze(G) <= analyze(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   303
by (rtac lfp_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   304
by (REPEAT (ares_tac basic_monos 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   305
qed "analyze_mono";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   306
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   307
(** General equational properties **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   308
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   309
goal thy "analyze{} = {}";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   310
by (Step_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   311
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   312
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   313
qed "analyze_empty";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   314
Addsimps [analyze_empty];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   315
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   316
(*Converse fails: we can analyze more from the union than from the 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   317
  separate parts, as a key in one might decrypt a message in the other*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   318
goal thy "analyze(G) Un analyze(H) <= analyze(G Un H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   319
by (REPEAT (ares_tac [Un_least, analyze_mono, Un_upper1, Un_upper2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   320
qed "analyze_Un";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   321
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   322
goal thy "insert X (analyze H) <= analyze(insert X H)";
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   323
by (fast_tac (!claset addEs [impOfSubs analyze_mono]) 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   324
qed "analyze_insert";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   325
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   326
(** Rewrite rules for pulling out atomic messages **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   327
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   328
goal thy "analyze (insert (Agent agt) H) = insert (Agent agt) (analyze H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   329
by (rtac (analyze_insert RSN (2, equalityI)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   330
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   331
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   332
(*Simplification breaks up equalities between messages;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   333
  how to make it work for fast_tac??*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   334
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   335
qed "analyze_insert_Agent";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   336
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   337
goal thy "analyze (insert (Nonce N) H) = insert (Nonce N) (analyze H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   338
by (rtac (analyze_insert RSN (2, equalityI)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   339
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   340
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   341
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   342
qed "analyze_insert_Nonce";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   343
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   344
(*Can only pull out Keys if they are not needed to decrypt the rest*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   345
goalw thy [keysFor_def]
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   346
    "!!K. K ~: keysFor (analyze H) ==>  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   347
\         analyze (insert (Key K) H) = insert (Key K) (analyze H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   348
by (rtac (analyze_insert RSN (2, equalityI)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   349
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   350
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   351
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   352
qed "analyze_insert_Key";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   353
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   354
goal thy "analyze (insert {|X,Y|} H) = \
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   355
\         insert {|X,Y|} (analyze (insert X (insert Y H)))";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   356
br equalityI 1;
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   357
br subsetI 1;
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   358
be analyze.induct 1;
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   359
by (Auto_tac());
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   360
be analyze.induct 1;
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   361
by (ALLGOALS (deepen_tac (!claset addIs [analyze.Fst, analyze.Snd, analyze.Decrypt]) 0));
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   362
qed "analyze_insert_MPair";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   363
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   364
(*Can pull out enCrypted message if the Key is not known*)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   365
goal thy "!!H. Key (invKey K) ~: analyze H ==>  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   366
\              analyze (insert (Crypt X K) H) = \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   367
\              insert (Crypt X K) (analyze H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   368
by (rtac (analyze_insert RSN (2, equalityI)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   369
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   370
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   371
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   372
qed "analyze_insert_Crypt";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   373
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   374
goal thy "!!H. Key (invKey K) : analyze H ==>  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   375
\              analyze (insert (Crypt X K) H) <= \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   376
\              insert (Crypt X K) (analyze (insert X H))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   377
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   378
by (eres_inst_tac [("za","x")] analyze.induct 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   379
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   380
val lemma1 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   381
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   382
goal thy "!!H. Key (invKey K) : analyze H ==>  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   383
\              insert (Crypt X K) (analyze (insert X H)) <= \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   384
\              analyze (insert (Crypt X K) H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   385
by (Auto_tac());
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   386
by (eres_inst_tac [("za","x")] analyze.induct 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   387
by (Auto_tac());
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   388
by (best_tac (!claset addIs [subset_insertI RS analyze_mono RS subsetD,
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   389
			     analyze.Decrypt]) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   390
val lemma2 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   391
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   392
goal thy "!!H. Key (invKey K) : analyze H ==>  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   393
\              analyze (insert (Crypt X K) H) = \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   394
\              insert (Crypt X K) (analyze (insert X H))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   395
by (REPEAT (ares_tac [equalityI, lemma1, lemma2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   396
qed "analyze_insert_Decrypt";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   397
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   398
(*Case analysis: either the message is secure, or it is not!
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   399
  Use with expand_if;  apparently split_tac does not cope with patterns
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   400
  such as "analyze (insert (Crypt X' K) H)" *)
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   401
goal thy "analyze (insert (Crypt X' K) H) = \
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   402
\         (if (Key (invKey K)  : analyze H) then    \
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   403
\               insert (Crypt X' K) (analyze (insert X' H)) \
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   404
\          else insert (Crypt X' K) (analyze H))";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   405
by (excluded_middle_tac "Key (invKey K)  : analyze H " 1);
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   406
by (ALLGOALS (asm_simp_tac (!simpset addsimps [analyze_insert_Crypt, 
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   407
					       analyze_insert_Decrypt])));
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   408
qed "analyze_Crypt_if";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   409
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   410
Addsimps [analyze_insert_Agent, analyze_insert_Nonce, 
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   411
	  analyze_insert_Key, analyze_insert_MPair, 
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   412
	  analyze_Crypt_if];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   413
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   414
(*This rule supposes "for the sake of argument" that we have the key.*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   415
goal thy  "analyze (insert (Crypt X K) H) <=  \
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   416
\          insert (Crypt X K) (analyze (insert X H))";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   417
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   418
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   419
by (Auto_tac());
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   420
qed "analyze_insert_Crypt_subset";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   421
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   422
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   423
(** Idempotence and transitivity **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   424
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   425
goal thy "!!H. X: analyze (analyze H) ==> X: analyze H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   426
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   427
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   428
qed "analyze_analyzeE";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   429
AddSEs [analyze_analyzeE];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   430
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   431
goal thy "analyze (analyze H) = analyze H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   432
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   433
qed "analyze_idem";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   434
Addsimps [analyze_idem];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   435
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   436
goal thy "!!H. [| X: analyze G;  G <= analyze H |] ==> X: analyze H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   437
by (dtac analyze_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   438
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   439
qed "analyze_trans";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   440
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   441
(*Cut; Lemma 2 of Lowe*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   442
goal thy "!!H. [| X: analyze H;  Y: analyze (insert X H) |] ==> Y: analyze H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   443
be analyze_trans 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   444
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   445
qed "analyze_cut";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   446
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   447
(*Cut can be proved easily by induction on
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   448
   "!!H. Y: analyze (insert X H) ==> X: analyze H --> Y: analyze H"
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   449
*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   450
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   451
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   452
(** A congruence rule for "analyze" **)
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   453
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   454
goal thy "!!H. [| analyze G <= analyze G'; analyze H <= analyze H' \
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   455
\              |] ==> analyze (G Un H) <= analyze (G' Un H')";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   456
by (Step_tac 1);
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   457
be analyze.induct 1;
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   458
by (ALLGOALS (best_tac (!claset addIs [analyze_mono RS subsetD])));
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   459
qed "analyze_subset_cong";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   460
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   461
goal thy "!!H. [| analyze G = analyze G'; analyze H = analyze H' \
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   462
\              |] ==> analyze (G Un H) = analyze (G' Un H')";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   463
by (REPEAT_FIRST (ares_tac [equalityI, analyze_subset_cong]
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   464
	  ORELSE' etac equalityE));
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   465
qed "analyze_cong";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   466
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   467
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   468
goal thy "!!H. analyze H = analyze H'  ==>    \
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   469
\              analyze (insert X H) = analyze (insert X H')";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   470
by (asm_simp_tac (!simpset addsimps [insert_def] 
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   471
		           setloop (rtac analyze_cong)) 1);
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   472
qed "analyze_insert_cong";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   473
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   474
(*If there are no pairs or encryptions then analyze does nothing*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   475
goal thy "!!H. [| ALL X Y. {|X,Y|} ~: H;  ALL X K. Crypt X K ~: H |] ==> \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   476
\         analyze H = H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   477
by (Step_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   478
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   479
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   480
qed "analyze_trivial";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   481
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   482
(*Helps to prove Fake cases*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   483
goal thy "!!X. X: analyze (UN i. analyze (H i)) ==> X: analyze (UN i. H i)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   484
be analyze.induct 1;
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   485
by (ALLGOALS (fast_tac (!claset addEs [impOfSubs analyze_mono])));
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   486
val lemma = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   487
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   488
goal thy "analyze (UN i. analyze (H i)) = analyze (UN i. H i)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   489
by (fast_tac (!claset addIs [lemma]
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   490
		      addEs [impOfSubs analyze_mono]) 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   491
qed "analyze_UN_analyze";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   492
Addsimps [analyze_UN_analyze];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   493
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   494
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   495
(**** Inductive relation "synthesize" ****)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   496
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   497
AddIs  synthesize.intrs;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   498
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   499
goal thy "H <= synthesize(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   500
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   501
qed "synthesize_increasing";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   502
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   503
(*Monotonicity*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   504
goalw thy synthesize.defs "!!G H. G<=H ==> synthesize(G) <= synthesize(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   505
by (rtac lfp_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   506
by (REPEAT (ares_tac basic_monos 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   507
qed "synthesize_mono";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   508
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   509
(** Unions **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   510
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   511
(*Converse fails: we can synthesize more from the union than from the 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   512
  separate parts, building a compound message using elements of each.*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   513
goal thy "synthesize(G) Un synthesize(H) <= synthesize(G Un H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   514
by (REPEAT (ares_tac [Un_least, synthesize_mono, Un_upper1, Un_upper2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   515
qed "synthesize_Un";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   516
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   517
goal thy "insert X (synthesize H) <= synthesize(insert X H)";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   518
by (fast_tac (!claset addEs [impOfSubs synthesize_mono]) 1);
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   519
qed "synthesize_insert";
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   520
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   521
(** Idempotence and transitivity **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   522
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   523
goal thy "!!H. X: synthesize (synthesize H) ==> X: synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   524
be synthesize.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   525
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   526
qed "synthesize_synthesizeE";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   527
AddSEs [synthesize_synthesizeE];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   528
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   529
goal thy "synthesize (synthesize H) = synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   530
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   531
qed "synthesize_idem";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   532
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   533
goal thy "!!H. [| X: synthesize G;  G <= synthesize H |] ==> X: synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   534
by (dtac synthesize_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   535
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   536
qed "synthesize_trans";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   537
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   538
(*Cut; Lemma 2 of Lowe*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   539
goal thy "!!H. [| X: synthesize H;  Y: synthesize (insert X H) \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   540
\              |] ==> Y: synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   541
be synthesize_trans 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   542
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   543
qed "synthesize_cut";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   544
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   545
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   546
(*Can only produce a nonce or key if it is already known,
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   547
  but can synthesize a pair or encryption from its components...*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   548
val mk_cases = synthesize.mk_cases msg.simps;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   549
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   550
(*NO Agent_synthesize, as any Agent name can be synthesized*)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   551
val Nonce_synthesize = mk_cases "Nonce n : synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   552
val Key_synthesize   = mk_cases "Key K : synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   553
val MPair_synthesize = mk_cases "{|X,Y|} : synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   554
val Crypt_synthesize = mk_cases "Crypt X K : synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   555
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   556
AddSEs [Nonce_synthesize, Key_synthesize, MPair_synthesize, Crypt_synthesize];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   557
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   558
goal thy "(Nonce N : synthesize H) = (Nonce N : H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   559
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   560
qed "Nonce_synthesize_eq";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   561
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   562
goal thy "(Key K : synthesize H) = (Key K : H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   563
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   564
qed "Key_synthesize_eq";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   565
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   566
Addsimps [Nonce_synthesize_eq, Key_synthesize_eq];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   567
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   568
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   569
goalw thy [keysFor_def]
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   570
    "keysFor (synthesize H) = keysFor H Un invKey``{K. Key K : H}";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   571
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   572
qed "keysFor_synthesize";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   573
Addsimps [keysFor_synthesize];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   574
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   575
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   576
(*** Combinations of parts, analyze and synthesize ***)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   577
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   578
goal thy "parts (synthesize H) = parts H Un synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   579
br equalityI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   580
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   581
be parts.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   582
by (ALLGOALS
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   583
    (best_tac (!claset addIs ((synthesize_increasing RS parts_mono RS subsetD)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   584
			     ::parts.intrs))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   585
qed "parts_synthesize";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   586
Addsimps [parts_synthesize];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   587
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   588
goal thy "analyze (synthesize H) = analyze H Un synthesize H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   589
br equalityI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   590
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   591
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   592
by (best_tac
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   593
    (!claset addIs [synthesize_increasing RS analyze_mono RS subsetD]) 5);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   594
(*Strange that best_tac just can't hack this one...*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   595
by (ALLGOALS (deepen_tac (!claset addIs analyze.intrs) 0));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   596
qed "analyze_synthesize";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   597
Addsimps [analyze_synthesize];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   598
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   599
(*Hard to prove; still needed now that there's only one Enemy?*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   600
goal thy "analyze (UN i. synthesize (H i)) = \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   601
\         analyze (UN i. H i) Un (UN i. synthesize (H i))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   602
br equalityI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   603
br subsetI 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   604
be analyze.induct 1;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   605
by (best_tac
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   606
    (!claset addEs [impOfSubs synthesize_increasing,
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   607
		    impOfSubs analyze_mono]) 5);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   608
by (Best_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   609
by (deepen_tac (!claset addIs [analyze.Fst]) 0 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   610
by (deepen_tac (!claset addIs [analyze.Snd]) 0 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   611
by (deepen_tac (!claset addSEs [analyze.Decrypt]
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   612
			addIs  [analyze.Decrypt]) 0 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   613
qed "analyze_UN1_synthesize";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   614
Addsimps [analyze_UN1_synthesize];