theory Ipc_C

lemma unifyFailure_ccorres:
  assumes corr_ac: "ccorres (f \<currency> r) xf P P' hs a c"
  shows "ccorres ((\<lambda>_. dc) \<currency> r) xf P P' hs (unifyFailure a) c" using corr_ac apply (simp add: unifyFailure_def rethrowFailure_def const_def
                   handleE'_def throwError_def) apply (clarsimp simp: ccorres_underlying_def bind_def split_def return_def
                  split: xstate.splits sum.splits) apply (drule (1) bspec) apply clarsimp apply (rule conjI) apply clarsimp apply (erule_tac x=n in allE) apply (rename_tac s) apply (erule_tac x="Normal s" in allE) apply clarsimp apply (rule bexI) prefer 2 apply assumption apply (clarsimp simp: unif_rrel_def) apply fastforce apply fastforce done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. ccorres ((\<lambda>_. dc) \<currency> r) xf P P' hs (unifyFailure a) c proof (prove)
using this:
ccorres (f \<currency> r) xf P P' hs a c

goal (1 subgoal):
 1. ccorres ((\<lambda>_. dc) \<currency> r) xf P P' hs (unifyFailure a) c proof (prove)
goal (1 subgoal):
 1. ccorres (f \<currency> r) xf P P' hs a c \<Longrightarrow> ccorres ((\<lambda>_. dc) \<currency> r) xf P P' hs (do v <- a;
case v of Inl e \<Rightarrow> (return \<circ> Inl \<circ> (\<lambda>y. ())) e | Inr v' \<Rightarrow> return (Inr v')
od) c proof (prove)
goal (1 subgoal):
 1. \<And>aa b n t. \<lbrakk>\<forall>x\<in>rf_sr. P (fst x) \<and> snd x \<in> P' \<and> \<not> snd (a (fst x)) \<longrightarrow> (\<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,snd x\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a (fst x)). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (snd x, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (snd x, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (snd x, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)); (aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa)\<rbrakk> \<Longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal x1) \<longrightarrow> (\<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) x1) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) x1))) \<and> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (1 subgoal):
 1. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); P (fst (aa, b)) \<and> snd (aa, b) \<in> P' \<and> \<not> snd (a (fst (aa, b))) \<longrightarrow> (\<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,snd (aa, b)\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a (fst (aa, b))). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (snd (aa, b), c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (snd (aa, b), c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (snd (aa, b), c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>))\<rbrakk> \<Longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal x1) \<longrightarrow> (\<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) x1) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) x1))) \<and> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (1 subgoal):
 1. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal x1) \<longrightarrow> (\<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) x1) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) x1))) \<and> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> \<forall>x1. t = Normal x1 \<longrightarrow> \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal x1) \<longrightarrow> (\<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) x1) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) x1))
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n x1. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal x1)\<rbrakk> \<Longrightarrow> \<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) x1) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) x1)
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n x1. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal x1); \<forall>t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> \<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) x1) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) x1)
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n s. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); \<forall>t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> \<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) s) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) s)
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n s. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s) \<longrightarrow> (\<forall>x1. Normal s = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. Normal s \<noteq> Abrupt x2) \<or> (b, c # hs, n, Normal s) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. Normal s \<noteq> Fault x3) \<or> (b, c # hs, n, Normal s) \<notin> exec_handlers \<Gamma>) \<and> (Normal s = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> \<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) s) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) s)
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n s aaa ba. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (aaa, ba) \<in> fst (a aa); (ba, s) \<in> rf_sr; unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf aaa s\<rbrakk> \<Longrightarrow> \<exists>y\<in>fst (a aa). ((\<exists>x1. fst y = Inl x1) \<longrightarrow> (snd y, s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) s) \<and> (\<forall>x2. fst y = Inr x2 \<longrightarrow> (snd y, s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) s)
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (3 subgoals):
 1. \<And>aa b n s aaa ba. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (aaa, ba) \<in> fst (a aa); (ba, s) \<in> rf_sr; unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf aaa s\<rbrakk> \<Longrightarrow> ((\<exists>x1. fst (?y107 aa b n s aaa ba) = Inl x1) \<longrightarrow> (snd (?y107 aa b n s aaa ba), s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) s) \<and> (\<forall>x2. fst (?y107 aa b n s aaa ba) = Inr x2 \<longrightarrow> (snd (?y107 aa b n s aaa ba), s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) s)
 2. \<And>aa b n s aaa ba. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (aaa, ba) \<in> fst (a aa); (ba, s) \<in> rf_sr; unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf aaa s\<rbrakk> \<Longrightarrow> ?y107 aa b n s aaa ba \<in> fst (a aa)
 3. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (3 subgoals):
 1. \<And>aa b n s aaa ba. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (aaa, ba) \<in> fst (a aa); (ba, s) \<in> rf_sr; unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf aaa s\<rbrakk> \<Longrightarrow> ?y107 aa b n s aaa ba \<in> fst (a aa)
 2. \<And>aa b n s aaa ba. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (aaa, ba) \<in> fst (a aa); (ba, s) \<in> rf_sr; unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf aaa s\<rbrakk> \<Longrightarrow> ((\<exists>x1. fst (?y107 aa b n s aaa ba) = Inl x1) \<longrightarrow> (snd (?y107 aa b n s aaa ba), s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) s) \<and> (\<forall>x2. fst (?y107 aa b n s aaa ba) = Inr x2 \<longrightarrow> (snd (?y107 aa b n s aaa ba), s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) s)
 3. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n s aaa ba. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (aaa, ba) \<in> fst (a aa); (ba, s) \<in> rf_sr; unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf aaa s\<rbrakk> \<Longrightarrow> ((\<exists>x1. fst (aaa, ba) = Inl x1) \<longrightarrow> (snd (aaa, ba), s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inl ()) s) \<and> (\<forall>x2. fst (aaa, ba) = Inr x2 \<longrightarrow> (snd (aaa, ba), s) \<in> rf_sr \<and> unif_rrel (n = length hs) ((\<lambda>_. dc) \<currency> r) xf ((\<lambda>_. dc) \<currency> r) xf (Inr x2) s)
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (2 subgoals):
 1. \<And>aa b n s aaa ba. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, Normal s); (aaa, ba) \<in> fst (a aa); (ba, s) \<in> rf_sr; (f \<currency> r) aaa (xf s)\<rbrakk> \<Longrightarrow> ((\<exists>x1. aaa = Inl x1) \<longrightarrow> exflag (xf s) \<noteq> SCAST(32 signed \<rightarrow> 32) EXCEPTION_NONE) \<and> (\<forall>x2. aaa = Inr x2 \<longrightarrow> exflag (xf s) = SCAST(32 signed \<rightarrow> 32) EXCEPTION_NONE \<and> r x2 (exvalue (xf s)))
 2. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal (1 subgoal):
 1. \<And>aa b n t. \<lbrakk>(aa, b) \<in> rf_sr; P aa; b \<in> P'; \<not> snd (a aa); \<forall>n t. (\<Gamma>\<turnstile>\<^sub>h \<langle>c # hs,b\<rangle> \<Rightarrow> (n, t) \<longrightarrow> (\<forall>x1. t = Normal x1 \<longrightarrow> (\<exists>x\<in>fst (a aa). (snd x, x1) \<in> rf_sr \<and> unif_rrel (n = length hs) (f \<currency> r) xf (f \<currency> r) xf (fst x) x1))) \<and> ((\<forall>x2. t \<noteq> Abrupt x2) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> ((\<forall>x3. t \<noteq> Fault x3) \<or> (b, c # hs, n, t) \<notin> exec_handlers \<Gamma>) \<and> (t = Stuck \<longrightarrow> (b, c # hs, n, Stuck) \<notin> exec_handlers \<Gamma>)\<rbrakk> \<Longrightarrow> (\<forall>x2. t = Abrupt x2 \<longrightarrow> (b, c # hs, n, Abrupt x2) \<notin> exec_handlers \<Gamma>) \<and> (\<forall>x3. t = Fault x3 \<longrightarrow> (b, c # hs, n, Fault x3) \<notin> exec_handlers \<Gamma>) proof (prove)
goal:
No subgoals!