theory Retype_C

lemma createObjects_ccorres_pte:
  defines "ko \<equiv> (KOArch (KOPTE (makeObject :: pte)))"
  shows "\<forall>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0
  \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma>
  \<and> pspace_no_overlap' ptr sz \<sigma>
  \<and> ret_zero ptr (2 ^ ptBits) \<sigma>
  \<and> region_is_zero_bytes ptr (2 ^ ptBits) x
  \<and> range_cover ptr sz ptBits 1
  \<and> valid_global_refs' s
  \<and> kernel_data_refs \<inter> {ptr..+ 2 ^ ptBits} = {} \<longrightarrow>
  (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>,
   x\<lparr>globals := globals x
                 \<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False)
                       (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr"
  (is "\<forall>\<sigma> x. ?P \<sigma> x \<longrightarrow>
    (\<sigma>\<lparr>ksPSpace := ?ks \<sigma>\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := ?ks' x\<rparr>\<rparr>) \<in> rf_sr") proof (intro impI allI) fix \<sigma> x let ?thesis = "(\<sigma>\<lparr>ksPSpace := ?ks \<sigma>\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := ?ks' x\<rparr>\<rparr>) \<in> rf_sr" let ?ks = "?ks \<sigma>" let ?ks' = "?ks' x" let ?ptr = "Ptr ptr :: (pte_C[256]) ptr" assume "?P \<sigma> x" hence rf: "(\<sigma>, x) \<in> rf_sr"
    and cover: "range_cover ptr sz ptBits 1"
    and al: "is_aligned ptr ptBits"
    and ptr0: "ptr \<noteq> 0"
    and sz: "ptBits \<le> sz"
    and szb: "sz < word_bits"
    and pal: "pspace_aligned' \<sigma>"
    and pdst: "pspace_distinct' \<sigma>"
    and pno: "pspace_no_overlap' ptr sz \<sigma>"
    and rzo: "ret_zero ptr (2 ^ ptBits) \<sigma>"
    and empty: "region_is_bytes ptr (2 ^ ptBits) x"
    and zero: "heap_list_is_zero (hrs_mem (t_hrs_' (globals x))) ptr (2 ^ ptBits)"
    and kernel_data_refs_disj : "kernel_data_refs \<inter> {ptr..+ 2 ^ ptBits} = {}" by (clarsimp simp:range_cover_def[where 'a=32, folded word_bits_def])+ note blah[simp del] =  atLeastAtMost_iff atLeastatMost_subset_iff atLeastLessThan_iff
          Int_atLeastAtMost atLeastatMost_empty_iff split_paired_Ex 

  (* obj specific *)
   have mko: "\<And>dev. makeObjectKO dev (Inr ARM_H.PageTableObject) = Some ko" by (simp add: ko_def makeObjectKO_def) have relrl:
    "cpte_relation makeObject (from_bytes (replicate (size_of TYPE(pte_C)) 0))" unfolding cpte_relation_def supply if_cong[cong] apply (simp add: Let_def makeObject_pte size_of_def pte_lift_def) apply (simp add: from_bytes_def) apply (simp add: typ_info_simps pte_C_tag_def pte_lift_def pte_get_tag_def
                     size_td_lt_final_pad size_td_lt_ti_typ_pad_combine Let_def size_of_def) apply (simp add: final_pad_def size_td_lt_ti_typ_pad_combine Let_def
                     size_of_def padup_def align_td_array' size_td_array update_ti_adjust_ti
                     ti_typ_pad_combine_def ti_typ_combine_def empty_typ_info_def) apply (simp add: typ_info_array array_tag_def eval_nat_numeral) apply (simp add: array_tag_n.simps) apply (simp add: final_pad_def size_td_lt_ti_typ_pad_combine Let_def
                     size_of_def padup_def align_td_array' size_td_array update_ti_adjust_ti
                     ti_typ_pad_combine_def ti_typ_combine_def empty_typ_info_def) apply (simp add: update_ti_t_word32_0s pte_tag_defs) done 

  (* /obj specific *)

  (* s/obj/obj'/ *)
   have szo: "size_of TYPE(pte_C[256]) = 2 ^ ptBits" by (simp add: size_of_def size_td_array ptBits_def pageBits_def pteBits_def) have szo2: "256 * size_of TYPE(pte_C) = 2 ^ ptBits" by (simp add: szo[symmetric]) have szo': "size_of TYPE(pte_C) = 2 ^ objBitsKO ko" by (simp add: objBits_simps ko_def archObjSize_def ptBits_def pageBits_def pteBits_def) note rl' = cslift_ptr_retyp_other_inst[where n=1,
    simplified, OF empty cover[simplified] szo[symmetric] szo] have sz_weaken: "objBitsKO ko \<le> ptBits" by (simp add: objBits_simps ko_def archObjSize_def ptBits_def pageBits_def) have cover': "range_cover ptr sz (objBitsKO ko) 256" apply (rule range_cover_rel[OF cover sz_weaken]) apply (simp add: ptBits_def objBits_simps ko_def archObjSize_def pageBits_def) done from sz sz_weaken have sz': "objBitsKO ko \<le> sz" by simp note al' = is_aligned_weaken[OF al sz_weaken] have koT: "koTypeOf ko = ArchT PTET" by (simp add: ko_def) 

  (* rest used to be generic, but PT arrays are complicating everything *)

   note rl = projectKO_opt_retyp_other [OF cover' pal pno ko_def] note cterl = retype_ctes_helper [OF pal pdst pno al' sz' szb mko cover'] have guard: "c_guard ?ptr" apply (rule is_aligned_c_guard[where n=ptBits and m=2]) apply (simp_all add: al ptr0 align_of_def align_td_array) apply (simp_all add: ptBits_def pageBits_def pteBits_def) done have guard': "\<forall>n < 256. c_guard (pte_Ptr ptr +\<^sub>p int n)" apply (rule retype_guard_helper [OF cover' ptr0 szo', where m=2]) apply (simp_all add: objBits_simps ko_def archObjSize_def align_of_def pteBits_def) done note ptr_retyps.simps[simp del] from rf have pterl: "cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) Ptr cpte_relation" unfolding rf_sr_def cstate_relation_def by (simp add: Let_def cpspace_relation_def) note ht_rl = clift_eq_h_t_valid_eq[OF rl', OF tag_disj_via_td_name, simplified] have pte_arr: "cpspace_pte_array_relation (ksPSpace \<sigma>) (t_hrs_' (globals x))
    \<Longrightarrow> cpspace_pte_array_relation ?ks ?ks'" apply (erule cmap_relation_array_add_array[OF _ al]) apply (simp add: foldr_upd_app_if[folded data_map_insert_def]) apply (rule projectKO_opt_retyp_same, simp add: ko_def projectKOs) apply (simp add: h_t_valid_clift_Some_iff dom_def split: if_split) apply (subst clift_ptr_retyps_gen_prev_memset_same[where n=1, simplified, OF guard],
         simp_all only: szo refl empty, simp_all add: zero)[1] apply (simp add: ptBits_def pageBits_def word_bits_def pteBits_def) apply (auto split: if_split)[1] apply (simp_all add: objBits_simps archObjSize_def ptBits_def
                           pageBits_def ko_def word_bits_def pteBits_def) done from rf have "cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x))" unfolding rf_sr_def cstate_relation_def by (simp add: Let_def) hence "cpspace_relation ?ks (underlying_memory (ksMachineState \<sigma>))  ?ks'" unfolding cpspace_relation_def using pte_arr supply image_cong_simp [cong del] apply (clarsimp simp: rl' cterl cte_C_size tag_disj_via_td_name
                          foldr_upd_app_if [folded data_map_insert_def]) apply (simp add: ht_rl) apply (simp add: ptr_retyp_to_array[simplified]) apply (subst clift_ptr_retyps_gen_prev_memset_same[OF guard'], simp_all only: szo2 empty) apply simp apply (simp(no_asm) add: ptBits_def pageBits_def word_bits_def pteBits_def) apply (simp add: zero) apply (simp add: rl projectKOs del: pte_C_size) apply (simp add: rl projectKO_opt_retyp_same ko_def projectKOs Let_def
                     ptr_add_to_new_cap_addrs [OF szo']
               cong: if_cong del: pte_C_size) apply (erule cmap_relation_retype) apply (insert relrl, auto) done moreover from rf szb al have "ptr_span (pd_Ptr (symbol_table ''armKSGlobalPD'')) \<inter> {ptr ..+ 2 ^ ptBits} = {}" apply (clarsimp simp: valid_global_refs'_def  Let_def
                          valid_refs'_def ran_def rf_sr_def cstate_relation_def) apply (erule disjoint_subset) apply (simp add:kernel_data_refs_disj) done ultimately show ?thesis using rf empty kernel_data_refs_disj rzo apply (simp add: rf_sr_def cstate_relation_def Let_def rl' tag_disj_via_td_name) apply (simp add: carch_state_relation_def cmachine_state_relation_def) apply (clarsimp simp add: rl' cterl tag_disj_via_td_name
      hrs_htd_update ht_rl foldr_upd_app_if [folded data_map_insert_def] rl projectKOs
      cvariable_array_ptr_retyps[OF szo]
      zero_ranges_ptr_retyps[where p="pt_Ptr ptr", simplified szo]) apply (subst h_t_valid_ptr_retyps_gen_disjoint, assumption) apply (simp add:szo cte_C_size cte_level_bits_def) apply (erule disjoint_subset) apply (simp add: ptBits_def pageBits_def pteBits_def del: replicate_numeral) apply (subst h_t_valid_ptr_retyps_gen_disjoint, assumption) apply (simp add:szo cte_C_size cte_level_bits_def) apply (erule disjoint_subset) apply (simp add: ptBits_def pageBits_def pteBits_def del: replicate_numeral) by (simp add:szo ptr_retyps_htd_safe_neg hrs_htd_def
      kernel_data_refs_domain_eq_rotate ptBits_def pageBits_def
      pteBits_def
      Int_ac del: replicate_numeral) qed

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<forall>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
(\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
using this:
(\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}

goal (1 subgoal):
 1. (((\<sigma>, x) \<in> rf_sr &&& range_cover ptr sz ptBits 1 &&& is_aligned ptr ptBits) &&& ptr \<noteq> 0 &&& ptBits \<le> sz &&& sz < word_bits) &&& (pspace_aligned' \<sigma> &&& pspace_distinct' \<sigma> &&& pspace_no_overlap' ptr sz \<sigma>) &&& ((valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> &&& region_is_bytes ptr (2 ^ ptBits) x) &&& heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0 &&& kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} proof (state)
this:
(\<sigma>, x) \<in> rf_sr
range_cover ptr sz ptBits 1
is_aligned ptr ptBits
ptr \<noteq> 0
ptBits \<le> sz
sz < word_bits
pspace_aligned' \<sigma>
pspace_distinct' \<sigma>
pspace_no_overlap' ptr sz \<sigma>
(valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma>
region_is_bytes ptr (2 ^ ptBits) x
heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0
kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
(?i \<in> {?l..?u}) = (?l \<le> ?i \<and> ?i \<le> ?u)
({?a..?b} \<subseteq> {?c..?d}) = (\<not> ?a \<le> ?b \<or> ?c \<le> ?a \<and> ?b \<le> ?d)
(?i \<in> {?l..<?u}) = (?l \<le> ?i \<and> ?i < ?u)
{?a..?b} \<inter> {?c..?d} = {max ?a ?c..min ?b ?d}
({?a..?b} = {}) = (\<not> ?a \<le> ?b)
(\<exists>x. ?P x) = (\<exists>a b. ?P (a, b))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
(?i \<in> {?l..?u}) = (?l \<le> ?i \<and> ?i \<le> ?u)
({?a..?b} \<subseteq> {?c..?d}) = (\<not> ?a \<le> ?b \<or> ?c \<le> ?a \<and> ?b \<le> ?d)
(?i \<in> {?l..<?u}) = (?l \<le> ?i \<and> ?i < ?u)
{?a..?b} \<inter> {?c..?d} = {max ?a ?c..min ?b ?d}
({?a..?b} = {}) = (\<not> ?a \<le> ?b)
(\<exists>x. ?P x) = (\<exists>a b. ?P (a, b))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. \<And>dev. makeObjectKO dev (Inr object_type.PageTableObject) = Some ko proof (state)
this:
makeObjectKO ?dev2 (Inr object_type.PageTableObject) = Some ko

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. cpte_relation makeObject (from_bytes (replicate (size_of TYPE(pte_C)) 0)) proof (prove)
goal (1 subgoal):
 1. let cpte' = pte_lift (from_bytes (replicate (size_of TYPE(pte_C)) 0)) in case makeObject of ARM_H.InvalidPTE \<Rightarrow> cpte' = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) | ARM_H.LargePagePTE frame cacheable global xn rights \<Rightarrow> cpte' = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = frame, XN_CL = of_bool xn, TEX_CL = tex_from_cacheable cacheable, nG_CL = of_bool (\<not> global), S_CL = s_from_cacheable cacheable, APX_CL = 0, AP_CL = ap_from_vm_rights rights, C_CL = 0, B_CL = b_from_cacheable cacheable, reserved_CL = 1\<rparr>) | ARM_H.SmallPagePTE frame cacheable global xn rights \<Rightarrow> cpte' = Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = frame, nG_CL = of_bool (\<not> global), S_CL = s_from_cacheable cacheable, APX_CL = 0, TEX_CL = tex_from_cacheable cacheable, AP_CL = ap_from_vm_rights rights, C_CL = 0, B_CL = b_from_cacheable cacheable, XN_CL = of_bool xn\<rparr>) proof (prove)
goal (1 subgoal):
 1. let cpte' = pte_lift (from_bytes (replicate (size_of TYPE(pte_C)) 0)) in case makeObject of ARM_H.InvalidPTE \<Rightarrow> cpte' = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) | ARM_H.LargePagePTE frame cacheable global xn rights \<Rightarrow> cpte' = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = frame, XN_CL = of_bool xn, TEX_CL = tex_from_cacheable cacheable, nG_CL = of_bool (\<not> global), S_CL = s_from_cacheable cacheable, APX_CL = 0, AP_CL = ap_from_vm_rights rights, C_CL = 0, B_CL = b_from_cacheable cacheable, reserved_CL = 1\<rparr>) | ARM_H.SmallPagePTE frame cacheable global xn rights \<Rightarrow> cpte' = Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = frame, nG_CL = of_bool (\<not> global), S_CL = s_from_cacheable cacheable, APX_CL = 0, TEX_CL = tex_from_cacheable cacheable, AP_CL = ap_from_vm_rights rights, C_CL = 0, B_CL = b_from_cacheable cacheable, XN_CL = of_bool xn\<rparr>) proof (prove)
goal (1 subgoal):
 1. (if pte_get_tag (from_bytes [0, 0, 0, 0]) = SCAST(32 signed \<rightarrow> 32) pte_pte_large then Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] && ~~ mask 16, XN_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 15) && 1, TEX_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 12) && mask 3, nG_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 11) && 1, S_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 10) && 1, APX_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 9) && 1, AP_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 4) && mask 2, C_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 3) && 1, B_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 2) && 1, reserved_CL = pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] && 1\<rparr>) else if pte_get_tag (from_bytes [0, 0, 0, 0]) = SCAST(32 signed \<rightarrow> 32) pte_pte_small then Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] && ~~ mask 12, nG_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 11) && 1, S_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 10) && 1, APX_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 9) && 1, TEX_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 6) && mask 3, AP_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 4) && mask 2, C_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 3) && 1, B_CL = (pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] >> 2) && 1, XN_CL = pte_C.words_C (from_bytes [0, 0, 0, 0]).[0] && 1\<rparr>) else None) = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) proof (prove)
goal (1 subgoal):
 1. (if pte_get_tag (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined) = SCAST(32 signed \<rightarrow> 32) pte_pte_large then Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] && ~~ mask 16, XN_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 15) && 1, TEX_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 12) && mask 3, nG_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 11) && 1, S_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 10) && 1, APX_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 9) && 1, AP_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 4) && mask 2, C_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 3) && 1, B_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 2) && 1, reserved_CL = pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] && 1\<rparr>) else if pte_get_tag (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined) = SCAST(32 signed \<rightarrow> 32) pte_pte_small then Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] && ~~ mask 12, nG_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 11) && 1, S_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 10) && 1, APX_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 9) && 1, TEX_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 6) && mask 3, AP_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 4) && mask 2, C_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 3) && 1, B_CL = (pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] >> 2) && 1, XN_CL = pte_C.words_C (update_ti_t (typ_info_t TYPE(pte_C)) [0, 0, 0, 0] undefined).[0] && 1\<rparr>) else None) = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) proof (prove)
goal (1 subgoal):
 1. (if (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_large then Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] && ~~ mask 16, XN_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 15) && 1, TEX_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 12) && mask 3, nG_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 11) && 1, S_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 10) && 1, APX_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 9) && 1, AP_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 4) && mask 2, C_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 3) && 1, B_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 2) && 1, reserved_CL = pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] && 1\<rparr>) else if (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_small then Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] && ~~ mask 12, nG_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 11) && 1, S_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 10) && 1, APX_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 9) && 1, TEX_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 6) && mask 3, AP_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 4) && mask 2, C_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 3) && 1, B_CL = (pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] >> 2) && 1, XN_CL = pte_C.words_C (update_ti_t (final_pad (ti_typ_pad_combine TYPE(32 word[1]) pte_C.words_C (pte_C.words_C_update \<circ> (\<lambda>x _. x)) ''words_C'' (empty_typ_info ''pte_C''))) [0, 0, 0, 0] undefined).[0] && 1\<rparr>) else None) = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) proof (prove)
goal (1 subgoal):
 1. (if (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_large then Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && ~~ mask 16, XN_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 15) && 1, TEX_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 12) && mask 3, nG_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 11) && 1, S_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 10) && 1, APX_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 9) && 1, AP_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 4) && mask 2, C_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 3) && 1, B_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 2) && 1, reserved_CL = update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && 1\<rparr>) else if (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_small then Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && ~~ mask 12, nG_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 11) && 1, S_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 10) && 1, APX_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 9) && 1, TEX_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 6) && mask 3, AP_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 4) && mask 2, C_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 3) && 1, B_CL = (update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> 2) && 1, XN_CL = update_ti_t (typ_info_t TYPE(32 word[1])) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && 1\<rparr>) else None) = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) proof (prove)
goal (1 subgoal):
 1. (if (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_large then Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && ~~ mask (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))))))), XN_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))))))) && 1, TEX_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))) && mask (Suc (Suc (Suc 0))), nG_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))) && 1, S_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))) && 1, APX_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))) && 1, AP_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc 0)))) && mask (Suc (Suc 0)), C_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc 0))) && 1, B_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc 0)) && 1, reserved_CL = update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && 1\<rparr>) else if (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_small then Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && ~~ mask (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))), nG_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))) && 1, S_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))) && 1, APX_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))) && 1, TEX_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc 0)))))) && mask (Suc (Suc (Suc 0))), AP_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc 0)))) && mask (Suc (Suc 0)), C_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc 0))) && 1, B_CL = (update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc 0)) && 1, XN_CL = update_ti_t (array_tag_n (Suc 0)) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && 1\<rparr>) else None) = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) proof (prove)
goal (1 subgoal):
 1. (if (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_large then Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && ~~ mask (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))))))), XN_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))))))) && 1, TEX_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))) && mask (Suc (Suc (Suc 0))), nG_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))) && 1, S_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))) && 1, APX_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))) && 1, AP_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc 0)))) && mask (Suc (Suc 0)), C_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc 0))) && 1, B_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc 0)) && 1, reserved_CL = update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && 1\<rparr>) else if (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_small then Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && ~~ mask (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))), nG_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))) && 1, S_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))) && 1, APX_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))) && 1, TEX_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc (Suc (Suc 0)))))) && mask (Suc (Suc (Suc 0))), AP_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc (Suc 0)))) && mask (Suc (Suc 0)), C_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc (Suc 0))) && 1, B_CL = (update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] >> Suc (Suc 0)) && 1, XN_CL = update_ti_t (ti_typ_combine TYPE(32 word) (\<lambda>x. x.[0]) (\<lambda>x f. Arrays.update f 0 x) [] (empty_typ_info (CHR ''w'' # CHR ''o'' # CHR ''r'' # CHR ''d'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''0'' # CHR ''1'' # CHR ''0'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string (Suc 0)))) [0, 0, 0, 0] (pte_C.words_C undefined).[0] && 1\<rparr>) else None) = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) proof (prove)
goal (1 subgoal):
 1. (if (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_large then Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) && ~~ mask (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))))))), XN_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))))))) && 1, TEX_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))) && mask (Suc (Suc (Suc 0))), nG_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))) && 1, S_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))) && 1, APX_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))) && 1, AP_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc 0)))) && mask (Suc (Suc 0)), C_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc 0))) && 1, B_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc 0)) && 1, reserved_CL = update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) && 1\<rparr>) else if (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc 0) && 1 = SCAST(32 signed \<rightarrow> 32) pte_pte_small then Some (Pte_pte_small \<lparr>pte_pte_small_CL.address_CL = update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) && ~~ mask (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))))), nG_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))))) && 1, S_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0)))))))))) && 1, APX_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc (Suc 0))))))))) && 1, TEX_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc (Suc (Suc 0)))))) && mask (Suc (Suc (Suc 0))), AP_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc (Suc 0)))) && mask (Suc (Suc 0)), C_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc (Suc 0))) && 1, B_CL = (update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) >> Suc (Suc 0)) && 1, XN_CL = update_ti_t (typ_info_t TYPE(32 word)) [0, 0, 0, 0] (pte_C.words_C undefined.[0]) && 1\<rparr>) else None) = Some (Pte_pte_large \<lparr>pte_pte_large_CL.address_CL = 0, XN_CL = 0, TEX_CL = 0, nG_CL = 0, S_CL = 0, APX_CL = 0, AP_CL = 0, C_CL = 0, B_CL = 0, reserved_CL = 0\<rparr>) proof (prove)
goal:
No subgoals! proof (state)
this:
cpte_relation makeObject (from_bytes (replicate (size_of TYPE(pte_C)) 0))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
cpte_relation makeObject (from_bytes (replicate (size_of TYPE(pte_C)) 0))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. size_of TYPE(pte_C[256]) = 2 ^ ptBits proof (state)
this:
size_of TYPE(pte_C[256]) = 2 ^ ptBits

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. 256 * size_of TYPE(pte_C) = 2 ^ ptBits proof (state)
this:
256 * size_of TYPE(pte_C) = 2 ^ ptBits

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. size_of TYPE(pte_C) = 2 ^ objBitsKO ko proof (state)
this:
size_of TYPE(pte_C) = 2 ^ objBitsKO ko

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
\<lbrakk>typ_uinfo_t TYPE(pte_C[256]) \<bottom>\<^sub>t typ_uinfo_t TYPE(?'b); typ_uinfo_t TYPE(?'b) \<noteq> typ_uinfo_t TYPE(8 word)\<rbrakk> \<Longrightarrow> clift (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) ?arr) (t_hrs_' (globals x))) = cslift x

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. objBitsKO ko \<le> ptBits proof (state)
this:
objBitsKO ko \<le> ptBits

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. range_cover ptr sz (objBitsKO ko) 256 proof (prove)
goal (1 subgoal):
 1. 256 = 2 ^ (ptBits - objBitsKO ko) * 1 proof (prove)
goal:
No subgoals! proof (state)
this:
range_cover ptr sz (objBitsKO ko) 256

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (chain)
picking this:
ptBits \<le> sz
objBitsKO ko \<le> ptBits proof (prove)
using this:
ptBits \<le> sz
objBitsKO ko \<le> ptBits

goal (1 subgoal):
 1. objBitsKO ko \<le> sz proof (state)
this:
objBitsKO ko \<le> sz

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
is_aligned ptr (objBitsKO ko)

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. koTypeOf ko = ArchT PTET proof (state)
this:
koTypeOf ko = ArchT PTET

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
koTypeOf ko = ArchT PTET

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
\<forall>v. projectKO_opt (KOArch (KOPTE makeObject)) \<noteq> Some v \<Longrightarrow> projectKO_opt \<circ>\<^sub>m (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) = projectKO_opt \<circ>\<^sub>m ksPSpace \<sigma>

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
map_to_ctes (\<lambda>xa. if xa \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> xa) = (\<lambda>x. if Inr object_type.PageTableObject = Inr (APIObjectType ArchTypes_H.apiobject_type.CapTableObject) \<and> x \<in> set (new_cap_addrs 256 ptr ko) \<or> Inr object_type.PageTableObject = Inr (APIObjectType ArchTypes_H.apiobject_type.TCBObject) \<and> x && ~~ mask tcbBlockSizeBits \<in> set (new_cap_addrs 256 ptr ko) \<and> x && mask tcbBlockSizeBits \<in> dom tcb_cte_cases then Some (CTE capability.NullCap nullMDBNode) else ctes_of \<sigma> x)

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. c_guard (pt_Ptr ptr) proof (prove)
goal (5 subgoals):
 1. is_aligned (ptr_val (pt_Ptr ptr)) ptBits
 2. ptr_val (pt_Ptr ptr) \<noteq> 0
 3. align_of TYPE(pte_C[256]) = 2\<^sup>2
 4. size_of TYPE(pte_C[256]) \<le> 2 ^ ptBits
 5. 2 \<le> ptBits proof (prove)
goal (2 subgoals):
 1. 1024 \<le> 2 ^ ptBits
 2. 2 \<le> ptBits proof (prove)
goal:
No subgoals! proof (state)
this:
c_guard (pt_Ptr ptr)

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. \<forall>n<256. c_guard (pte_Ptr ptr +\<^sub>p int n) proof (prove)
goal (2 subgoals):
 1. 2 \<le> objBitsKO ko
 2. align_of TYPE(pte_C) = 2\<^sup>2 proof (prove)
goal:
No subgoals! proof (state)
this:
\<forall>n<256. c_guard (pte_Ptr ptr +\<^sub>p int n)

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
ptr_retyps 0 ?p ?d = ?d
ptr_retyps (Suc ?n) ?p ?d = ptr_retyp ?p (ptr_retyps ?n (?p +\<^sub>p 1) ?d)

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (chain)
picking this:
(\<sigma>, x) \<in> rf_sr proof (prove)
using this:
(\<sigma>, x) \<in> rf_sr

goal (1 subgoal):
 1. cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation proof (prove)
using this:
(\<sigma>, x) \<in> {(s, s'). let cheap = t_hrs_' (globals s') in cpspace_relation (ksPSpace s) (underlying_memory (ksMachineState s)) cheap \<and> cready_queues_relation (clift cheap) (ksReadyQueues_' (globals s')) (ksReadyQueues s) \<and> zero_ranges_are_zero (gsUntypedZeroRanges s) cheap \<and> cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals s')) (ksReadyQueuesL1Bitmap s) \<and> cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals s')) (ksReadyQueuesL2Bitmap s) \<and> ksCurThread_' (globals s') = tcb_ptr_to_ctcb_ptr (ksCurThread s) \<and> ksIdleThread_' (globals s') = tcb_ptr_to_ctcb_ptr (ksIdleThread s) \<and> cinterrupt_relation (ksInterruptState s) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals s')) \<and> cscheduler_action_relation (ksSchedulerAction s) (ksSchedulerAction_' (globals s')) \<and> carch_state_relation (ksArchState s) (globals s') \<and> cmachine_state_relation (ksMachineState s) (globals s') \<and> cte_array_relation s (globals s') \<and> tcb_cte_array_relation s (globals s') \<and> apsnd fst (ghost'state_' (globals s')) = (gsUserPages s, gsCNodes s) \<and> ghost_size_rel (ghost'state_' (globals s')) (gsMaxObjectSize s) \<and> ksWorkUnitsCompleted_' (globals s') = ksWorkUnitsCompleted s \<and> s' \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr \<and> ptr_span intStateIRQNode_array_Ptr \<subseteq> kernel_data_refs \<and> s' \<Turnstile>\<^sub>c armKSGlobalPD_Ptr \<and> ptr_span armKSGlobalPD_Ptr \<subseteq> kernel_data_refs \<and> htd_safe domain (hrs_htd (t_hrs_' (globals s'))) \<and> - domain \<subseteq> kernel_data_refs \<and> globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list \<and> cdom_schedule_relation (kernel_state.ksDomSchedule s) kernel_all_global_addresses.ksDomSchedule \<and> ksDomScheduleIdx_' (globals s') = word_of_nat (ksDomScheduleIdx s) \<and> ksCurDomain_' (globals s') = UCAST(8 \<rightarrow> 32) (ksCurDomain s) \<and> ksDomainTime_' (globals s') = ksDomainTime s}

goal (1 subgoal):
 1. cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation proof (state)
this:
cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
\<lbrakk>typ_name (typ_info_t TYPE(?'b1)) \<noteq> ''!pad_typ''; CHR ''p'' # CHR ''t'' # CHR ''e'' # CHR ''_'' # CHR ''C'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string 256 \<notin> td_names (typ_info_t TYPE(?'b1)); typ_name (typ_info_t TYPE(?'b1)) \<noteq> ''pte_C'' \<and> typ_name (typ_info_t TYPE(?'b1)) \<noteq> ''word0000010'' \<and> typ_name (typ_info_t TYPE(?'b1)) \<noteq> ''word0000010_array_10'' \<and> typ_name (typ_info_t TYPE(?'b1)) \<noteq> CHR ''p'' # CHR ''t'' # CHR ''e'' # CHR ''_'' # CHR ''C'' # CHR ''_'' # CHR ''a'' # CHR ''r'' # CHR ''r'' # CHR ''a'' # CHR ''y'' # CHR ''_'' # nat_to_bin_string 256; typ_uinfo_t TYPE(?'b1) \<noteq> typ_uinfo_t TYPE(8 word)\<rbrakk> \<Longrightarrow> h_t_valid (hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) ?arr1) (t_hrs_' (globals x)))) c_guard = c_h_t_valid x

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr \<Longrightarrow> cpspace_pte_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) proof (prove)
goal (6 subgoals):
 1. map_to_ptes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) = (\<lambda>x. if x \<in> set (new_cap_addrs ?sz ptr ?ko) then Some ?v else map_to_ptes (ksPSpace \<sigma>) x)
 2. \<forall>xa. x \<Turnstile>\<^sub>c xa \<longrightarrow> is_aligned (ptr_val xa) ptBits \<Longrightarrow> \<forall>y. hrs_htd (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<Turnstile>\<^sub>t y = (y = pt_Ptr ptr \<or> x \<Turnstile>\<^sub>c y)
 3. ?sz = 2 ^ (ptBits - objBits ?v)
 4. objBitsKO ?ko = objBitsKO (injectKOS ?v)
 5. objBits ?v \<le> ptBits
 6. ptBits < word_bits proof (prove)
goal (6 subgoals):
 1. map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) = (\<lambda>x. if x \<in> set (new_cap_addrs ?sz ptr ?ko) then Some ?v else map_to_ptes (ksPSpace \<sigma>) x)
 2. \<forall>xa. x \<Turnstile>\<^sub>c xa \<longrightarrow> is_aligned (ptr_val xa) ptBits \<Longrightarrow> \<forall>y. hrs_htd (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<Turnstile>\<^sub>t y = (y = pt_Ptr ptr \<or> x \<Turnstile>\<^sub>c y)
 3. ?sz = 2 ^ (ptBits - objBits ?v)
 4. objBitsKO ?ko = objBitsKO (injectKOS ?v)
 5. objBits ?v \<le> ptBits
 6. ptBits < word_bits proof (prove)
goal (5 subgoals):
 1. \<forall>xa. x \<Turnstile>\<^sub>c xa \<longrightarrow> is_aligned (ptr_val xa) ptBits \<Longrightarrow> \<forall>y. hrs_htd (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<Turnstile>\<^sub>t y = (y = pt_Ptr ptr \<or> x \<Turnstile>\<^sub>c y)
 2. 256 = 2 ^ (ptBits - objBits makeObject)
 3. objBitsKO ko = objBitsKO (injectKOS makeObject)
 4. objBits makeObject \<le> ptBits
 5. ptBits < word_bits proof (prove)
goal (5 subgoals):
 1. \<forall>xa. (\<exists>v. cslift x xa = Some v) \<longrightarrow> is_aligned (ptr_val xa) ptBits \<Longrightarrow> \<forall>y. (\<exists>v. clift (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) y = Some v) = (y = pt_Ptr ptr \<or> (\<exists>v. cslift x y = Some v))
 2. 256 = 2 ^ (ptBits - objBits makeObject)
 3. objBitsKO ko = objBitsKO (injectKOS makeObject)
 4. objBits makeObject \<le> ptBits
 5. ptBits < word_bits proof (prove)
goal (6 subgoals):
 1. \<forall>xa. (\<exists>v. cslift x xa = Some v) \<longrightarrow> is_aligned (ptr_val xa) ptBits \<Longrightarrow> ptBits < word_bits
 2. \<forall>xa. (\<exists>v. cslift x xa = Some v) \<longrightarrow> is_aligned (ptr_val xa) ptBits \<Longrightarrow> \<forall>y. (\<exists>v. (if y = pt_Ptr ptr then Some (from_bytes (replicate (2 ^ ptBits) 0)) else cslift x y) = Some v) = (y = pt_Ptr ptr \<or> (\<exists>v. cslift x y = Some v))
 3. 256 = 2 ^ (ptBits - objBits makeObject)
 4. objBitsKO ko = objBitsKO (injectKOS makeObject)
 5. objBits makeObject \<le> ptBits
 6. ptBits < word_bits proof (prove)
goal (5 subgoals):
 1. \<forall>xa. (\<exists>v. cslift x xa = Some v) \<longrightarrow> is_aligned (ptr_val xa) ptBits \<Longrightarrow> \<forall>y. (\<exists>v. (if y = pt_Ptr ptr then Some (from_bytes (replicate (2 ^ ptBits) 0)) else cslift x y) = Some v) = (y = pt_Ptr ptr \<or> (\<exists>v. cslift x y = Some v))
 2. 256 = 2 ^ (ptBits - objBits makeObject)
 3. objBitsKO ko = objBitsKO (injectKOS makeObject)
 4. objBits makeObject \<le> ptBits
 5. ptBits < word_bits proof (prove)
goal (4 subgoals):
 1. 256 = 2 ^ (ptBits - objBits makeObject)
 2. objBitsKO ko = objBitsKO (injectKOS makeObject)
 3. objBits makeObject \<le> ptBits
 4. ptBits < word_bits proof (prove)
goal:
No subgoals! proof (state)
this:
carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr \<Longrightarrow> cpspace_pte_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (chain)
picking this:
(\<sigma>, x) \<in> rf_sr proof (prove)
using this:
(\<sigma>, x) \<in> rf_sr

goal (1 subgoal):
 1. cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)) proof (prove)
using this:
(\<sigma>, x) \<in> {(s, s'). let cheap = t_hrs_' (globals s') in cpspace_relation (ksPSpace s) (underlying_memory (ksMachineState s)) cheap \<and> cready_queues_relation (clift cheap) (ksReadyQueues_' (globals s')) (ksReadyQueues s) \<and> zero_ranges_are_zero (gsUntypedZeroRanges s) cheap \<and> cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals s')) (ksReadyQueuesL1Bitmap s) \<and> cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals s')) (ksReadyQueuesL2Bitmap s) \<and> ksCurThread_' (globals s') = tcb_ptr_to_ctcb_ptr (ksCurThread s) \<and> ksIdleThread_' (globals s') = tcb_ptr_to_ctcb_ptr (ksIdleThread s) \<and> cinterrupt_relation (ksInterruptState s) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals s')) \<and> cscheduler_action_relation (ksSchedulerAction s) (ksSchedulerAction_' (globals s')) \<and> carch_state_relation (ksArchState s) (globals s') \<and> cmachine_state_relation (ksMachineState s) (globals s') \<and> cte_array_relation s (globals s') \<and> tcb_cte_array_relation s (globals s') \<and> apsnd fst (ghost'state_' (globals s')) = (gsUserPages s, gsCNodes s) \<and> ghost_size_rel (ghost'state_' (globals s')) (gsMaxObjectSize s) \<and> ksWorkUnitsCompleted_' (globals s') = ksWorkUnitsCompleted s \<and> s' \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr \<and> ptr_span intStateIRQNode_array_Ptr \<subseteq> kernel_data_refs \<and> s' \<Turnstile>\<^sub>c armKSGlobalPD_Ptr \<and> ptr_span armKSGlobalPD_Ptr \<subseteq> kernel_data_refs \<and> htd_safe domain (hrs_htd (t_hrs_' (globals s'))) \<and> - domain \<subseteq> kernel_data_refs \<and> globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list \<and> cdom_schedule_relation (kernel_state.ksDomSchedule s) kernel_all_global_addresses.ksDomSchedule \<and> ksDomScheduleIdx_' (globals s') = word_of_nat (ksDomScheduleIdx s) \<and> ksCurDomain_' (globals s') = UCAST(8 \<rightarrow> 32) (ksCurDomain s) \<and> ksDomainTime_' (globals s') = ksDomainTime s}

goal (1 subgoal):
 1. cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)) proof (state)
this:
cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
using this:
cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x))

goal (1 subgoal):
 1. cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) proof (prove)
using this:
cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation \<and> cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr \<and> carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr

goal (1 subgoal):
 1. cmap_relation (map_to_ctes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) cte_Ptr ccte_relation \<and> cpspace_tcb_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cmap_relation (map_to_eps (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ep_Ptr (cendpoint_relation (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))))) \<and> cmap_relation (map_to_ntfns (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ntfn_Ptr (cnotification_relation (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))))) \<and> cmap_relation (map_to_pdes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ap_Ptr casid_pool_relation \<and> cpspace_user_data_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_device_data_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_pde_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_pte_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) proof (prove)
using this:
cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation \<and> cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr \<and> carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr
carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr \<Longrightarrow> cpspace_pte_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))

goal (1 subgoal):
 1. cmap_relation (map_to_ctes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) cte_Ptr ccte_relation \<and> cpspace_tcb_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cmap_relation (map_to_eps (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ep_Ptr (cendpoint_relation (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))))) \<and> cmap_relation (map_to_ntfns (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ntfn_Ptr (cnotification_relation (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))))) \<and> cmap_relation (map_to_pdes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ap_Ptr casid_pool_relation \<and> cpspace_user_data_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_device_data_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_pde_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_pte_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) proof (prove)
using this:
cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation \<and> cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr \<and> carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr
carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr \<Longrightarrow> cpspace_pte_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))

goal (1 subgoal):
 1. cmap_relation (map_to_ctes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) cte_Ptr ccte_relation \<and> cpspace_tcb_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cmap_relation (map_to_eps (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ep_Ptr (cendpoint_relation (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))))) \<and> cmap_relation (map_to_ntfns (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ntfn_Ptr (cnotification_relation (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))))) \<and> cmap_relation (map_to_pdes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (clift (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))) ap_Ptr casid_pool_relation \<and> cpspace_user_data_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_device_data_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_pde_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> cpspace_pte_array_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))) proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_tcbs (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (clift (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> cpspace_pde_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_tcbs (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (clift (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (c_h_t_valid x) pd_Ptr proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_tcbs (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (clift (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x)))) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (c_h_t_valid x) pd_Ptr proof (prove)
goal (4 subgoals):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> typ_uinfo_t TYPE(pte_C) \<noteq> typ_uinfo_t TYPE(8 word)
 2. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> 2 ^ ptBits < 2 ^ word_bits
 3. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0
 4. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_tcbs (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (\<lambda>y. if y \<in> ((+\<^sub>p) (pte_Ptr ptr) \<circ> int) ` {k. k < 256} then Some (from_bytes (replicate (size_of TYPE(pte_C)) 0)) else cslift x y) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (c_h_t_valid x) pd_Ptr proof (prove)
goal (3 subgoals):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> 2 ^ ptBits < 2 ^ word_bits
 2. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0
 3. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_tcbs (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (\<lambda>y. if y \<in> ((+\<^sub>p) (pte_Ptr ptr) \<circ> int) ` {k. k < 256} then Some (from_bytes (replicate (size_of TYPE(pte_C)) 0)) else cslift x y) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (c_h_t_valid x) pd_Ptr proof (prove)
goal (2 subgoals):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0
 2. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_tcbs (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (\<lambda>y. if y \<in> ((+\<^sub>p) (pte_Ptr ptr) \<circ> int) ` {k. k < 256} then Some (from_bytes (replicate (size_of TYPE(pte_C)) 0)) else cslift x y) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (c_h_t_valid x) pd_Ptr proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_tcbs (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation \<and> cmap_relation (map_to_eps (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)) \<and> cmap_relation (map_to_ntfns (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)) \<and> cmap_relation (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) pde_Ptr cpde_relation \<and> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (\<lambda>y. if y \<in> ((+\<^sub>p) (pte_Ptr ptr) \<circ> int) ` {k. k < 256} then Some (from_bytes (replicate (size_of TYPE(pte_C)) 0)) else cslift x y) pte_Ptr cpte_relation \<and> cmap_relation (map_to_asidpools (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (cslift x) ap_Ptr casid_pool_relation \<and> cmap_relation (heap_to_user_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation \<and> cmap_relation (heap_to_device_data (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation \<and> carray_map_relation pdBits (map_to_pdes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (c_h_t_valid x) pd_Ptr proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_pte_array_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x))); cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (map_to_ptes (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x)) (\<lambda>y. if y \<in> ((+\<^sub>p) (pte_Ptr ptr) \<circ> int) ` {k. k < 256} then Some (from_bytes (replicate (size_of TYPE(pte_C)) 0)) else cslift x y) pte_Ptr cpte_relation proof (prove)
goal (1 subgoal):
 1. \<lbrakk>carray_map_relation ptBits (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr (KOArch (KOPTE makeObject))) then Some makeObject else map_to_ptes (ksPSpace \<sigma>) x) (h_t_valid (hrs_htd (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x)))) c_guard) pt_Ptr; cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_ptes (ksPSpace \<sigma>)) (cslift x) pte_Ptr cpte_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cmap_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr (KOArch (KOPTE makeObject))) then Some makeObject else map_to_ptes (ksPSpace \<sigma>) x) (\<lambda>y. if y \<in> pte_Ptr ` set (new_cap_addrs 256 ptr (KOArch (KOPTE makeObject))) then Some (from_bytes (replicate (size_of TYPE(pte_C)) 0)) else cslift x y) pte_Ptr cpte_relation proof (prove)
goal (1 subgoal):
 1. \<lbrakk>carray_map_relation ptBits (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr (KOArch (KOPTE makeObject))) then Some makeObject else map_to_ptes (ksPSpace \<sigma>) x) (h_t_valid (hrs_htd (hrs_htd_update (ptr_retyps_gen 256 (pte_Ptr ptr) True) (t_hrs_' (globals x)))) c_guard) pt_Ptr; cmap_relation (ctes_of \<sigma>) (cslift x) cte_Ptr ccte_relation; cmap_relation (map_to_tcbs (ksPSpace \<sigma>)) (cslift x) tcb_ptr_to_ctcb_ptr ctcb_relation; cmap_relation (map_to_eps (ksPSpace \<sigma>)) (cslift x) ep_Ptr (cendpoint_relation (cslift x)); cmap_relation (map_to_ntfns (ksPSpace \<sigma>)) (cslift x) ntfn_Ptr (cnotification_relation (cslift x)); cmap_relation (map_to_pdes (ksPSpace \<sigma>)) (cslift x) pde_Ptr cpde_relation; cmap_relation (map_to_asidpools (ksPSpace \<sigma>)) (cslift x) ap_Ptr casid_pool_relation; cmap_relation (heap_to_user_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_C) cuser_user_data_relation; cmap_relation (heap_to_device_data (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>))) (cslift x) PTR(user_data_device_C) cuser_user_data_device_relation; carray_map_relation pdBits (map_to_pdes (ksPSpace \<sigma>)) (c_h_t_valid x) pd_Ptr; carray_map_relation ptBits (map_to_ptes (ksPSpace \<sigma>)) (c_h_t_valid x) pt_Ptr\<rbrakk> \<Longrightarrow> cpte_relation makeObject (from_bytes (replicate (size_of TYPE(pte_C)) 0)) proof (prove)
goal:
No subgoals! proof (state)
this:
cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (state)
this:
cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (chain)
picking this:
(\<sigma>, x) \<in> rf_sr
sz < word_bits
is_aligned ptr ptBits proof (prove)
using this:
(\<sigma>, x) \<in> rf_sr
sz < word_bits
is_aligned ptr ptBits

goal (1 subgoal):
 1. ptr_span armKSGlobalPD_Ptr \<inter> {ptr..+2 ^ ptBits} = {} proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sz < word_bits; is_aligned ptr ptBits; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); carch_state_relation (ksArchState \<sigma>) (globals x); cmachine_state_relation (ksMachineState \<sigma>) (globals x); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {} proof (prove)
goal (1 subgoal):
 1. \<lbrakk>sz < word_bits; is_aligned ptr ptBits; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); carch_state_relation (ksArchState \<sigma>) (globals x); cmachine_state_relation (ksMachineState \<sigma>) (globals x); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} proof (prove)
goal:
No subgoals! proof (state)
this:
ptr_span armKSGlobalPD_Ptr \<inter> {ptr..+2 ^ ptBits} = {}

goal (1 subgoal):
 1. \<And>\<sigma> x. (\<sigma>, x) \<in> rf_sr \<and> ptr \<noteq> 0 \<and> pspace_aligned' \<sigma> \<and> pspace_distinct' \<sigma> \<and> pspace_no_overlap' ptr sz \<sigma> \<and> (valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma> \<and> (region_is_bytes ptr (2 ^ ptBits) x \<and> heap_list (hrs_mem (t_hrs_' (globals x))) (2 ^ ptBits) ptr = replicate (2 ^ ptBits) 0) \<and> range_cover ptr sz ptBits 1 \<and> valid_global_refs' s \<and> kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {} \<Longrightarrow> (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (chain)
picking this:
cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))
ptr_span armKSGlobalPD_Ptr \<inter> {ptr..+2 ^ ptBits} = {} proof (prove)
using this:
cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))
ptr_span armKSGlobalPD_Ptr \<inter> {ptr..+2 ^ ptBits} = {}

goal (1 subgoal):
 1. (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
using this:
cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x)))
ptr_span armKSGlobalPD_Ptr \<inter> {ptr..+2 ^ ptBits} = {}
(\<sigma>, x) \<in> rf_sr
region_is_bytes ptr (2 ^ ptBits) x
kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}
(valid_objs' and untyped_ranges_zero' and caps_overlap_reserved' {ptr..+2 ^ ptBits}) \<sigma>

goal (1 subgoal):
 1. (\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)) \<and> cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>) \<and> zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)) \<and> cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>) \<and> cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>) \<and> ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>) \<and> ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>) \<and> cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)) \<and> cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)) \<and> carch_state_relation (ksArchState \<sigma>) (globals x) \<and> cmachine_state_relation (ksMachineState \<sigma>) (globals x) \<and> cte_array_relation \<sigma> (globals x) \<and> tcb_cte_array_relation \<sigma> (globals x) \<and> apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>) \<and> ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>) \<and> ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma> \<and> x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr \<and> {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs \<and> x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr \<and> {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs \<and> htd_safe domain (hrs_htd (t_hrs_' (globals x))) \<and> - domain \<subseteq> kernel_data_refs \<and> globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list \<and> cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule \<and> ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>) \<and> ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>) \<and> ksDomainTime_' (globals x) = ksDomainTime \<sigma>; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; valid_objs' \<sigma> \<and> untyped_ranges_zero' \<sigma> \<and> caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>\<rbrakk> \<Longrightarrow> zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> carch_state_relation (ksArchState \<sigma>) (globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>) \<and> cmachine_state_relation (ksMachineState \<sigma>) (globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>) \<and> cvariable_array_map_relation (gsCNodes \<sigma>) ((^) 2) cte_Ptr (hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) \<and> cvariable_array_map_relation (map_to_tcbs (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (\<lambda>x. 5) cte_Ptr (hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) \<and> hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<Turnstile>\<^sub>t intStateIRQNode_array_Ptr \<and> hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<Turnstile>\<^sub>t armKSGlobalPD_Ptr \<and> htd_safe domain (hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_relation (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)) \<and> cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>) \<and> zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)) \<and> cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>) \<and> cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>) \<and> ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>) \<and> ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>) \<and> cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)) \<and> cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)) \<and> armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>) \<and> armKSKernelVSpace (ksArchState \<sigma>) = armKSKernelVSpace_C \<and> array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)) \<and> array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)) \<and> asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot) \<and> carch_globals (ksArchState \<sigma>) \<and> irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)) \<and> irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)) \<and> device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)) \<and> exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)) \<and> machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)) \<and> cte_array_relation \<sigma> (globals x) \<and> tcb_cte_array_relation \<sigma> (globals x) \<and> apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>) \<and> ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>) \<and> ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma> \<and> x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr \<and> {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs \<and> x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr \<and> {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs \<and> htd_safe domain (hrs_htd (t_hrs_' (globals x))) \<and> - domain \<subseteq> kernel_data_refs \<and> globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list \<and> cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule \<and> ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>) \<and> ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>) \<and> ksDomainTime_' (globals x) = ksDomainTime \<sigma>; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; valid_objs' \<sigma> \<and> untyped_ranges_zero' \<sigma> \<and> caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>\<rbrakk> \<Longrightarrow> zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<and> set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m clift (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<circ>\<^sub>m pd_pointer_to_asid_slot) \<and> cvariable_array_map_relation (gsCNodes \<sigma>) ((^) 2) cte_Ptr (hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) \<and> cvariable_array_map_relation (map_to_tcbs (foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>))) (\<lambda>x. 5) cte_Ptr (hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) \<and> hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<Turnstile>\<^sub>t intStateIRQNode_array_Ptr \<and> hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))) \<Turnstile>\<^sub>t armKSGlobalPD_Ptr \<and> htd_safe domain (hrs_htd (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x)))) proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x))) \<Turnstile>\<^sub>t intStateIRQNode_array_Ptr \<and> ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x))) \<Turnstile>\<^sub>t armKSGlobalPD_Ptr \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (2 subgoals):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> ptr_span intStateIRQNode_array_Ptr \<inter> {ptr_val (pt_Ptr ptr)..+Suc 0 * size_of TYPE(pte_C[256])} = {}
 2. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x))) \<Turnstile>\<^sub>t armKSGlobalPD_Ptr \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (2 subgoals):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+4096} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> {symbol_table ''intStateIRQNode''..+4096} \<inter> {ptr..+1024} = {}
 2. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x))) \<Turnstile>\<^sub>t armKSGlobalPD_Ptr \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (2 subgoals):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> kernel_data_refs \<inter> {ptr..+1024} = {}
 2. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x))) \<Turnstile>\<^sub>t armKSGlobalPD_Ptr \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x))) \<Turnstile>\<^sub>t armKSGlobalPD_Ptr \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (2 subgoals):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> ptr_span armKSGlobalPD_Ptr \<inter> {ptr_val (pt_Ptr ptr)..+Suc 0 * size_of TYPE(pte_C[256])} = {}
 2. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> True \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (2 subgoals):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+4096} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+1024} = {}
 2. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> True \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (2 subgoals):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+4096} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> kernel_data_refs \<inter> {ptr..+1024} = {}
 2. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> True \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (prove)
goal (1 subgoal):
 1. \<lbrakk>cpspace_relation (\<lambda>x. if x \<in> set (new_cap_addrs 256 ptr ko) then Some ko else ksPSpace \<sigma> x) (underlying_memory (ksMachineState \<sigma>)) (hrs_htd_update (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False) (t_hrs_' (globals x))); {symbol_table ''armKSGlobalPD''..+16384} \<inter> {ptr..+2 ^ ptBits} = {}; region_is_bytes ptr (2 ^ ptBits) x; kernel_data_refs \<inter> {ptr..+2 ^ ptBits} = {}; cpspace_relation (ksPSpace \<sigma>) (underlying_memory (ksMachineState \<sigma>)) (t_hrs_' (globals x)); valid_objs' \<sigma>; cready_queues_relation (cslift x) (ksReadyQueues_' (globals x)) (ksReadyQueues \<sigma>); untyped_ranges_zero' \<sigma>; caps_overlap_reserved' {ptr..+2 ^ ptBits} \<sigma>; zero_ranges_are_zero (gsUntypedZeroRanges \<sigma>) (t_hrs_' (globals x)); cbitmap_L1_relation (ksReadyQueuesL1Bitmap_' (globals x)) (ksReadyQueuesL1Bitmap \<sigma>); cbitmap_L2_relation (ksReadyQueuesL2Bitmap_' (globals x)) (ksReadyQueuesL2Bitmap \<sigma>); ksCurThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksCurThread \<sigma>); ksIdleThread_' (globals x) = tcb_ptr_to_ctcb_ptr (ksIdleThread \<sigma>); cinterrupt_relation (ksInterruptState \<sigma>) intStateIRQNode_array_Ptr (intStateIRQTable_' (globals x)); cscheduler_action_relation (ksSchedulerAction \<sigma>) (ksSchedulerAction_' (globals x)); armKSNextASID_' (globals x) = armKSNextASID (ksArchState \<sigma>); armKSKernelVSpace_C = armKSKernelVSpace (ksArchState \<sigma>); array_relation ((=) \<circ> option_to_0) 0xFF (armKSHWASIDTable (ksArchState \<sigma>)) (armKSHWASIDTable_' (globals x)); array_relation ((=) \<circ> option_to_ptr) (2 ^ local.asid_high_bits - 1) (armKSASIDTable (ksArchState \<sigma>)) (armKSASIDTable_' (globals x)); asid_map_pd_to_hwasids (armKSASIDMap (ksArchState \<sigma>)) = set_option \<circ> (pde_stored_asid \<circ>\<^sub>m cslift x \<circ>\<^sub>m pd_pointer_to_asid_slot); carch_globals (ksArchState \<sigma>); irq_masks (ksMachineState \<sigma>) = irq_masks (phantom_machine_state_' (globals x)); irq_state (ksMachineState \<sigma>) = irq_state (phantom_machine_state_' (globals x)); device_state (ksMachineState \<sigma>) = device_state (phantom_machine_state_' (globals x)); exclusive_state (ksMachineState \<sigma>) = exclusive_state (phantom_machine_state_' (globals x)); machine_state_rest (ksMachineState \<sigma>) = machine_state_rest (phantom_machine_state_' (globals x)); cte_array_relation \<sigma> (globals x); tcb_cte_array_relation \<sigma> (globals x); apsnd fst (ghost'state_' (globals x)) = (gsUserPages \<sigma>, gsCNodes \<sigma>); ghost_size_rel (ghost'state_' (globals x)) (gsMaxObjectSize \<sigma>); ksWorkUnitsCompleted_' (globals x) = ksWorkUnitsCompleted \<sigma>; x \<Turnstile>\<^sub>c intStateIRQNode_array_Ptr; {symbol_table ''intStateIRQNode''..+256 * size_of TYPE(cte_C)} \<subseteq> kernel_data_refs; x \<Turnstile>\<^sub>c armKSGlobalPD_Ptr; {symbol_table ''armKSGlobalPD''..+16384} \<subseteq> kernel_data_refs; htd_safe domain (hrs_htd (t_hrs_' (globals x))); - domain \<subseteq> kernel_data_refs; globals_list_distinct (- kernel_data_refs) symbol_table kernel_all_global_addresses.global_data_list; cdom_schedule_relation (kernel_state.ksDomSchedule \<sigma>) kernel_all_global_addresses.ksDomSchedule; ksDomScheduleIdx_' (globals x) = word_of_nat (ksDomScheduleIdx \<sigma>); ksCurDomain_' (globals x) = UCAST(8 \<rightarrow> 32) (ksCurDomain \<sigma>); ksDomainTime_' (globals x) = ksDomainTime \<sigma>\<rbrakk> \<Longrightarrow> True \<and> True \<and> htd_safe domain (ptr_retyps_gen (Suc 0) (pt_Ptr ptr) False (hrs_htd (t_hrs_' (globals x)))) proof (state)
this:
(\<sigma>\<lparr>ksPSpace := foldr (\<lambda>addr. data_map_insert addr ko) (new_cap_addrs 256 ptr ko) (ksPSpace \<sigma>)\<rparr>, x\<lparr>globals := globals x\<lparr>t_hrs_' := hrs_htd_update (ptr_retyps_gen 1 (pt_Ptr ptr) False) (t_hrs_' (globals x))\<rparr>\<rparr>) \<in> rf_sr

goal:
No subgoals!