src/HOL/Auth/Message.ML
author paulson
Fri, 18 Oct 1996 11:33:02 +0200
changeset 2102 41a667d2c3fa
parent 2068 0d05468dc80c
child 2154 913b4fc7670a
permissions -rw-r--r--
Replaced excluded_middle_tac by case_tac
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;
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
     7
Inductive relations "parts", "analz" and "synth"
1839
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
(** Inverse of keys **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    14
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    15
goal thy "!!K K'. (invKey K = invKey K') = (K=K')";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    16
by (Step_tac 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
    17
by (rtac box_equals 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    18
by (REPEAT (rtac invKey 2));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    19
by (Asm_simp_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    20
qed "invKey_eq";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    21
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    22
Addsimps [invKey, invKey_eq];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    23
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    24
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    25
(**** keysFor operator ****)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    26
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    27
goalw thy [keysFor_def] "keysFor {} = {}";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    28
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    29
qed "keysFor_empty";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    30
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    31
goalw thy [keysFor_def] "keysFor (H Un H') = keysFor H Un keysFor H'";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    32
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    33
qed "keysFor_Un";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    34
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    35
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
    36
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    37
qed "keysFor_UN";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    38
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    39
(*Monotonicity*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    40
goalw thy [keysFor_def] "!!G H. G<=H ==> keysFor(G) <= keysFor(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    41
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    42
qed "keysFor_mono";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    43
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    44
goalw thy [keysFor_def] "keysFor (insert (Agent A) H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    45
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    46
qed "keysFor_insert_Agent";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    47
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    48
goalw thy [keysFor_def] "keysFor (insert (Nonce N) H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    49
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    50
qed "keysFor_insert_Nonce";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    51
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    52
goalw thy [keysFor_def] "keysFor (insert (Key K) H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    53
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    54
qed "keysFor_insert_Key";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    55
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    56
goalw thy [keysFor_def] "keysFor (insert {|X,Y|} H) = keysFor H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    57
by (fast_tac (!claset addss (!simpset)) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    58
qed "keysFor_insert_MPair";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    59
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    60
goalw thy [keysFor_def]
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    61
    "keysFor (insert (Crypt X K) H) = insert (invKey K) (keysFor H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    62
by (Auto_tac());
1964
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1946
diff changeset
    63
by (Fast_tac 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    64
qed "keysFor_insert_Crypt";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    65
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    66
Addsimps [keysFor_empty, keysFor_Un, keysFor_UN, 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
    67
          keysFor_insert_Agent, keysFor_insert_Nonce,
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
    68
          keysFor_insert_Key, keysFor_insert_MPair,
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
    69
          keysFor_insert_Crypt];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    70
2068
0d05468dc80c New theorem Crypt_imp_invKey_keysFor
paulson
parents: 2061
diff changeset
    71
goalw thy [keysFor_def] "!!H. Crypt X K : H ==> invKey K : keysFor H";
0d05468dc80c New theorem Crypt_imp_invKey_keysFor
paulson
parents: 2061
diff changeset
    72
by (Fast_tac 1);
0d05468dc80c New theorem Crypt_imp_invKey_keysFor
paulson
parents: 2061
diff changeset
    73
qed "Crypt_imp_invKey_keysFor";
0d05468dc80c New theorem Crypt_imp_invKey_keysFor
paulson
parents: 2061
diff changeset
    74
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    75
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    76
(**** Inductive relation "parts" ****)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    77
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    78
val major::prems = 
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    79
goal thy "[| {|X,Y|} : parts H;       \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    80
\            [| X : parts H; Y : parts H |] ==> P  \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    81
\         |] ==> P";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    82
by (cut_facts_tac [major] 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
    83
by (resolve_tac prems 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    84
by (REPEAT (eresolve_tac [asm_rl, parts.Fst, parts.Snd] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    85
qed "MPair_parts";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    86
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    87
AddIs  [parts.Inj];
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
    88
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
    89
val partsEs = [MPair_parts, make_elim parts.Body];
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
    90
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
    91
AddSEs partsEs;
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
    92
(*NB These two rules are UNSAFE in the formal sense, as they discard the
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
    93
     compound message.  They work well on THIS FILE, perhaps because its
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
    94
     proofs concern only atomic messages.*)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    95
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    96
goal thy "H <= parts(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    97
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    98
qed "parts_increasing";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
    99
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   100
(*Monotonicity*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   101
goalw thy parts.defs "!!G H. G<=H ==> parts(G) <= parts(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   102
by (rtac lfp_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   103
by (REPEAT (ares_tac basic_monos 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   104
qed "parts_mono";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   105
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   106
goal thy "parts{} = {}";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   107
by (Step_tac 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   108
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   109
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   110
qed "parts_empty";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   111
Addsimps [parts_empty];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   112
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   113
goal thy "!!X. X: parts{} ==> P";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   114
by (Asm_full_simp_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   115
qed "parts_emptyE";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   116
AddSEs [parts_emptyE];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   117
1893
fa58f4a06f21 Works up to main theorem, then XXX...X
paulson
parents: 1885
diff changeset
   118
(*WARNING: loops if H = {Y}, therefore must not be repeated!*)
fa58f4a06f21 Works up to main theorem, then XXX...X
paulson
parents: 1885
diff changeset
   119
goal thy "!!H. X: parts H ==> EX Y:H. X: parts {Y}";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   120
by (etac parts.induct 1);
1893
fa58f4a06f21 Works up to main theorem, then XXX...X
paulson
parents: 1885
diff changeset
   121
by (ALLGOALS Fast_tac);
fa58f4a06f21 Works up to main theorem, then XXX...X
paulson
parents: 1885
diff changeset
   122
qed "parts_singleton";
fa58f4a06f21 Works up to main theorem, then XXX...X
paulson
parents: 1885
diff changeset
   123
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   124
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   125
(** Unions **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   126
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   127
goal thy "parts(G) Un parts(H) <= parts(G Un H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   128
by (REPEAT (ares_tac [Un_least, parts_mono, Un_upper1, Un_upper2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   129
val parts_Un_subset1 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   130
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   131
goal thy "parts(G Un H) <= parts(G) Un parts(H)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   132
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   133
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   134
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   135
val parts_Un_subset2 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   136
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   137
goal thy "parts(G Un H) = parts(G) Un parts(H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   138
by (REPEAT (ares_tac [equalityI, parts_Un_subset1, parts_Un_subset2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   139
qed "parts_Un";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   140
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   141
goal thy "parts (insert X H) = parts {X} Un parts H";
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   142
by (stac (read_instantiate [("A","H")] insert_is_Un) 1);
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   143
by (simp_tac (HOL_ss addsimps [parts_Un]) 1);
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   144
qed "parts_insert";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   145
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   146
(*TWO inserts to avoid looping.  This rewrite is better than nothing.
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   147
  Not suitable for Addsimps: its behaviour can be strange.*)
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   148
goal thy "parts (insert X (insert Y H)) = parts {X} Un parts {Y} Un parts H";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   149
by (simp_tac (!simpset addsimps [Un_assoc]) 1);
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   150
by (simp_tac (!simpset addsimps [parts_insert RS sym]) 1);
1852
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   151
qed "parts_insert2";
289ce6cb5c84 Added Msg 3; works up to Says_Server_imp_Key_newK
paulson
parents: 1839
diff changeset
   152
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   153
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
   154
by (REPEAT (ares_tac [UN_least, parts_mono, UN_upper] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   155
val parts_UN_subset1 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   156
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   157
goal thy "parts(UN x:A. H x) <= (UN x:A. parts(H x))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   158
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   159
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   160
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   161
val parts_UN_subset2 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   162
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   163
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
   164
by (REPEAT (ares_tac [equalityI, parts_UN_subset1, parts_UN_subset2] 1));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   165
qed "parts_UN";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   166
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   167
goal thy "parts(UN x. H x) = (UN x. parts(H x))";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   168
by (simp_tac (!simpset addsimps [UNION1_def, parts_UN]) 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   169
qed "parts_UN1";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   170
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   171
(*Added to simplify arguments to parts, analz and synth*)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   172
Addsimps [parts_Un, parts_UN, parts_UN1];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   173
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   174
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
   175
by (fast_tac (!claset addEs [impOfSubs parts_mono]) 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   176
qed "parts_insert_subset";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   177
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   178
(** Idempotence and transitivity **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   179
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   180
goal thy "!!H. X: parts (parts H) ==> X: parts H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   181
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   182
by (ALLGOALS Fast_tac);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   183
qed "parts_partsE";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   184
AddSEs [parts_partsE];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   185
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   186
goal thy "parts (parts H) = parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   187
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   188
qed "parts_idem";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   189
Addsimps [parts_idem];
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   190
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   191
goal thy "!!H. [| X: parts G;  G <= parts H |] ==> X: parts H";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   192
by (dtac parts_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   193
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   194
qed "parts_trans";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   195
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   196
(*Cut*)
1998
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   197
goal thy "!!H. [| Y: parts (insert X H);  X: parts H |] ==> Y: parts H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   198
by (etac parts_trans 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   199
by (Fast_tac 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   200
qed "parts_cut";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   201
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   202
val parts_insertI = impOfSubs (subset_insertI RS parts_mono);
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   203
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   204
goal thy "!!H. X: parts H ==> parts (insert X H) = parts H";
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   205
by (fast_tac (!claset addSEs [parts_cut]
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   206
                      addIs  [parts_insertI]) 1);
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   207
qed "parts_cut_eq";
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   208
2028
738bb98d65ec Last working version prior to addition of "lost" component
paulson
parents: 2026
diff changeset
   209
Addsimps [parts_cut_eq];
738bb98d65ec Last working version prior to addition of "lost" component
paulson
parents: 2026
diff changeset
   210
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   211
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   212
(** Rewrite rules for pulling out atomic messages **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   213
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   214
goal thy "parts (insert (Agent agt) H) = insert (Agent agt) (parts H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   215
by (rtac (parts_insert_subset RSN (2, equalityI)) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   216
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   217
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   218
(*Simplification breaks up equalities between messages;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   219
  how to make it work for fast_tac??*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   220
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   221
qed "parts_insert_Agent";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   222
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   223
goal thy "parts (insert (Nonce N) H) = insert (Nonce N) (parts H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   224
by (rtac (parts_insert_subset RSN (2, equalityI)) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   225
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   226
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   227
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   228
qed "parts_insert_Nonce";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   229
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   230
goal thy "parts (insert (Key K) H) = insert (Key K) (parts H)";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   231
by (rtac (parts_insert_subset RSN (2, equalityI)) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   232
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   233
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   234
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   235
qed "parts_insert_Key";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   236
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   237
goal thy "parts (insert (Crypt X K) H) = \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   238
\         insert (Crypt X K) (parts (insert X H))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   239
by (rtac equalityI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   240
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   241
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   242
by (Auto_tac());
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   243
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   244
by (ALLGOALS (best_tac (!claset addIs [parts.Body])));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   245
qed "parts_insert_Crypt";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   246
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   247
goal thy "parts (insert {|X,Y|} H) = \
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   248
\         insert {|X,Y|} (parts (insert X (insert Y H)))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   249
by (rtac equalityI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   250
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   251
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   252
by (Auto_tac());
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   253
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   254
by (ALLGOALS (best_tac (!claset addIs [parts.Fst, parts.Snd])));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   255
qed "parts_insert_MPair";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   256
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   257
Addsimps [parts_insert_Agent, parts_insert_Nonce, 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   258
          parts_insert_Key, parts_insert_Crypt, parts_insert_MPair];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   259
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   260
2026
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   261
goal thy "parts (Key``N) = Key``N";
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   262
by (Auto_tac());
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   263
by (etac parts.induct 1);
2026
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   264
by (Auto_tac());
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   265
qed "parts_image_Key";
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   266
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   267
Addsimps [parts_image_Key];
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   268
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   269
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   270
(**** Inductive relation "analz" ****)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   271
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   272
val major::prems = 
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   273
goal thy "[| {|X,Y|} : analz H;       \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   274
\            [| X : analz H; Y : analz H |] ==> P  \
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   275
\         |] ==> P";
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   276
by (cut_facts_tac [major] 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   277
by (resolve_tac prems 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   278
by (REPEAT (eresolve_tac [asm_rl, analz.Fst, analz.Snd] 1));
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   279
qed "MPair_analz";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   280
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   281
AddIs  [analz.Inj];
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   282
AddSEs [MPair_analz];      (*Perhaps it should NOT be deemed safe!*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   283
AddDs  [analz.Decrypt];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   284
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   285
Addsimps [analz.Inj];
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   286
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   287
goal thy "H <= analz(H)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   288
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   289
qed "analz_increasing";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   290
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   291
goal thy "analz H <= parts H";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   292
by (rtac subsetI 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   293
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   294
by (ALLGOALS Fast_tac);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   295
qed "analz_subset_parts";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   296
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   297
bind_thm ("not_parts_not_analz", analz_subset_parts RS contra_subsetD);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   298
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   299
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   300
goal thy "parts (analz H) = parts H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   301
by (rtac equalityI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   302
by (rtac (analz_subset_parts RS parts_mono RS subset_trans) 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   303
by (Simp_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   304
by (fast_tac (!claset addDs [analz_increasing RS parts_mono RS subsetD]) 1);
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   305
qed "parts_analz";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   306
Addsimps [parts_analz];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   307
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   308
goal thy "analz (parts H) = parts H";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   309
by (Auto_tac());
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   310
by (etac analz.induct 1);
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   311
by (Auto_tac());
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   312
qed "analz_parts";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   313
Addsimps [analz_parts];
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   314
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   315
(*Monotonicity; Lemma 1 of Lowe*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   316
goalw thy analz.defs "!!G H. G<=H ==> analz(G) <= analz(H)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   317
by (rtac lfp_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   318
by (REPEAT (ares_tac basic_monos 1));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   319
qed "analz_mono";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   320
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   321
(** General equational properties **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   322
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   323
goal thy "analz{} = {}";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   324
by (Step_tac 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   325
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   326
by (ALLGOALS Fast_tac);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   327
qed "analz_empty";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   328
Addsimps [analz_empty];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   329
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   330
(*Converse fails: we can analz more from the union than from the 
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   331
  separate parts, as a key in one might decrypt a message in the other*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   332
goal thy "analz(G) Un analz(H) <= analz(G Un H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   333
by (REPEAT (ares_tac [Un_least, analz_mono, Un_upper1, Un_upper2] 1));
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   334
qed "analz_Un";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   335
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   336
goal thy "insert X (analz H) <= analz(insert X H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   337
by (fast_tac (!claset addEs [impOfSubs analz_mono]) 1);
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   338
qed "analz_insert";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   339
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   340
(** Rewrite rules for pulling out atomic messages **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   341
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   342
goal thy "analz (insert (Agent agt) H) = insert (Agent agt) (analz H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   343
by (rtac (analz_insert RSN (2, equalityI)) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   344
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   345
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   346
(*Simplification breaks up equalities between messages;
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   347
  how to make it work for fast_tac??*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   348
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   349
qed "analz_insert_Agent";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   350
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   351
goal thy "analz (insert (Nonce N) H) = insert (Nonce N) (analz H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   352
by (rtac (analz_insert RSN (2, equalityI)) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   353
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   354
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   355
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   356
qed "analz_insert_Nonce";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   357
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   358
(*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
   359
goalw thy [keysFor_def]
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   360
    "!!K. K ~: keysFor (analz H) ==>  \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   361
\         analz (insert (Key K) H) = insert (Key K) (analz H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   362
by (rtac (analz_insert RSN (2, equalityI)) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   363
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   364
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   365
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   366
qed "analz_insert_Key";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   367
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   368
goal thy "analz (insert {|X,Y|} H) = \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   369
\         insert {|X,Y|} (analz (insert X (insert Y H)))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   370
by (rtac equalityI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   371
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   372
by (etac analz.induct 1);
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   373
by (Auto_tac());
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   374
by (etac analz.induct 1);
2102
41a667d2c3fa Replaced excluded_middle_tac by case_tac
paulson
parents: 2068
diff changeset
   375
by (ALLGOALS
41a667d2c3fa Replaced excluded_middle_tac by case_tac
paulson
parents: 2068
diff changeset
   376
    (deepen_tac (!claset addIs [analz.Fst, analz.Snd, analz.Decrypt]) 0));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   377
qed "analz_insert_MPair";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   378
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   379
(*Can pull out enCrypted message if the Key is not known*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   380
goal thy "!!H. Key (invKey K) ~: analz H ==>  \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   381
\              analz (insert (Crypt X K) H) = \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   382
\              insert (Crypt X K) (analz H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   383
by (rtac (analz_insert RSN (2, equalityI)) 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   384
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   385
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   386
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   387
qed "analz_insert_Crypt";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   388
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   389
goal thy "!!H. Key (invKey K) : analz H ==>  \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   390
\              analz (insert (Crypt X K) H) <= \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   391
\              insert (Crypt X K) (analz (insert X H))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   392
by (rtac subsetI 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   393
by (eres_inst_tac [("za","x")] analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   394
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   395
val lemma1 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   396
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   397
goal thy "!!H. Key (invKey K) : analz H ==>  \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   398
\              insert (Crypt X K) (analz (insert X H)) <= \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   399
\              analz (insert (Crypt X K) H)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   400
by (Auto_tac());
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   401
by (eres_inst_tac [("za","x")] analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   402
by (Auto_tac());
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   403
by (best_tac (!claset addIs [subset_insertI RS analz_mono RS subsetD,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   404
                             analz.Decrypt]) 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   405
val lemma2 = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   406
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   407
goal thy "!!H. Key (invKey K) : analz H ==>  \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   408
\              analz (insert (Crypt X K) H) = \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   409
\              insert (Crypt X K) (analz (insert X H))";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   410
by (REPEAT (ares_tac [equalityI, lemma1, lemma2] 1));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   411
qed "analz_insert_Decrypt";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   412
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   413
(*Case analysis: either the message is secure, or it is not!
1946
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   414
  Effective, but can cause subgoals to blow up!
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   415
  Use with expand_if;  apparently split_tac does not cope with patterns
2102
41a667d2c3fa Replaced excluded_middle_tac by case_tac
paulson
parents: 2068
diff changeset
   416
  such as "analz (insert (Crypt X K) H)" *)
41a667d2c3fa Replaced excluded_middle_tac by case_tac
paulson
parents: 2068
diff changeset
   417
goal thy "analz (insert (Crypt X K) H) = \
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   418
\         (if (Key (invKey K)  : analz H) then    \
2102
41a667d2c3fa Replaced excluded_middle_tac by case_tac
paulson
parents: 2068
diff changeset
   419
\               insert (Crypt X K) (analz (insert X H)) \
41a667d2c3fa Replaced excluded_middle_tac by case_tac
paulson
parents: 2068
diff changeset
   420
\          else insert (Crypt X K) (analz H))";
41a667d2c3fa Replaced excluded_middle_tac by case_tac
paulson
parents: 2068
diff changeset
   421
by (case_tac "Key (invKey K)  : analz H " 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   422
by (ALLGOALS (asm_simp_tac (!simpset addsimps [analz_insert_Crypt, 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   423
                                               analz_insert_Decrypt])));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   424
qed "analz_Crypt_if";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   425
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   426
Addsimps [analz_insert_Agent, analz_insert_Nonce, 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   427
          analz_insert_Key, analz_insert_MPair, 
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   428
          analz_Crypt_if];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   429
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   430
(*This rule supposes "for the sake of argument" that we have the key.*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   431
goal thy  "analz (insert (Crypt X K) H) <=  \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   432
\          insert (Crypt X K) (analz (insert X H))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   433
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   434
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   435
by (Auto_tac());
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   436
qed "analz_insert_Crypt_subset";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   437
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   438
2026
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   439
goal thy "analz (Key``N) = Key``N";
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   440
by (Auto_tac());
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   441
by (etac analz.induct 1);
2026
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   442
by (Auto_tac());
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   443
qed "analz_image_Key";
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   444
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   445
Addsimps [analz_image_Key];
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   446
0df5a96bf77e Last working version prior to introduction of "lost"
paulson
parents: 2011
diff changeset
   447
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   448
(** Idempotence and transitivity **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   449
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   450
goal thy "!!H. X: analz (analz H) ==> X: analz H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   451
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   452
by (ALLGOALS Fast_tac);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   453
qed "analz_analzE";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   454
AddSEs [analz_analzE];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   455
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   456
goal thy "analz (analz H) = analz H";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   457
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   458
qed "analz_idem";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   459
Addsimps [analz_idem];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   460
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   461
goal thy "!!H. [| X: analz G;  G <= analz H |] ==> X: analz H";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   462
by (dtac analz_mono 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   463
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   464
qed "analz_trans";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   465
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   466
(*Cut; Lemma 2 of Lowe*)
1998
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   467
goal thy "!!H. [| Y: analz (insert X H);  X: analz H |] ==> Y: analz H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   468
by (etac analz_trans 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   469
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   470
qed "analz_cut";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   471
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   472
(*Cut can be proved easily by induction on
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   473
   "!!H. Y: analz (insert X H) ==> X: analz H --> Y: analz H"
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   474
*)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   475
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   476
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   477
(** A congruence rule for "analz" **)
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   478
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   479
goal thy "!!H. [| analz G <= analz G'; analz H <= analz H' \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   480
\              |] ==> analz (G Un H) <= analz (G' Un H')";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   481
by (Step_tac 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   482
by (etac analz.induct 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   483
by (ALLGOALS (best_tac (!claset addIs [analz_mono RS subsetD])));
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   484
qed "analz_subset_cong";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   485
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   486
goal thy "!!H. [| analz G = analz G'; analz H = analz H' \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   487
\              |] ==> analz (G Un H) = analz (G' Un H')";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   488
by (REPEAT_FIRST (ares_tac [equalityI, analz_subset_cong]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   489
          ORELSE' etac equalityE));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   490
qed "analz_cong";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   491
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   492
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   493
goal thy "!!H. analz H = analz H' ==> analz(insert X H) = analz(insert X H')";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   494
by (asm_simp_tac (!simpset addsimps [insert_def] 
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   495
                           setloop (rtac analz_cong)) 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   496
qed "analz_insert_cong";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   497
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   498
(*If there are no pairs or encryptions then analz does nothing*)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   499
goal thy "!!H. [| ALL X Y. {|X,Y|} ~: H;  ALL X K. Crypt X K ~: H |] ==> \
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   500
\         analz H = H";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   501
by (Step_tac 1);
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   502
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   503
by (ALLGOALS Fast_tac);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   504
qed "analz_trivial";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   505
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   506
(*Helps to prove Fake cases*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   507
goal thy "!!X. X: analz (UN i. analz (H i)) ==> X: analz (UN i. H i)";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   508
by (etac analz.induct 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   509
by (ALLGOALS (fast_tac (!claset addEs [impOfSubs analz_mono])));
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   510
val lemma = result();
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   511
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   512
goal thy "analz (UN i. analz (H i)) = analz (UN i. H i)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   513
by (fast_tac (!claset addIs [lemma]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   514
                      addEs [impOfSubs analz_mono]) 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   515
qed "analz_UN_analz";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   516
Addsimps [analz_UN_analz];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   517
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   518
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   519
(**** Inductive relation "synth" ****)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   520
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   521
AddIs  synth.intrs;
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   522
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   523
(*Can only produce a nonce or key if it is already known,
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   524
  but can synth a pair or encryption from its components...*)
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   525
val mk_cases = synth.mk_cases msg.simps;
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   526
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   527
(*NO Agent_synth, as any Agent name can be synthd*)
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   528
val Nonce_synth = mk_cases "Nonce n : synth H";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   529
val Key_synth   = mk_cases "Key K : synth H";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   530
val MPair_synth = mk_cases "{|X,Y|} : synth H";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   531
val Crypt_synth = mk_cases "Crypt X K : synth H";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   532
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   533
AddSEs [Nonce_synth, Key_synth, MPair_synth, Crypt_synth];
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   534
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   535
goal thy "H <= synth(H)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   536
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   537
qed "synth_increasing";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   538
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   539
(*Monotonicity*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   540
goalw thy synth.defs "!!G H. G<=H ==> synth(G) <= synth(H)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   541
by (rtac lfp_mono 1);
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   542
by (REPEAT (ares_tac basic_monos 1));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   543
qed "synth_mono";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   544
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   545
(** Unions **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   546
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   547
(*Converse fails: we can synth more from the union than from the 
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   548
  separate parts, building a compound message using elements of each.*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   549
goal thy "synth(G) Un synth(H) <= synth(G Un H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   550
by (REPEAT (ares_tac [Un_least, synth_mono, Un_upper1, Un_upper2] 1));
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   551
qed "synth_Un";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   552
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   553
goal thy "insert X (synth H) <= synth(insert X H)";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   554
by (fast_tac (!claset addEs [impOfSubs synth_mono]) 1);
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   555
qed "synth_insert";
1885
a18a6dc14f76 Auth proofs work up to the XXX...
paulson
parents: 1852
diff changeset
   556
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   557
(** Idempotence and transitivity **)
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   558
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   559
goal thy "!!H. X: synth (synth H) ==> X: synth H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   560
by (etac synth.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   561
by (ALLGOALS Fast_tac);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   562
qed "synth_synthE";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   563
AddSEs [synth_synthE];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   564
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   565
goal thy "synth (synth H) = synth H";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   566
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   567
qed "synth_idem";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   568
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   569
goal thy "!!H. [| X: synth G;  G <= synth H |] ==> X: synth H";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   570
by (dtac synth_mono 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   571
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   572
qed "synth_trans";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   573
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   574
(*Cut; Lemma 2 of Lowe*)
1998
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   575
goal thy "!!H. [| Y: synth (insert X H);  X: synth H |] ==> Y: synth H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   576
by (etac synth_trans 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   577
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   578
qed "synth_cut";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   579
1946
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   580
goal thy "Agent A : synth H";
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   581
by (Fast_tac 1);
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   582
qed "Agent_synth";
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   583
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   584
goal thy "(Nonce N : synth H) = (Nonce N : H)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   585
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   586
qed "Nonce_synth_eq";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   587
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   588
goal thy "(Key K : synth H) = (Key K : H)";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   589
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   590
qed "Key_synth_eq";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   591
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   592
goal thy "!!K. Key K ~: H ==> (Crypt X K : synth H) = (Crypt X K: H)";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   593
by (Fast_tac 1);
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   594
qed "Crypt_synth_eq";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   595
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   596
Addsimps [Agent_synth, Nonce_synth_eq, Key_synth_eq, Crypt_synth_eq];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   597
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   598
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   599
goalw thy [keysFor_def]
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   600
    "keysFor (synth H) = keysFor H Un invKey``{K. Key K : H}";
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   601
by (Fast_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   602
qed "keysFor_synth";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   603
Addsimps [keysFor_synth];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   604
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   605
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   606
(*** Combinations of parts, analz and synth ***)
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   607
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   608
goal thy "parts (synth H) = parts H Un synth H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   609
by (rtac equalityI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   610
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   611
by (etac parts.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   612
by (ALLGOALS
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   613
    (best_tac (!claset addIs ((synth_increasing RS parts_mono RS subsetD)
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   614
                             ::parts.intrs))));
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   615
qed "parts_synth";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   616
Addsimps [parts_synth];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   617
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   618
goal thy "analz (synth H) = analz H Un synth H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   619
by (rtac equalityI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   620
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   621
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   622
by (best_tac
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   623
    (!claset addIs [synth_increasing RS analz_mono RS subsetD]) 5);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   624
(*Strange that best_tac just can't hack this one...*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   625
by (ALLGOALS (deepen_tac (!claset addIs analz.intrs) 0));
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   626
qed "analz_synth";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   627
Addsimps [analz_synth];
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   628
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   629
(*Hard to prove; still needed now that there's only one Spy?*)
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   630
goal thy "analz (UN i. synth (H i)) = \
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   631
\         analz (UN i. H i) Un (UN i. synth (H i))";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   632
by (rtac equalityI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   633
by (rtac subsetI 1);
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   634
by (etac analz.induct 1);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   635
by (best_tac
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   636
    (!claset addEs [impOfSubs synth_increasing,
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   637
                    impOfSubs analz_mono]) 5);
1839
199243afac2b Proving safety properties of authentication protocols
paulson
parents:
diff changeset
   638
by (Best_tac 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   639
by (deepen_tac (!claset addIs [analz.Fst]) 0 1);
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   640
by (deepen_tac (!claset addIs [analz.Snd]) 0 1);
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   641
by (deepen_tac (!claset addSEs [analz.Decrypt]
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   642
                        addIs  [analz.Decrypt]) 0 1);
1913
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   643
qed "analz_UN1_synth";
2809adb15eb0 Renaming of functions, and tidying
paulson
parents: 1893
diff changeset
   644
Addsimps [analz_UN1_synth];
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   645
1946
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   646
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   647
(** For reasoning about the Fake rule in traces **)
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   648
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   649
goal thy "!!Y. X: G ==> parts(insert X H) <= parts G Un parts H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   650
by (rtac ([parts_mono, parts_Un_subset2] MRS subset_trans) 1);
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   651
by (Fast_tac 1);
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   652
qed "parts_insert_subset_Un";
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   653
1946
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   654
(*More specifically for Fake*)
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   655
goal thy "!!H. X: synth (analz G) ==> \
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   656
\              parts (insert X H) <= synth (analz G) Un parts G Un parts H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   657
by (dtac parts_insert_subset_Un 1);
1946
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   658
by (Full_simp_tac 1);
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   659
by (Deepen_tac 0 1);
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   660
qed "Fake_parts_insert";
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   661
2061
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   662
goal thy
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   663
     "!!H. [| Crypt Y K : parts (insert X H);  X: synth (analz G);  \
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   664
\             Key K ~: analz G |]                                   \
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   665
\          ==> Crypt Y K : parts G Un parts H";
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   666
by (dtac (impOfSubs Fake_parts_insert) 1);
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   667
ba 1;
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   668
by (fast_tac (!claset addDs [impOfSubs analz_subset_parts]
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   669
                      addss (!simpset)) 1);
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   670
qed "Crypt_Fake_parts_insert";
b14a08bf61bf New theorem Crypt_Fake_parts_insert
paulson
parents: 2032
diff changeset
   671
1946
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   672
goal thy "!!H. [| X: synth (analz G); G <= H |] ==> \
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   673
\              analz (insert X H) <= synth (analz H) Un analz H";
2032
1bbf1bdcaf56 Introduction of "lost" argument
paulson
parents: 2028
diff changeset
   674
by (rtac subsetI 1);
1946
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   675
by (subgoal_tac "x : analz (synth (analz H))" 1);
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   676
by (best_tac (!claset addIs [impOfSubs (analz_mono RS synth_mono)]
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   677
                      addSEs [impOfSubs analz_mono]) 2);
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   678
by (Full_simp_tac 1);
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   679
by (Fast_tac 1);
b59a3d686436 New theorems for Fake case
paulson
parents: 1929
diff changeset
   680
qed "Fake_analz_insert";
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   681
2011
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   682
goal thy "(X: analz H & X: parts H) = (X: analz H)";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   683
by (fast_tac (!claset addDs [impOfSubs analz_subset_parts]) 1);
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   684
val analz_conj_parts = result();
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   685
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   686
goal thy "(X: analz H | X: parts H) = (X: parts H)";
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   687
by (fast_tac (!claset addDs [impOfSubs analz_subset_parts]) 1);
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   688
val analz_disj_parts = result();
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   689
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   690
AddIffs [analz_conj_parts, analz_disj_parts];
d9af64c26be6 New laws for messages
paulson
parents: 1998
diff changeset
   691
1998
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   692
(*Without this equation, other rules for synth and analz would yield
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   693
  redundant cases*)
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   694
goal thy "({|X,Y|} : synth (analz H)) = \
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   695
\         (X : synth (analz H) & Y : synth (analz H))";
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   696
by (Fast_tac 1);
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   697
qed "MPair_synth_analz";
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   698
f8230821f1e8 Reordering of premises for cut theorems, and new law MPair_synth_analz
paulson
parents: 1994
diff changeset
   699
AddIffs [MPair_synth_analz];
1929
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   700
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   701
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   702
(*We do NOT want Crypt... messages broken up in protocols!!*)
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   703
Delrules partsEs;
f0839bab4b00 Working version of NS, messages 1-3, WITH INTERLEAVING
paulson
parents: 1913
diff changeset
   704