theory structures_proofs

lemma (in kernel_all_substitute) cap_zombie_cap_new_spec:
  "\<forall>s. \<Gamma> \<turnstile> {s}
       \<acute>ret__struct_cap_C :== PROC cap_zombie_cap_new(\<acute>capZombieID, \<acute>capZombieType)
       \<lbrace>cap_zombie_cap_lift \<acute>ret__struct_cap_C = \<lparr>
          cap_zombie_cap_CL.capZombieID_CL = (\<^bsup>s\<^esup>capZombieID___unsigned AND mask 32),
          cap_zombie_cap_CL.capZombieType_CL = (\<^bsup>s\<^esup>capZombieType___unsigned AND mask 6) \<rparr> \<and>
        cap_get_tag \<acute>ret__struct_cap_C = scast cap_zombie_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_zombie_cap_def
                         mask_def shift_over_ao_dists word_bw_assocs word_ao_dist) apply (simp add: cap_zombie_cap_lift_def) apply (erule cap_lift_zombie_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_zombie_cap_def))? done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<forall>s. \<Gamma>\<turnstile> {s} Call cap_zombie_cap_new_'proc \<lbrace>cap_zombie_cap_lift \<acute>ret__struct_cap_C = \<lparr>capZombieID_CL = \<^bsup>s\<^esup>capZombieID && mask 32, capZombieType_CL = \<^bsup>s\<^esup>capZombieType && mask 6\<rparr> \<and> cap_get_tag \<acute>ret__struct_cap_C = SCAST(32 signed \<rightarrow> 32) cap_zombie_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 8 \<and> 8 <s 0x20 \<and> 1 <s 2 \<and> 0 \<le>s 1 \<and> 0 \<le>s 0 \<and> 0 <s 0x20 \<and> cap_zombie_cap_lift (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 1) (SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capZombieID << unat 0))) (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) ((SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capZombieType && 0x3F << unat 8)) || (SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF << unat 0))) v)) = \<lparr>capZombieID_CL = \<^bsup>s\<^esup>capZombieID && mask 32, capZombieType_CL = \<^bsup>s\<^esup>capZombieType && mask 6\<rparr> \<and> cap_get_tag (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 1) (SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capZombieID << unat 0))) (cap_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) ((SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>capZombieType && 0x3F << unat 8)) || (SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF << unat 0))) v)) = SCAST(32 signed \<rightarrow> 32) cap_zombie_cap\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>s v. cap_zombie_cap_lift (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capZombieID_' s)) 0 ((capZombieType_' s << 8) && 0x3F00 || SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF)) v) = \<lparr>capZombieID_CL = capZombieID_' s, capZombieType_CL = capZombieType_' s && 0x3F\<rparr> \<and> cap_get_tag (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capZombieID_' s)) 0 ((capZombieType_' s << 8) && 0x3F00 || SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF)) v) = SCAST(32 signed \<rightarrow> 32) cap_zombie_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) (capZombieID_' s)) 0 ((capZombieType_' s << 8) && 0x3F00 || SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF)) v) = SCAST(32 signed \<rightarrow> 32) cap_zombie_cap \<Longrightarrow> cap_zombie_cap_lift (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capZombieID_' s)) 0 ((capZombieType_' s << 8) && 0x3F00 || SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF)) v) = \<lparr>capZombieID_CL = capZombieID_' s, capZombieType_CL = capZombieType_' s && 0x3F\<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) (capZombieID_' s)) 0 ((capZombieType_' s << 8) && 0x3F00 || SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF)) v) = SCAST(32 signed \<rightarrow> 32) cap_zombie_cap \<Longrightarrow> (case cap_lift (cap_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (capZombieID_' s)) 0 ((capZombieType_' s << 8) && 0x3F00 || SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF)) v) of Some (Cap_zombie_cap rec) \<Rightarrow> rec) = \<lparr>capZombieID_CL = capZombieID_' s, capZombieType_CL = capZombieType_' s && 0x3F\<rparr> proof (prove)
goal (1 subgoal):
 1. \<And>s. ((capZombieType_' s << 8) && 0x3F00 || SCAST(32 signed \<rightarrow> 32) cap_zombie_cap && 0xFF >> 8) && mask 6 = capZombieType_' s && 0x3F proof (prove)
goal:
No subgoals!