[STATEMENT]
lemma pr_sesk_user_3 [rule_format]:
 "(evs, S, A, U) \<in> protocol \<Longrightarrow>
    \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow>
    Key (sesK K) \<in> A \<longrightarrow>
  (\<exists>d e. K = d * e \<and>
    IntAgrK (S (Card n, n, run)) = Some d \<and>
    ExtAgrK (S (Card n, n, run)) = Some e) \<or>
  (\<exists>b. Pri_AgrK b \<in> A \<and>
    ExtMapK (S (User m, n, run)) = Some b)"
  (is "_ \<Longrightarrow> ?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (evs, S, A, U) \<in> protocol \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
apply (erule protocol.induct, simp_all add: pr_pri_agrk_analz, blast)
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None\<rbrakk> \<Longrightarrow> (na \<in> bad \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)) \<and> (na \<notin> bad \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b))
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0)\<rbrakk> \<Longrightarrow> (symK n' = symK 0 \<longrightarrow> (symK 0 = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK 0 \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)))) \<and> (symK n' \<noteq> symK 0 \<longrightarrow> (symK n' = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))))
 3. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 6. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 7. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule conjI)
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None\<rbrakk> \<Longrightarrow> na \<in> bad \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None\<rbrakk> \<Longrightarrow> na \<notin> bad \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0)\<rbrakk> \<Longrightarrow> (symK n' = symK 0 \<longrightarrow> (symK 0 = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK 0 \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)))) \<and> (symK n' \<noteq> symK 0 \<longrightarrow> (symK n' = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))))
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [1-2] impI)+
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0)\<rbrakk> \<Longrightarrow> (symK n' = symK 0 \<longrightarrow> (symK 0 = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK 0 \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)))) \<and> (symK n' \<noteq> symK 0 \<longrightarrow> (symK n' = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))))
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [3] conjI, (rule_tac [3] impI)+)+
[PROOF STATE]
proof (prove)
goal (11 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma\<rbrakk> \<Longrightarrow> 0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0\<rbrakk> \<Longrightarrow> symK 0 \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0)\<rbrakk> \<Longrightarrow> symK n' \<noteq> symK 0 \<longrightarrow> (symK n' = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)))
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [4] impI)+
[PROOF STATE]
proof (prove)
goal (11 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0\<rbrakk> \<Longrightarrow> symK 0 \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0)\<rbrakk> \<Longrightarrow> symK n' \<noteq> symK 0 \<longrightarrow> (symK n' = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)))
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply ((rule_tac [5] impI)+, (rule_tac [5] conjI)?)+
[PROOF STATE]
proof (prove)
goal (12 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma\<rbrakk> \<Longrightarrow> 0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0)\<rbrakk> \<Longrightarrow> symK n' \<noteq> symK 0 \<longrightarrow> (symK n' = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)))
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [6] impI)+
[PROOF STATE]
proof (prove)
goal (12 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0)\<rbrakk> \<Longrightarrow> symK n' \<noteq> symK 0 \<longrightarrow> (symK n' = symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))) \<and> (symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)))
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply ((rule_tac [7] impI)+, (rule_tac [7] conjI)?)+
[PROOF STATE]
proof (prove)
goal (14 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma\<rbrakk> \<Longrightarrow> 0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0\<rbrakk> \<Longrightarrow> symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [8] impI)+
[PROOF STATE]
proof (prove)
goal (14 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0\<rbrakk> \<Longrightarrow> symK n' \<noteq> symK ma \<longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b))
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply ((rule_tac [9] impI)+, (rule_tac [9] conjI)?)+
[PROOF STATE]
proof (prove)
goal (15 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma\<rbrakk> \<Longrightarrow> 0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [10] impI)+
[PROOF STATE]
proof (prove)
goal (15 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [11] impI)+
[PROOF STATE]
proof (prove)
goal (15 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (ma = 0 \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)) \<and> (0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba))
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [12] conjI, (rule_tac [12] impI)+)+
[PROOF STATE]
proof (prove)
goal (16 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> 0 < ma \<longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [13] impI)+
[PROOF STATE]
proof (prove)
goal (16 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<and> Pri_AgrK c \<in> A \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)))) \<and> ((s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)))
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [14] conjI, (rule_tac [14] impI)+)+
[PROOF STATE]
proof (prove)
goal (18 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba))
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba))
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (erule_tac [14] conjE)+
[PROOF STATE]
proof (prove)
goal (18 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)) \<and> (Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba))
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba))
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply ((rule_tac [15] impI)+, (rule_tac [15] conjI)?)+
[PROOF STATE]
proof (prove)
goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba))
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [16] impI)+
[PROOF STATE]
proof (prove)
goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0\<rbrakk> \<Longrightarrow> (s' = s \<longrightarrow> Pri_AgrK c \<notin> A) \<longrightarrow> (sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa \<longrightarrow> Key (sesK (c * d * (s + a * b))) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)) \<and> (\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba))
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply ((rule_tac [17] impI)+, (rule_tac [17] conjI)?)+
[PROOF STATE]
proof (prove)
goal (20 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 18. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 19. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> sesK K = sesK (c * d * (s + a * b)) \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 20. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U\<rbrakk> \<Longrightarrow> \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
apply (rule_tac [18-20] impI)+
[PROOF STATE]
proof (prove)
goal (20 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 18. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 19. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 20. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (20 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 18. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 19. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 20. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsR1 S A U s n' run'
[PROOF STATE]
proof (state)
goal (20 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 18. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 19. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 20. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (20 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 18. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 19. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 20. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (20 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 18. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 19. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 20. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Card n', n', run') := S (Card n', n', run')
    \<lparr>NonceS := Some s\<rparr>)"
[PROOF STATE]
proof (state)
goal (20 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<in> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 11. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 18. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 19. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 20. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or>
    (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK (?S (User m, n, run)) = Some b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
proof (rule disjE [OF A], rule disjI1, simp add: fun_upd_apply, rule impI, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
qed (rule disjI2, simp add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = s \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)

goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsR1 S A U s n' run'
[PROOF STATE]
proof (state)
goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Card n', n', run') := S (Card n', n', run')
    \<lparr>NonceS := Some s\<rparr>)"
[PROOF STATE]
proof (state)
goal (19 subgoals):
 1. \<And>evsR1 S A U s na runa. \<lbrakk>(evsR1, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK s \<notin> U; s \<noteq> 0; NonceS (S (Card na, na, runa)) = None; na \<notin> bad; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 10. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 17. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 18. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 19. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or> ?Q ?S A n run"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
proof (rule disjE [OF A], rule disjI1, simp add: fun_upd_apply, rule impI, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
qed (rule disjI2, simp add: fun_upd_apply)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>NonceS := Some s\<rparr>)) (User m, n, run)) = Some b)

goal (18 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (18 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a n' run'
[PROOF STATE]
proof (state)
goal (18 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (18 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (18 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Spy, n', run') := S (Spy, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (18 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 9. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 16. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 17. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 18. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or>
    (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK (?S (User m, n, run)) = Some b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (17 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 17. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (17 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 17. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a m n' run'
[PROOF STATE]
proof (state)
goal (17 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 17. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (17 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 17. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (17 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 17. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((User m, n', run') := S (User m, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (17 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 8. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 15. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 16. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 17. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or> ?Q ?S A n run"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (16 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (16 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a n' run'
[PROOF STATE]
proof (state)
goal (16 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (16 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (16 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Spy, n', run') := S (Spy, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (16 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 7. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 14. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 15. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 16. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or>
    (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK (?S (User m, n, run)) = Some b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (15 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (15 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a m n' run'
[PROOF STATE]
proof (state)
goal (15 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (15 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (15 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((User m, n', run') := S (User m, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (15 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' = symK 0; symK 0 \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 6. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 13. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 14. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 15. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or> ?Q ?S A n run"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (14 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (14 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a n' run'
[PROOF STATE]
proof (state)
goal (14 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (14 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (14 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Spy, n', run') := S (Spy, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (14 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 5. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 12. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 13. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 14. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or>
    (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK (?S (User m, n, run)) = Some b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (13 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 13. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (13 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 13. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a m n' run'
[PROOF STATE]
proof (state)
goal (13 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 13. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (13 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 13. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (13 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 13. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((User m, n', run') := S (User m, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (13 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' = symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 4. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 11. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 12. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 13. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or> ?Q ?S A n run"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (12 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (12 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a n' run'
[PROOF STATE]
proof (state)
goal (12 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (12 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (12 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Spy, n', run') := S (Spy, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (12 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 3. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 10. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 11. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 12. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or>
    (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK (?S (User m, n, run)) = Some b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. (b = a \<or> Pri_AgrK b \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (11 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (11 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC2 S A U s a m n' run'
[PROOF STATE]
proof (state)
goal (11 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (11 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (11 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((User m, n', run') := S (User m, n', run')
    \<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (11 subgoals):
 1. \<And>evsC2 S A U a ma na runa X n' s s'. \<lbrakk>(evsC2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK a \<notin> U; NonceS (S (User ma, na, runa)) = None; Says na runa (Suc 0) X (User ma) (Crypt (symK n') (Pri_AgrK s)) \<in> set evsC2; s' = (if symK n' = symK ma then s else 0); symK n' \<noteq> symK 0; symK n' \<noteq> symK ma; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>NonceS := Some 0, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
 2. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 9. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 10. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 11. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or> ?Q ?S A n run"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
by (rule disjE [OF A], simp_all add: fun_upd_apply, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User m, n', run') := S (User m, n', run')\<lparr>NonceS := Some s, IntMapK := Some a\<rparr>)) (User m, n, run)) = Some b)

goal (10 subgoals):
 1. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 10. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 10. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsR2 S A U a b n' run'
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 10. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (10 subgoals):
 1. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 10. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (10 subgoals):
 1. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 10. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Card n', n', run') := S (Card n', n', run')
    \<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)"
[PROOF STATE]
proof (state)
goal (10 subgoals):
 1. \<And>evsR2 S A U b na runa X a. \<lbrakk>(evsR2, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK b \<notin> U; \<exists>y. NonceS (S (Card na, na, runa)) = Some y; IntMapK (S (Card na, na, runa)) = None; Says na runa 2 X (Card na) (pubAK a) \<in> set evsR2; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 8. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 9. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 10. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or> ?Q ?S A n run"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
[PROOF STEP]
proof (rule disjE [OF A], rule disjI1, simp add: fun_upd_apply, rule impI, simp)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)
[PROOF STEP]
qed (rule disjI2, simp add: fun_upd_apply)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card n', n', run') := S (Card n', n', run')\<lparr>IntMapK := Some b, ExtMapK := Some a\<rparr>)) (User m, n, run)) = Some ba)

goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC3 S A U b c m' n' run'
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "ExtMapK (S (User m', n', run')) = None" and
   "m' = 0"
[PROOF STATE]
proof (state)
this:
ExtMapK (S (User m', n', run')) = None
m' = 0

goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence B: "ExtMapK (S (Spy, n', run')) = None"
[PROOF STATE]
proof (prove)
using this:
ExtMapK (S (User m', n', run')) = None
m' = 0

goal (1 subgoal):
 1. ExtMapK (S (Spy, n', run')) = None
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
ExtMapK (S (Spy, n', run')) = None

goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((Spy, n', run') := S (Spy, n', run')
    \<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)"
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; ma = 0; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, na, runa) := S (Spy, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 7. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 8. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 9. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or>
    (\<exists>b. (b = c \<or> Pri_AgrK b \<in> A) \<and> ExtMapK (?S (User m, n, run)) = Some b)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
[PROOF STEP]
proof (rule disjE [OF A], rule disjI1, simp add: fun_upd_apply)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
[PROOF STEP]
qed (rule disjI2, simp add: fun_upd_apply, rule conjI, rule impI, simp add: B, blast)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. (ba = c \<or> Pri_AgrK ba \<in> A) \<and> ExtMapK ((S((Spy, n', run') := S (Spy, n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)

goal (8 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsC3 S A U b c m' n' run'
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume
   "?H1 U \<longrightarrow> ?H2 A \<longrightarrow> ?P S n run \<or> ?Q S A n run" and
   "?H1 U" and
   "?H2 A"
[PROOF STATE]
proof (state)
this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (8 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
hence A: "?P S n run \<or> ?Q S A n run"
[PROOF STATE]
proof (prove)
using this:
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
\<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U
Key (sesK K) \<in> A

goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)

goal (8 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
assume B: "ExtMapK (S (User m', n', run')) = None"
[PROOF STATE]
proof (state)
this:
ExtMapK (S (User m', n', run')) = None

goal (8 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
let ?S = "S((User m', n', run') := S (User m', n', run')
    \<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)"
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>evsC3 S A U c ma na runa s a X b. \<lbrakk>(evsC3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK c \<notin> U; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = None; Says na runa 2 X (User ma) (pubAK b) \<in> set evsC3; c \<noteq> 0 \<and> s + a * b \<noteq> 0; 0 < ma; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 6. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 7. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 8. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
show "?P ?S n run \<or> ?Q ?S A n run"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<exists>d e. K = d * e \<and> IntAgrK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
[PROOF STEP]
proof (rule disjE [OF A], rule disjI1, simp add: fun_upd_apply)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)
[PROOF STEP]
qed (rule disjI2, simp add: fun_upd_apply, rule impI, simp add: B)
[PROOF STATE]
proof (state)
this:
(\<exists>d e. K = d * e \<and> IntAgrK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((User m', n', run') := S (User m', n', run')\<lparr>ExtMapK := Some b, IntAgrK := Some c\<rparr>)) (User m, n, run)) = Some ba)

goal (7 subgoals):
 1. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 7. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 5. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 6. \<And>evsFR3 S A U ma na runa s a b c d. \<lbrakk>(evsFR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); 0 < ma; NonceS (S (User ma, na, runa)) = Some s; IntMapK (S (User ma, na, runa)) = Some a; ExtMapK (S (User ma, na, runa)) = Some b; IntAgrK (S (User ma, na, runa)) = Some c; Pri_AgrK s \<in> A \<and> Pri_AgrK b \<in> A \<and> Pri_AgrK d \<in> A; Key (sesK (c * d * (s + a * b))) \<notin> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b)
 7. \<And>evsC4 S A U ma na runa c X f. \<lbrakk>(evsC4, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); IntAgrK (S (User ma, na, runa)) = Some c; ExtAgrK (S (User ma, na, runa)) = None; Says na runa 3 X (User ma) (pubAK f) \<in> set evsC4; \<lbrace>Key (sesK (c * f)), Agent (User ma), Number na, Number runa\<rbrace> \<in> U; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some d \<and> ExtAgrK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK ((S((User ma, na, runa) := S (User ma, na, runa)\<lparr>ExtAgrK := Some f\<rparr>)) (User m, n, run)) = Some b)
[PROOF STEP]
fix evsR3 A s a b c d n' run' X and S :: state
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0; s + a * b \<noteq> 0; s' = s; Pri_AgrK c \<in> A; sesK K = sesK (c * d * (s + a * b)); User m = X; n = na; run = runa\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (X, na, runa)) = Some ba)
 2. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; sesK K = sesK (c * d * (s + a * b))\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 3. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<and> Pri_AgrK c \<in> A; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U; Key (sesK K) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (Card n, n, run)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s + a * b))\<rparr>)) (User m, n, run)) = Some ba)
 4. \<And>evsR3 S A U d na runa s b a X c s'. \<lbrakk>(evsR3, S, A, U) \<in> protocol; \<lbrace>Key (sesK K), Agent (User m), Number n, Number run\<rbrace> \<in> U \<longrightarrow> Key (sesK K) \<in> A \<longrightarrow> (\<exists>d e. K = d * e \<and> IntAgrK (S (Card n, n, run)) = Some d \<and> ExtAgrK (S (Card n, n, run)) = Some e) \<or> (\<exists>b. Pri_AgrK b \<in> A \<and> ExtMapK (S (User m, n, run)) = Some b); Pri_AgrK d \<notin> U; NonceS (S (Card na, na, runa)) = Some s; IntMapK (S (Card na, na, runa)) = Some b; ExtMapK (S (Card na, na, runa)) = Some a; IntAgrK (S (Card na, na, runa)) = None; Says na runa 3 X (Card na) (pubAK (c * (s' + a * b))) \<in> set evsR3; Key (sesK (c * d * (s' + a * b))) \<notin> U; Key (sesK (c * d * (s + a * b))) \<notin> U; d \<noteq> 0 \<and> s + a * b \<noteq> 0; s' = s \<longrightarrow> Pri_AgrK c \<notin> A; sesK K = sesK (c * d * (s + a * b)) \<and> User m = X \<and> n = na \<and> run = runa; Key (sesK (c * d * (s + a * b))) \<in> A\<rbrakk> \<Longrightarrow> (\<exists>da e. K = da * e \<and> IntAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some da \<and> ExtAgrK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (Card na, na, runa)) = Some e) \<or> (\<exists>ba. Pri_AgrK ba \<in> A \<and> ExtMapK ((S((Card na, na, runa) := S (Card na, na, runa)\<lparr>IntAgrK := Some d, ExtAgrK := Some (c * (s' + a * b))\<rparr>)) (X, na, runa)) = Som