theory structures_proofs

lemma (in kernel_all_substitute) cap_small_frame_cap_set_capFMappedASIDHigh_spec:
  "\<forall>s. \<Gamma> \<turnstile> \<lbrace>s. cap_get_tag \<acute>cap = scast cap_small_frame_cap\<rbrace>
       \<acute>ret__struct_cap_C :== PROC cap_small_frame_cap_set_capFMappedASIDHigh(\<acute>cap, \<acute>v32)
       \<lbrace>cap_small_frame_cap_lift \<acute>ret__struct_cap_C = cap_small_frame_cap_lift \<^bsup>s\<^esup>cap \<lparr> cap_small_frame_cap_CL.capFMappedASIDHigh_CL :=  (\<^bsup>s\<^esup>v32 AND mask 7)\<rparr> \<and>
        cap_get_tag \<acute>ret__struct_cap_C = scast cap_small_frame_cap\<rbrace>" apply (rule allI, rule conseqPre, vcg) apply clarsimp apply (rule context_conjI[THEN iffD1[OF conj_commute]],
         fastforce simp: cap_get_tag_eq_x cap_lift_def cap_tag_defs
                         mask_def shift_over_ao_dists multi_shift_simps word_size
                         word_ao_dist word_bw_assocs) apply (simp add: cap_small_frame_cap_lift_def cap_lift_def cap_tag_defs) apply ((intro conjI sign_extend_eq)?;
         (simp add: mask_def shift_over_ao_dists multi_shift_simps word_size
                    word_ao_dist word_bw_assocs word_and_max_simps))? done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<forall>s. \<Gamma>\<turnstile> \<lbrace>s. cap_get_tag \<acute>cap = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap\<rbrace> Call cap_small_frame_cap_set_capFMappedASIDHigh_'proc \<lbrace>cap_small_frame_cap_lift \<acute>ret__struct_cap_C = cap_small_frame_cap_lift \<^bsup>s\<^esup>cap\<lparr>cap_small_frame_cap_CL.capFMappedASIDHigh_CL := \<^bsup>s\<^esup>v32 && mask 7\<rparr> \<and> cap_get_tag \<acute>ret__struct_cap_C = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>s. \<lbrace>s. cap_get_tag \<acute>cap = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap\<rbrace> \<subseteq> \<lbrace>0 <s 2 \<and> 0 \<le>s 0 \<and> 0 <s 2 \<and> 0 \<le>s 0 \<and> 0 <s 2 \<and> 0 \<le>s 0 \<and> 0 \<le>s 0x18 \<and> 0x18 <s 0x20 \<and> 0 <s 2 \<and> 0 \<le>s 0 \<and> cap_small_frame_cap_lift (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) (v.[unat 0] || (\<acute>v32 << unat 0x18) && 0x7F000000)) (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) (v.[unat 0] && ~~ 0x7F000000)) \<acute>cap)) = cap_small_frame_cap_lift \<^bsup>s\<^esup>cap\<lparr>cap_small_frame_cap_CL.capFMappedASIDHigh_CL := \<^bsup>s\<^esup>v32 && mask 7\<rparr> \<and> cap_get_tag (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) (v.[unat 0] || (\<acute>v32 << unat 0x18) && 0x7F000000)) (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) (v.[unat 0] && ~~ 0x7F000000)) \<acute>cap)) = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>x. cap_get_tag (cap_' x) = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap \<Longrightarrow> cap_small_frame_cap_lift (cap_C.words_C_update ((\<lambda>v. Arrays.update v 0 (v.[0] || (v32_' x << 24) && 0x7F000000)) \<circ> (\<lambda>v. Arrays.update v 0 (v.[0] && 0x80FFFFFF))) (cap_' x)) = cap_small_frame_cap_lift (cap_' x)\<lparr>cap_small_frame_cap_CL.capFMappedASIDHigh_CL := v32_' x && mask 7\<rparr> \<and> cap_get_tag (cap_C.words_C_update ((\<lambda>v. Arrays.update v 0 (v.[0] || (v32_' x << 24) && 0x7F000000)) \<circ> (\<lambda>v. Arrays.update v 0 (v.[0] && 0x80FFFFFF))) (cap_' x)) = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>cap_get_tag (cap_' x) = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap; cap_get_tag (cap_C.words_C_update ((\<lambda>v. Arrays.update v 0 (v.[0] || (v32_' x << 24) && 0x7F000000)) \<circ> (\<lambda>v. Arrays.update v 0 (v.[0] && 0x80FFFFFF))) (cap_' x)) = SCAST(32 signed \<rightarrow> 32) cap_small_frame_cap\<rbrakk> \<Longrightarrow> cap_small_frame_cap_lift (cap_C.words_C_update ((\<lambda>v. Arrays.update v 0 (v.[0] || (v32_' x << 24) && 0x7F000000)) \<circ> (\<lambda>v. Arrays.update v 0 (v.[0] && 0x80FFFFFF))) (cap_' x)) = cap_small_frame_cap_lift (cap_' x)\<lparr>cap_small_frame_cap_CL.capFMappedASIDHigh_CL := v32_' x && mask 7\<rparr> proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>cap_get_tag (cap_' x) = 1; cap_get_tag (cap_C.words_C_update ((\<lambda>v. Arrays.update v 0 (v.[0] || (v32_' x << 24) && 0x7F000000)) \<circ> (\<lambda>v. Arrays.update v 0 (v.[0] && 0x80FFFFFF))) (cap_' x)) = 1\<rbrakk> \<Longrightarrow> (cap_C.words_C (cap_' x).[0] && 0x80FFFFFF || (v32_' x << 24) && 0x7F000000 >> 31) && 1 = (cap_C.words_C (cap_' x).[0] >> 31) && 1 \<and> (cap_C.words_C (cap_' x).[0] && 0x80FFFFFF || (v32_' x << 24) && 0x7F000000 >> 24) && mask 7 = v32_' x && mask 7 \<and> (cap_C.words_C (cap_' x).[0] && 0x80FFFFFF || (v32_' x << 24) && 0x7F000000 << 8) && ~~ mask 12 = (cap_C.words_C (cap_' x).[0] << 8) && ~~ mask 12 proof (prove)
goal:
No subgoals!