src/HOL/Auth/Shared.ML
author paulson
Mon, 09 Sep 1996 18:58:02 +0200
changeset 1967 0ff58b41c037
parent 1964 d551e68b7a36
child 1993 77e7ef8e5c3b
permissions -rw-r--r--
"bad" set simplifies statements of many theorems
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     1
(*  Title:      HOL/Auth/Message
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     2
    ID:         $Id$
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     4
    Copyright   1996  University of Cambridge
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     5
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     6
Theory of Shared Keys (common to all symmetric-key protocols)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     7
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     8
Server keys; initial states of agents; new nonces and keys; function "sees" 
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
     9
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    10
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    11
*)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    12
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    13
Addsimps [parts_cut_eq];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    14
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    15
(*FUN.ML??  WE NEED A NOTION OF INVERSE IMAGE, OR GRAPH!!*)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    16
goal Set.thy "!!f. B <= range f = (B = f`` {x. f x: B})";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    17
by (fast_tac (!claset addEs [equalityE]) 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    18
val subset_range_iff = result();
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    19
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    20
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    21
open Shared;
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    22
1964
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
    23
(*Holds because Friend is injective: thus cannot prove for all f*)
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
    24
goal thy "(Friend x : Friend``A) = (x:A)";
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
    25
by (Auto_tac());
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
    26
qed "Friend_image_eq";
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
    27
Addsimps [Friend_image_eq];
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
    28
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    29
Addsimps [Un_insert_left, Un_insert_right];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    30
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    31
(*By default only o_apply is built-in.  But in the presence of eta-expansion
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    32
  this means that some terms displayed as (f o g) will be rewritten, and others
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    33
  will not!*)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    34
Addsimps [o_def];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    35
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    36
(*** Basic properties of shrK and newK ***)
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    37
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    38
(* invKey (shrK A) = shrK A *)
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    39
bind_thm ("invKey_shrK", rewrite_rule [isSymKey_def] isSym_shrK);
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    40
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    41
(* invKey (newK evs) = newK evs *)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    42
bind_thm ("invKey_newK", rewrite_rule [isSymKey_def] isSym_newK);
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    43
Addsimps [invKey_shrK, invKey_newK];
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    44
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    45
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    46
(*New keys and nonces are fresh*)
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    47
val shrK_inject = inj_shrK RS injD;
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    48
val newN_inject = inj_newN RS injD
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    49
and newK_inject = inj_newK RS injD;
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    50
AddSEs [shrK_inject, newN_inject, newK_inject,
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    51
	fresh_newK RS notE, fresh_newN RS notE];
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    52
Addsimps [inj_shrK RS inj_eq, inj_newN RS inj_eq, inj_newK RS inj_eq];
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    53
Addsimps [fresh_newN, fresh_newK];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    54
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    55
(** Rewrites should not refer to  initState(Friend i) 
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    56
    -- not in normal form! **)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    57
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    58
goal thy "newK evs ~= shrK B";
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    59
by (subgoal_tac "newK evs = shrK B --> \
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    60
\                Key (newK evs) : parts (initState B)" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    61
by (Fast_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    62
by (agent.induct_tac "B" 1);
1967
0ff58b41c037 "bad" set simplifies statements of many theorems
paulson
parents: 1964
diff changeset
    63
by (auto_tac (!claset addIs [range_eqI], !simpset addsimps [bad_def]));
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    64
qed "newK_neq_shrK";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    65
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    66
Addsimps [newK_neq_shrK, newK_neq_shrK RS not_sym];
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    67
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    68
(*Good for talking about Server's initial state*)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    69
goal thy "!!H. H <= Key``E ==> parts H = H";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    70
by (Auto_tac ());
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    71
be parts.induct 1;
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    72
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    73
qed "parts_image_subset";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    74
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    75
bind_thm ("parts_image_Key", subset_refl RS parts_image_subset);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    76
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    77
goal thy "!!H. H <= Key``E ==> analz H = H";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    78
by (Auto_tac ());
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    79
be analz.induct 1;
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    80
by (ALLGOALS (fast_tac (!claset addss (!simpset))));
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    81
qed "analz_image_subset";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    82
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    83
bind_thm ("analz_image_Key", subset_refl RS analz_image_subset);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    84
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    85
Addsimps [parts_image_Key, analz_image_Key];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    86
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    87
goalw thy [keysFor_def] "keysFor (parts (initState C)) = {}";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    88
by (agent.induct_tac "C" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    89
by (auto_tac (!claset addIs [range_eqI] delrules partsEs, !simpset));
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    90
qed "keysFor_parts_initState";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    91
Addsimps [keysFor_parts_initState];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    92
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    93
goalw thy [keysFor_def] "keysFor (Key``E) = {}";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    94
by (Auto_tac ());
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    95
qed "keysFor_image_Key";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    96
Addsimps [keysFor_image_Key];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    97
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
    98
goal thy "shrK A ~: newK``E";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
    99
by (agent.induct_tac "A" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   100
by (Auto_tac ());
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   101
qed "shrK_notin_image_newK";
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   102
Addsimps [shrK_notin_image_newK];
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   103
1964
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
   104
(*Agents see their own shared keys!*)
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
   105
goal thy "Key (shrK A) : sees A evs";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   106
by (list.induct_tac "evs" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   107
by (agent.induct_tac "A" 1);
1967
0ff58b41c037 "bad" set simplifies statements of many theorems
paulson
parents: 1964
diff changeset
   108
by (auto_tac (!claset, !simpset addsimps [bad_def]));
1964
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
   109
qed "sees_own_shrK";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   110
1967
0ff58b41c037 "bad" set simplifies statements of many theorems
paulson
parents: 1964
diff changeset
   111
(*Enemy sees shared keys of bad agents!*)
0ff58b41c037 "bad" set simplifies statements of many theorems
paulson
parents: 1964
diff changeset
   112
goal thy "!!i. A: bad ==> Key (shrK A) : sees Enemy evs";
1964
d551e68b7a36 Stronger proofs; work for Otway-Rees
paulson
parents: 1943
diff changeset
   113
by (list.induct_tac "evs" 1);
1967
0ff58b41c037 "bad" set simplifies statements of many theorems
paulson
parents: 1964
diff changeset
   114
by (auto_tac (!claset, !simpset addsimps [bad_def]));
0ff58b41c037 "bad" set simplifies statements of many theorems
paulson
parents: 1964
diff changeset
   115
qed "Enemy_sees_bad";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   116
1967
0ff58b41c037 "bad" set simplifies statements of many theorems
paulson
parents: 1964
diff changeset
   117
AddSIs [sees_own_shrK, Enemy_sees_bad];
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   118
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   119
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   120
(** Specialized rewrite rules for (sees A (Says...#evs)) **)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   121
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   122
goal thy "sees A (Says A B X # evs) = insert X (sees A evs)";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   123
by (Simp_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   124
qed "sees_own";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   125
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   126
goal thy "!!A. Server ~= A ==> \
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   127
\              sees Server (Says A B X # evs) = sees Server evs";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   128
by (Asm_simp_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   129
qed "sees_Server";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   130
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   131
goal thy "!!A. Friend i ~= A ==> \
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   132
\              sees (Friend i) (Says A B X # evs) = sees (Friend i) evs";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   133
by (Asm_simp_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   134
qed "sees_Friend";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   135
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   136
goal thy "sees Enemy (Says A B X # evs) = insert X (sees Enemy evs)";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   137
by (Simp_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   138
qed "sees_Enemy";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   139
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   140
goal thy "sees A (Says A' B X # evs) <= insert X (sees A evs)";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   141
by (simp_tac (!simpset setloop split_tac [expand_if]) 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   142
by (Fast_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   143
qed "sees_Says_subset_insert";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   144
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   145
goal thy "sees A (Notes A' X # evs) <= insert X (sees A evs)";
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   146
by (simp_tac (!simpset setloop split_tac [expand_if]) 1);
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   147
by (Fast_tac 1);
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   148
qed "sees_Notes_subset_insert";
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   149
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   150
goal thy "sees A evs <= sees A (Says A' B X # evs)";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   151
by (simp_tac (!simpset setloop split_tac [expand_if]) 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   152
by (Fast_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   153
qed "sees_subset_sees_Says";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   154
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   155
(*Pushing Unions into parts; one of the A's equals B, and thus sees Y*)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   156
goal thy "(UN A. parts (sees A (Says B C Y # evs))) = \
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   157
\         parts {Y} Un (UN A. parts (sees A evs))";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   158
by (Step_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   159
be rev_mp 1;	(*for some reason, split_tac does not work on assumptions*)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   160
val ss = (!simpset addsimps [parts_Un, sees_Cons] 
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   161
	           setloop split_tac [expand_if]);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   162
by (ALLGOALS (fast_tac (!claset addss ss)));
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   163
qed "UN_parts_sees_Says";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   164
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   165
goal thy "Says A B X : set_of_list evs --> X : sees Enemy evs";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   166
by (list.induct_tac "evs" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   167
by (Auto_tac ());
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   168
qed_spec_mp "Says_imp_sees_Enemy";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   169
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   170
Addsimps [Says_imp_sees_Enemy];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   171
AddIs    [Says_imp_sees_Enemy];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   172
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   173
goal thy "initState C <= Key `` range shrK";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   174
by (agent.induct_tac "C" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   175
by (Auto_tac ());
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   176
qed "initState_subset";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   177
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   178
goal thy "X : sees C evs --> \
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   179
\          (EX A B. Says A B X : set_of_list evs) | \
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   180
\          (EX A. Notes A X : set_of_list evs) | \
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   181
\          (EX A. X = Key (shrK A))";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   182
by (list.induct_tac "evs" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   183
by (ALLGOALS Asm_simp_tac);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   184
by (fast_tac (!claset addDs [impOfSubs initState_subset]) 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   185
br conjI 1;
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   186
by (Fast_tac 2);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   187
by (event.induct_tac "a" 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   188
by (ALLGOALS (asm_simp_tac (!simpset addsimps [mem_if])));
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   189
by (ALLGOALS Fast_tac);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   190
qed_spec_mp "seesD";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   191
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   192
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   193
Addsimps [UN_parts_sees_Says, sees_own, sees_Server, sees_Friend, sees_Enemy];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   194
Delsimps [sees_Cons];	(**** NOTE REMOVAL -- laws above are cleaner ****)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   195
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   196
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   197
goal thy "!!K. newK evs = invKey K ==> newK evs = K";
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   198
br (invKey_eq RS iffD1) 1;
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   199
by (Simp_tac 1);
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   200
val newK_invKey = result();
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   201
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   202
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   203
(** Rewrites to push in Key and Crypt messages, so that other messages can
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   204
    be pulled out using the analz_insert rules **)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   205
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   206
fun insComm x y = read_instantiate_sg (sign_of thy) [("x",x), ("y",y)] 
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   207
                      insert_commute;
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   208
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   209
val pushKeys = map (insComm "Key ?K") 
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   210
                  ["Agent ?C", "Nonce ?N", "MPair ?X ?Y", "Crypt ?X ?K'"];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   211
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   212
val pushCrypts = map (insComm "Crypt ?X ?K") 
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   213
                    ["Agent ?C", "Nonce ?N", "MPair ?X' ?Y"];
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   214
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   215
(*Cannot be added with Addsimps -- we don't always want to re-order messages*)
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   216
val pushes = pushKeys@pushCrypts;
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   217
1943
20574dca5a3e Renaming and simplification
paulson
parents: 1934
diff changeset
   218
val pushKey_newK = insComm "Key (newK ?evs)"  "Key (shrK ?C)";
1934
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   219
58573e7041b4 Separation of theory Event into two parts:
paulson
parents:
diff changeset
   220