theory structures_proofs

lemma (in kernel_all_substitute) seL4_Fault_UserException_new_spec:
  "\<forall>s. \<Gamma> \<turnstile> {s}
       \<acute>ret__struct_seL4_Fault_C :== PROC seL4_Fault_UserException_new(\<acute>number, \<acute>code)
       \<lbrace>seL4_Fault_UserException_lift \<acute>ret__struct_seL4_Fault_C = \<lparr>
          seL4_Fault_UserException_CL.number_CL = (\<^bsup>s\<^esup>number___unsigned AND mask 32),
          seL4_Fault_UserException_CL.code_CL = (\<^bsup>s\<^esup>code___unsigned AND mask 28) \<rparr> \<and>
        seL4_Fault_get_tag \<acute>ret__struct_seL4_Fault_C = scast seL4_Fault_UserException\<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: seL4_Fault_get_tag_eq_x seL4_Fault_UserException_def
                         mask_def shift_over_ao_dists word_bw_assocs word_ao_dist) apply (simp add: seL4_Fault_UserException_lift_def) apply (erule seL4_Fault_lift_UserException[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 seL4_Fault_UserException_def))? done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<forall>s. \<Gamma>\<turnstile> {s} Call seL4_Fault_UserException_new_'proc \<lbrace>seL4_Fault_UserException_lift \<acute>ret__struct_seL4_Fault_C = \<lparr>number_CL = \<^bsup>s\<^esup>number && mask 32, code_CL = \<^bsup>s\<^esup>code && mask 28\<rparr> \<and> seL4_Fault_get_tag \<acute>ret__struct_seL4_Fault_C = SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException\<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 4 \<and> 4 <s 0x20 \<and> 1 <s 2 \<and> 0 \<le>s 1 \<and> 0 \<le>s 0 \<and> 0 <s 0x20 \<and> seL4_Fault_UserException_lift (seL4_Fault_C.words_C_update (\<lambda>v. Arrays.update v (unat 1) (SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>number << unat 0))) (seL4_Fault_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) ((SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>code && 0xFFFFFFF << unat 4)) || (SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF << unat 0))) v)) = \<lparr>number_CL = \<^bsup>s\<^esup>number && mask 32, code_CL = \<^bsup>s\<^esup>code && mask 28\<rparr> \<and> seL4_Fault_get_tag (seL4_Fault_C.words_C_update (\<lambda>v. Arrays.update v (unat 1) (SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>number << unat 0))) (seL4_Fault_C.words_C_update (\<lambda>v. Arrays.update v (unat 0) ((SCAST(32 signed \<rightarrow> 32) 0 || (\<acute>code && 0xFFFFFFF << unat 4)) || (SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF << unat 0))) v)) = SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>s v. seL4_Fault_UserException_lift (seL4_Fault_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (number_' s)) 0 ((code_' s << 4) && 0xFFFFFFF0 || SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF)) v) = \<lparr>number_CL = number_' s, code_CL = code_' s && 0xFFFFFFF\<rparr> \<and> seL4_Fault_get_tag (seL4_Fault_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (number_' s)) 0 ((code_' s << 4) && 0xFFFFFFF0 || SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF)) v) = SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException proof (prove)
goal (1 subgoal):
 1. \<And>s v. seL4_Fault_get_tag (seL4_Fault_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (number_' s)) 0 ((code_' s << 4) && 0xFFFFFFF0 || SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF)) v) = SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException \<Longrightarrow> seL4_Fault_UserException_lift (seL4_Fault_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (number_' s)) 0 ((code_' s << 4) && 0xFFFFFFF0 || SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF)) v) = \<lparr>number_CL = number_' s, code_CL = code_' s && 0xFFFFFFF\<rparr> proof (prove)
goal (1 subgoal):
 1. \<And>s v. seL4_Fault_get_tag (seL4_Fault_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (number_' s)) 0 ((code_' s << 4) && 0xFFFFFFF0 || SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF)) v) = SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException \<Longrightarrow> (case seL4_Fault_lift (seL4_Fault_C.words_C_update (\<lambda>x. Arrays.update (Arrays.update x (Suc 0) (number_' s)) 0 ((code_' s << 4) && 0xFFFFFFF0 || SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF)) v) of Some (SeL4_Fault_UserException rec) \<Rightarrow> rec) = \<lparr>number_CL = number_' s, code_CL = code_' s && 0xFFFFFFF\<rparr> proof (prove)
goal (1 subgoal):
 1. \<And>s. ((code_' s << 4) && 0xFFFFFFF0 || SCAST(32 signed \<rightarrow> 32) seL4_Fault_UserException && 0xF >> 4) && mask 28 = code_' s && 0xFFFFFFF proof (prove)
goal:
No subgoals!