equal
deleted
inserted
replaced
52 declare analz_insertI [intro] |
52 declare analz_insertI [intro] |
53 declare Un_Diff [simp] |
53 declare Un_Diff [simp] |
54 |
54 |
55 subsubsection{*extract the agent number of an Agent message*} |
55 subsubsection{*extract the agent number of an Agent message*} |
56 |
56 |
57 consts agt_nb :: "msg => agent" |
57 primrec agt_nb :: "msg => agent" where |
58 |
|
59 recdef agt_nb "measure size" |
|
60 "agt_nb (Agent A) = A" |
58 "agt_nb (Agent A) = A" |
61 |
59 |
62 subsubsection{*messages that are pairs*} |
60 subsubsection{*messages that are pairs*} |
63 |
61 |
64 definition is_MPair :: "msg => bool" where |
62 definition is_MPair :: "msg => bool" where |
222 apply (frule parts_mono) |
220 apply (frule parts_mono) |
223 by auto |
221 by auto |
224 |
222 |
225 subsubsection{*greatest nonce used in a message*} |
223 subsubsection{*greatest nonce used in a message*} |
226 |
224 |
227 consts greatest_msg :: "msg => nat" |
225 fun greatest_msg :: "msg => nat" |
228 |
226 where |
229 recdef greatest_msg "measure size" |
227 "greatest_msg (Nonce n) = n" |
230 "greatest_msg (Nonce n) = n" |
228 | "greatest_msg {|X,Y|} = max (greatest_msg X) (greatest_msg Y)" |
231 "greatest_msg {|X,Y|} = max (greatest_msg X) (greatest_msg Y)" |
229 | "greatest_msg (Crypt K X) = greatest_msg X" |
232 "greatest_msg (Crypt K X) = greatest_msg X" |
230 | "greatest_msg other = 0" |
233 "greatest_msg other = 0" |
|
234 |
231 |
235 lemma greatest_msg_is_greatest: "Nonce n:parts {X} ==> n <= greatest_msg X" |
232 lemma greatest_msg_is_greatest: "Nonce n:parts {X} ==> n <= greatest_msg X" |
236 by (induct X, auto) |
233 by (induct X, auto) |
237 |
234 |
238 subsubsection{*sets of keys*} |
235 subsubsection{*sets of keys*} |
627 Says A B X:set evs; Key n:parts {X} |] ==> n ~= n'" |
624 Says A B X:set evs; Key n:parts {X} |] ==> n ~= n'" |
628 by (drule not_used_not_spied, auto dest: Says_imp_knows_Spy parts_sub) |
625 by (drule not_used_not_spied, auto dest: Says_imp_knows_Spy parts_sub) |
629 |
626 |
630 subsubsection{*message of an event*} |
627 subsubsection{*message of an event*} |
631 |
628 |
632 consts msg :: "event => msg" |
629 primrec msg :: "event => msg" |
633 |
630 where |
634 recdef msg "measure size" |
631 "msg (Says A B X) = X" |
635 "msg (Says A B X) = X" |
632 | "msg (Gets A X) = X" |
636 "msg (Gets A X) = X" |
633 | "msg (Notes A X) = X" |
637 "msg (Notes A X) = X" |
|
638 |
634 |
639 lemma used_sub_parts_used: "X:used (ev # evs) ==> X:parts {msg ev} Un used evs" |
635 lemma used_sub_parts_used: "X:used (ev # evs) ==> X:parts {msg ev} Un used evs" |
640 by (induct ev, auto) |
636 by (induct ev, auto) |
641 |
637 |
642 |
638 |