theory SimplRewrite

lemma exec_statefn_simulates_Guard_rhs:
  "exec_statefn_simulates f (S \<inter> {s. f s \<in> G}) T a b
    \<Longrightarrow> exec_statefn_simulates f S T a (Guard E G b)" apply (rule exec_statefn_simulatesI) apply (case_tac "f s \<in> G") apply (drule(1) exec_statefn_simulatesD, simp) apply (auto intro: exec.intros) done

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