theory structures_proofs

lemma (in kernel_all_substitute) cap_page_directory_cap_new_spec:
  "\<forall>s. \<Gamma> \<turnstile> {s}
       \<acute>ret__struct_cap_C :== PROC cap_page_directory_cap_new(\<acute>capPDMappedASID, \<acute>capPDIsMapped, \<acute>capPDBasePtr)
       \<lbrace>cap_page_directory_cap_lift \<acute>ret__struct_cap_C = \<lparr>
          cap_page_directory_cap_CL.capPDMappedASID_CL = (\<^bsup>s\<^esup>capPDMappedASID___unsigned AND mask 17),
          cap_page_directory_cap_CL.capPDIsMapped_CL = (\<^bsup>s\<^esup>capPDIsMapped___unsigned AND mask 1),
          cap_page_directory_cap_CL.capPDBasePtr_CL = (\<^bsup>s\<^esup>capPDBasePtr___unsigned AND NOT (mask 14)) \<rparr> \<and>
        cap_get_tag \<acute>ret__struct_cap_C = scast cap_page_directory_cap\<rbrace>" apply (rule allI, rule conseqPre, vcg) apply (clarsimp simp: guard_simps o_def mask_def shift_over_ao_dists) apply (rule context_conjI[THEN iffD1[OF conj_commute]],
         fastforce simp: cap_get_tag_eq_x cap_page_directory_cap_def
                         mask_def shift_over_ao_dists word_bw_assocs word_ao_dist) apply (simp add: cap_page_directory_cap_lift_def) apply (erule cap_lift_page_directory_cap[THEN subst[OF sym]]; simp?) 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 cap_page_directory_cap_def))? done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<forall>s. \<Gamma>\<turnstile> {s} Call cap_page_directory_cap_new_'proc \<lbrace>cap_page_directory_cap_lift \<acute>ret__struct_cap_C = \<lparr>capPDMappedASID_CL = \<^bsup>s\<^esup>capPDMappedASID && mask 17, capPDIsMapped_CL = \<^bsup>s\<^esup>capPDIsMapped && mask 1, capPDBasePtr_CL = \<^bsup>s\<^esup>capPDBasePtr && ~~ mask 14\<rparr> \<and> cap_get_tag \<acute>ret__struct_cap_C = SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>s. {s} \<subseteq> \<lbrace>\<forall>v. 0 <s 2 \<and> 0 \<le>s 0 \<and> 0 <s 0x20 \<and> 0 \<le>s 0 \<and> 0 <s 0x20 \<and> 0 \<le>s 4 \<and> 4 <s 0x20 \<and> 1 <s 2 \<and> 0 \<le>s 1 \<and> 0 \<le>s 0 \<and> 0 <s 0x20 \<and> cap_page_directory_cap_lift (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 1) (SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capPDMappedASID && 0x1FFFF << unat 0))) (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) (((SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capPDIsMapped && 1 << unat 4)) || (\<acute>capPDBasePtr && 0xFFFFC000 >> unat 0)) || (SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF << unat 0))) v)) = \<lparr>capPDMappedASID_CL = \<^bsup>s\<^esup>capPDMappedASID && mask 17, capPDIsMapped_CL = \<^bsup>s\<^esup>capPDIsMapped && mask 1, capPDBasePtr_CL = \<^bsup>s\<^esup>capPDBasePtr && ~~ mask 14\<rparr> \<and> cap_get_tag (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 1) (SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capPDMappedASID && 0x1FFFF << unat 0))) (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) (((SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capPDIsMapped && 1 << unat 4)) || (\<acute>capPDBasePtr && 0xFFFFC000 >> unat 0)) || (SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF << unat 0))) v)) = SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>s v. cap_page_directory_cap_lift (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capPDMappedASID_' s && 0x1FFFF)) 0 (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF)) v) = \<lparr>capPDMappedASID_CL = capPDMappedASID_' s && 0x1FFFF, capPDIsMapped_CL = capPDIsMapped_' s && 1, capPDBasePtr_CL = capPDBasePtr_' s && 0xFFFFC000\<rparr> \<and> cap_get_tag (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capPDMappedASID_' s && 0x1FFFF)) 0 (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF)) v) = SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap proof (prove)
goal (1 subgoal):
 1. \<And>s v. cap_get_tag (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capPDMappedASID_' s && 0x1FFFF)) 0 (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF)) v) = SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap \<Longrightarrow> cap_page_directory_cap_lift (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capPDMappedASID_' s && 0x1FFFF)) 0 (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF)) v) = \<lparr>capPDMappedASID_CL = capPDMappedASID_' s && 0x1FFFF, capPDIsMapped_CL = capPDIsMapped_' s && 1, capPDBasePtr_CL = capPDBasePtr_' s && 0xFFFFC000\<rparr> proof (prove)
goal (1 subgoal):
 1. \<And>s v. cap_get_tag (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capPDMappedASID_' s && 0x1FFFF)) 0 (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF)) v) = SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap \<Longrightarrow> (case cap_lift (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capPDMappedASID_' s && 0x1FFFF)) 0 (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF)) v) of Some (Cap_page_directory_cap rec) \<Rightarrow> rec) = \<lparr>capPDMappedASID_CL = capPDMappedASID_' s && 0x1FFFF, capPDIsMapped_CL = capPDIsMapped_' s && 1, capPDBasePtr_CL = capPDBasePtr_' s && 0xFFFFC000\<rparr> proof (prove)
goal (1 subgoal):
 1. \<And>s. (capPDMappedASID_' s && 0x1FFFF) && mask 17 = capPDMappedASID_' s && 0x1FFFF \<and> (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF >> 4) && 1 = capPDIsMapped_' s && 1 \<and> (((capPDIsMapped_' s << 4) && 0x10 || capPDBasePtr_' s && 0xFFFFC000) || SCAST(32 signed \<rightarrow> 32) cap_page_directory_cap && 0xF) && ~~ mask 14 = capPDBasePtr_' s && 0xFFFFC000 proof (prove)
goal:
No subgoals!