theory SimplRewrite

lemma exec_statefn_simulates_additional_Guarded_Skip:
  "exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b
        \<Longrightarrow> exec_statefn_simulates f S T a (b ;; Guard F G Skip)" apply (rule exec_statefn_simulatesI) apply (drule(2) exec_statefn_simulatesD) apply (elim disjE exE) apply (case_tac t, auto elim!: exec_Normal_elim_cases,
           (blast intro: exec.Seq exec.Skip exec.Guard exec.GuardFault)+)[1] apply (case_tac t, auto elim!: exec_Normal_elim_cases,
          (blast intro: exec.Seq exec.Skip exec.Guard exec.GuardFault)+)[1] apply (blast intro: exec.Seq exec.Skip exec.Guard exec.GuardFault) done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b \<Longrightarrow> exec_statefn_simulates f S T a (b;;
Guard F G SKIP) proof (prove)
goal (1 subgoal):
 1. \<And>s \<Gamma> t. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; \<Gamma>\<turnstile> \<langle>a,Normal s\<rangle> \<Rightarrow> t\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')) proof (prove)
goal (1 subgoal):
 1. \<And>s \<Gamma> t. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- (T \<inter> {s. f s \<in> G}). (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> Normal (f t'))\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')) proof (prove)
goal (3 subgoals):
 1. \<And>s \<Gamma> t. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t'))
 2. \<And>s \<Gamma> t ft. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> Fault ft\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t'))
 3. \<And>s \<Gamma> t. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; \<exists>t'\<in>- (T \<inter> {s. f s \<in> G}). (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')) proof (prove)
goal (2 subgoals):
 1. \<And>s \<Gamma> t ft. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> Fault ft\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t'))
 2. \<And>s \<Gamma> t. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; \<exists>t'\<in>- (T \<inter> {s. f s \<in> G}). (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')) proof (prove)
goal (1 subgoal):
 1. \<And>s \<Gamma> t. \<lbrakk>exec_statefn_simulates f S (T \<inter> {s. f s \<in> G}) a b; s \<in> S; \<exists>t'\<in>- (T \<inter> {s. f s \<in> G}). (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')\<rbrakk> \<Longrightarrow> (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> add_statefn_xstate f t \<or> (\<exists>ft. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Fault ft) \<or> (\<exists>t'\<in>- T. (map_option (add_statefn (inv f)) \<circ> \<Gamma>)\<turnstile> \<langle>b;;
Guard F G SKIP,Normal (f s)\<rangle> \<Rightarrow> Normal (f t')) proof (prove)
goal:
No subgoals!