theory VSpace_C

lemma ccorres_pre_gets_armKSGlobalPD_ksArchState:
  assumes cc: "\<And>rv. ccorres r xf (P rv) (P' rv) hs (f rv) c"
  shows   "ccorres r xf
                  (\<lambda>s. (\<forall>rv. armKSGlobalPD (ksArchState s) = rv  \<longrightarrow> P rv s))
                  (P' (ptr_val armKSGlobalPD_Ptr))
                  hs (gets (armKSGlobalPD \<circ> ksArchState) >>= (\<lambda>rv. f rv)) c" apply (rule ccorres_guard_imp) apply (rule ccorres_symb_exec_l) defer apply wp[1] apply (rule gets_sp) apply (clarsimp simp: empty_fail_def simpler_gets_def) apply assumption apply clarsimp defer apply (rule ccorres_guard_imp) apply (rule cc) apply clarsimp apply assumption apply (drule rf_sr_armKSGlobalPD) apply simp done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. ccorres r xf (\<lambda>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s) (P' (ptr_val armKSGlobalPD_Ptr)) hs (gets (armKSGlobalPD \<circ> ksArchState) >>= f) c proof (prove)
goal (3 subgoals):
 1. ccorres r xf ?Q ?Q' hs (gets (armKSGlobalPD \<circ> ksArchState) >>= f) c
 2. \<And>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s \<Longrightarrow> ?Q s
 3. \<And>s. s \<in> P' (ptr_val armKSGlobalPD_Ptr) \<Longrightarrow> s \<in> ?Q' proof (prove)
goal (6 subgoals):
 1. \<And>rv. ccorres r xf (?Q4 rv) (?Q'4 rv) hs (f rv) c
 2. \<And>s. \<lbrace>(=) s\<rbrace> gets (armKSGlobalPD \<circ> ksArchState) \<lbrace>\<lambda>r. (=) s\<rbrace>
 3. \<lbrace>?Q\<rbrace> gets (armKSGlobalPD \<circ> ksArchState) \<lbrace>?Q4\<rbrace>
 4. empty_fail (gets (armKSGlobalPD \<circ> ksArchState))
 5. \<And>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s \<Longrightarrow> ?Q s
 6. \<And>s. s \<in> P' (ptr_val armKSGlobalPD_Ptr) \<Longrightarrow> s \<in> {s'. \<forall>rv s. (s, s') \<in> rf_sr \<and> ?Q4 rv s \<longrightarrow> s' \<in> ?Q'4 rv} proof (prove)
goal (6 subgoals):
 1. \<And>s. \<lbrace>(=) s\<rbrace> gets (armKSGlobalPD \<circ> ksArchState) \<lbrace>\<lambda>r. (=) s\<rbrace>
 2. \<lbrace>?Q\<rbrace> gets (armKSGlobalPD \<circ> ksArchState) \<lbrace>?Q4\<rbrace>
 3. empty_fail (gets (armKSGlobalPD \<circ> ksArchState))
 4. \<And>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s \<Longrightarrow> ?Q s
 5. \<And>s. s \<in> P' (ptr_val armKSGlobalPD_Ptr) \<Longrightarrow> s \<in> {s'. \<forall>rv s. (s, s') \<in> rf_sr \<and> ?Q4 rv s \<longrightarrow> s' \<in> ?Q'4 rv}
 6. \<And>rv. ccorres r xf (?Q4 rv) (?Q'4 rv) hs (f rv) c proof (prove)
goal (5 subgoals):
 1. \<lbrace>?Q\<rbrace> gets (armKSGlobalPD \<circ> ksArchState) \<lbrace>?Q4\<rbrace>
 2. empty_fail (gets (armKSGlobalPD \<circ> ksArchState))
 3. \<And>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s \<Longrightarrow> ?Q s
 4. \<And>s. s \<in> P' (ptr_val armKSGlobalPD_Ptr) \<Longrightarrow> s \<in> {s'. \<forall>rv s. (s, s') \<in> rf_sr \<and> ?Q4 rv s \<longrightarrow> s' \<in> ?Q'4 rv}
 5. \<And>rv. ccorres r xf (?Q4 rv) (?Q'4 rv) hs (f rv) c proof (prove)
goal (4 subgoals):
 1. empty_fail (gets (armKSGlobalPD \<circ> ksArchState))
 2. \<And>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s \<Longrightarrow> ?Q s
 3. \<And>s. s \<in> P' (ptr_val armKSGlobalPD_Ptr) \<Longrightarrow> s \<in> {s'. \<forall>rv s. (s, s') \<in> rf_sr \<and> (?Q and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) s \<longrightarrow> s' \<in> ?Q'4 rv}
 4. \<And>rv. ccorres r xf (?Q and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) (?Q'4 rv) hs (f rv) c proof (prove)
goal (3 subgoals):
 1. \<And>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s \<Longrightarrow> ?Q s
 2. \<And>s. s \<in> P' (ptr_val armKSGlobalPD_Ptr) \<Longrightarrow> s \<in> {s'. \<forall>rv s. (s, s') \<in> rf_sr \<and> (?Q and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) s \<longrightarrow> s' \<in> ?Q'4 rv}
 3. \<And>rv. ccorres r xf (?Q and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) (?Q'4 rv) hs (f rv) c proof (prove)
goal (2 subgoals):
 1. \<And>s. s \<in> P' (ptr_val armKSGlobalPD_Ptr) \<Longrightarrow> s \<in> {s'. \<forall>rv s. (s, s') \<in> rf_sr \<and> ((\<lambda>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s) and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) s \<longrightarrow> s' \<in> ?Q'4 rv}
 2. \<And>rv. ccorres r xf ((\<lambda>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s) and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) (?Q'4 rv) hs (f rv) c proof (prove)
goal (2 subgoals):
 1. \<And>s sa. \<lbrakk>s \<in> P' (symbol_table ''armKSGlobalPD''); (sa, s) \<in> rf_sr; P (armKSGlobalPD (ksArchState sa)) sa\<rbrakk> \<Longrightarrow> s \<in> ?Q'4 (armKSGlobalPD (ksArchState sa))
 2. \<And>rv. ccorres r xf ((\<lambda>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s) and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) (?Q'4 rv) hs (f rv) c proof (prove)
goal (2 subgoals):
 1. \<And>rv. ccorres r xf ((\<lambda>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s) and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) (?Q'4 rv) hs (f rv) c
 2. \<And>s sa. \<lbrakk>s \<in> P' (symbol_table ''armKSGlobalPD''); (sa, s) \<in> rf_sr; P (armKSGlobalPD (ksArchState sa)) sa\<rbrakk> \<Longrightarrow> s \<in> ?Q'4 (armKSGlobalPD (ksArchState sa)) proof (prove)
goal (4 subgoals):
 1. \<And>rv. ccorres r xf (?Q22 rv) (?Q'22 rv) hs (f rv) c
 2. \<And>rv s. ((\<lambda>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s) and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) s \<Longrightarrow> ?Q22 rv s
 3. \<And>rv s. s \<in> ?Q'4 rv \<Longrightarrow> s \<in> ?Q'22 rv
 4. \<And>s sa. \<lbrakk>s \<in> P' (symbol_table ''armKSGlobalPD''); (sa, s) \<in> rf_sr; P (armKSGlobalPD (ksArchState sa)) sa\<rbrakk> \<Longrightarrow> s \<in> ?Q'4 (armKSGlobalPD (ksArchState sa)) proof (prove)
goal (3 subgoals):
 1. \<And>rv s. ((\<lambda>s. \<forall>rv. armKSGlobalPD (ksArchState s) = rv \<longrightarrow> P rv s) and (\<lambda>s. (armKSGlobalPD \<circ> ksArchState) s = rv)) s \<Longrightarrow> P rv s
 2. \<And>rv s. s \<in> ?Q'4 rv \<Longrightarrow> s \<in> P' rv
 3. \<And>s sa. \<lbrakk>s \<in> P' (symbol_table ''armKSGlobalPD''); (sa, s) \<in> rf_sr; P (armKSGlobalPD (ksArchState sa)) sa\<rbrakk> \<Longrightarrow> s \<in> ?Q'4 (armKSGlobalPD (ksArchState sa)) proof (prove)
goal (2 subgoals):
 1. \<And>rv s. s \<in> ?Q'4 rv \<Longrightarrow> s \<in> P' rv
 2. \<And>s sa. \<lbrakk>s \<in> P' (symbol_table ''armKSGlobalPD''); (sa, s) \<in> rf_sr; P (armKSGlobalPD (ksArchState sa)) sa\<rbrakk> \<Longrightarrow> s \<in> ?Q'4 (armKSGlobalPD (ksArchState sa)) proof (prove)
goal (1 subgoal):
 1. \<And>s sa. \<lbrakk>s \<in> P' (symbol_table ''armKSGlobalPD''); (sa, s) \<in> rf_sr; P (armKSGlobalPD (ksArchState sa)) sa\<rbrakk> \<Longrightarrow> s \<in> P' (armKSGlobalPD (ksArchState sa)) proof (prove)
goal (1 subgoal):
 1. \<And>s sa. \<lbrakk>s \<in> P' (symbol_table ''armKSGlobalPD''); P (armKSGlobalPD (ksArchState sa)) sa; armKSGlobalPD (ksArchState sa) = ptr_val armKSGlobalPD_Ptr\<rbrakk> \<Longrightarrow> s \<in> P' (armKSGlobalPD (ksArchState sa)) proof (prove)
goal:
No subgoals!