theory Retype_C

lemma memset_spec:
  "\<forall>s. \<Gamma> \<turnstile> \<lbrace>s. ptr_val \<acute>s \<noteq> 0 \<and> ptr_val \<acute>s \<le> ptr_val \<acute>s + (\<acute>n - 1)
         \<and> {ptr_val \<acute>s ..+ unat \<acute>n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd \<acute>t_hrs)
         \<and> gs_get_assn cap_get_capSizeBits_'proc \<acute>ghost'state \<in> insert 0 {\<acute>n ..}\<rbrace>
    Call memset_'proc
   {t. t_hrs_' (globals t) = hrs_mem_update (heap_update_list (ptr_val (s_' s))
                                            (replicate (unat (n_' s)) (ucast (c_' s)))) (t_hrs_' (globals s))}" apply (hoare_rule HoarePartial.ProcNoRec1) apply (clarsimp simp: whileAnno_def) apply (rule_tac I1="{t. (ptr_val (s_' s) \<le> ptr_val (s_' s) + ((n_' s) - 1) \<and> ptr_val (s_' s) \<noteq> 0) \<and>
                             c_' t = c_' s \<and>
                             ptr_val (s_' s) + (n_' s - n_' t) = ptr_val (p___ptr_to_unsigned_char_' t) \<and>
                             n_' t \<le> n_' s \<and>
                             {ptr_val (p___ptr_to_unsigned_char_' t) ..+ unat (n_' t)} \<times> {SIndexVal, SIndexTyp 0}
                                \<subseteq> dom_s (hrs_htd (t_hrs_' (globals t))) \<and>
                             globals t = (globals s)\<lparr> t_hrs_' :=
                             hrs_mem_update (heap_update_list (ptr_val (s_' s))
                                               (replicate (unat (n_' s - n_' t)) (ucast (c_' t))))
                                                      (t_hrs_' (globals s))\<rparr>}"
            and V1=undefined in subst [OF whileAnno_def]) apply vcg apply (clarsimp simp add: hrs_mem_update_def split: if_split_asm) apply (subst (asm) dvd_4_iff_and_mask_eq_0) apply (subst (asm) dvd_4_iff_and_mask_eq_0) apply (rule conjI) apply (rule is_aligned_and_2_to_k, clarsimp simp: mask_def) apply (rule is_aligned_and_2_to_k, clarsimp simp: mask_def) apply clarsimp apply (intro conjI) apply (simp add: ptr_safe_def s_footprint_def s_footprint_untyped_def
                         typ_uinfo_t_def typ_info_word) apply (erule order_trans[rotated]) apply (auto simp: intvl_self unat_gt_0 intro!: intvlI)[1] apply (simp add: c_guard_word8) apply (erule subst) apply (subst lt1_neq0 [symmetric]) apply (rule order_trans) apply (subst lt1_neq0, assumption) apply (erule word_random) apply (rule word_le_minus_mono_right) apply (simp add: lt1_neq0) apply assumption apply (erule order_trans [rotated]) apply (simp add: lt1_neq0) apply (case_tac p___ptr_to_unsigned_char, simp add: CTypesDefs.ptr_add_def unat_minus_one field_simps) apply (metis word_must_wrap word_not_simps(1) linear) apply (erule order_trans[rotated]) apply (clarsimp simp: ptr_val_case split: ptr.splits) apply (erule subsetD[OF intvl_sub_offset, rotated]) apply (simp add: unat_sub word_le_nat_alt word_less_nat_alt) apply (clarsimp simp: ptr_val_case unat_minus_one hrs_mem_update_def split: ptr.splits) apply (subgoal_tac "unat (n - (na - 1)) = Suc (unat (n - na))") apply (erule ssubst, subst replicate_Suc_append) apply (subst heap_update_list_append) apply (simp add: heap_update_word8) apply (subst unatSuc [symmetric]) apply (subst add.commute) apply (metis word_neq_0_conv word_sub_plus_one_nonzero) apply (simp add: field_simps) apply (clarsimp) apply (metis diff_0_right word_gt_0) done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<forall>s. \<Gamma>\<turnstile> \<lbrace>s. ptr_val \<acute>s \<noteq> 0 \<and> ptr_val \<acute>s \<le> ptr_val \<acute>s + (\<acute>n - 1) \<and> {ptr_val \<acute>s..+unat \<acute>n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd \<acute>t_hrs) \<and> gs_get_assn cap_get_capSizeBits_'proc \<acute>ghost'state \<in> insert 0 {\<acute>n..}\<rbrace> Call memset_'proc \<lbrace>\<acute>t_hrs = hrs_mem_update (heap_update_list (ptr_val \<^bsup>s\<^esup>s) (replicate (unat \<^bsup>s\<^esup>n) (UCAST(32 \<rightarrow> 8) \<^bsup>s\<^esup>c))) \<^bsup>s\<^esup>t_hrs\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<forall>s. \<Gamma>\<turnstile> \<lbrace>s. ptr_val \<acute>s \<noteq> 0 \<and> ptr_val \<acute>s \<le> ptr_val \<acute>s + (\<acute>n - 1) \<and> {ptr_val \<acute>s..+unat \<acute>n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd \<acute>t_hrs) \<and> gs_get_assn cap_get_capSizeBits_'proc \<acute>ghost'state \<in> insert 0 {\<acute>n..}\<rbrace> TRY
  lvar_nondet_init p___ptr_to_unsigned_char_' p___ptr_to_unsigned_char_'_update;;
\<acute>ret__int :== (if \<acute>c = SCAST(32 signed \<rightarrow> 32) 0 then 1 else 0);;
IF \<acute>ret__int \<noteq> 0 THEN
  Guard Div_0 \<lbrace>word_of_int (int (size_of TYPE(32 word))) \<noteq> 0\<rbrace> (\<acute>ret__int :== (if ptr_val \<acute>s mod UCAST(32 \<rightarrow> 32) (word_of_int (int (size_of TYPE(32 word)))) = SCAST(32 signed \<rightarrow> 32) 0 then 1 else 0))
FI;;
IF \<acute>ret__int \<noteq> 0 THEN
  Guard Div_0 \<lbrace>word_of_int (int (size_of TYPE(32 word))) \<noteq> 0\<rbrace> (\<acute>ret__int :== (if \<acute>n mod UCAST(32 \<rightarrow> 32) (word_of_int (int (size_of TYPE(32 word)))) = SCAST(32 signed \<rightarrow> 32) 0 then 1 else 0))
FI;;
IF \<not> \<not> \<acute>ret__int \<noteq> 0 THEN
  CALL memzero_'proc(\<acute>s,\<acute>n)
ELSE
  \<acute>p___ptr_to_unsigned_char :== PTR_COERCE(unit \<rightarrow> 8 word) \<acute>s;;
WHILE SCAST(32 signed \<rightarrow> 32) 0 < \<acute>n DO
  Guard C_Guard \<lbrace>ptr_safe \<acute>p___ptr_to_unsigned_char (hrs_htd \<acute>t_hrs) \<and> c_guard \<acute>p___ptr_to_unsigned_char\<rbrace> (\<acute>globals :== t_hrs_'_update (hrs_mem_update (heap_update \<acute>p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) \<acute>c))));;
\<acute>n :== \<acute>n - SCAST(32 signed \<rightarrow> 32) 1;;
Guard MemorySafety \<lbrace>ptr_add_assertion' \<acute>p___ptr_to_unsigned_char (sint 1) False (hrs_htd \<acute>t_hrs)\<rbrace> (\<acute>p___ptr_to_unsigned_char :== \<acute>p___ptr_to_unsigned_char +\<^sub>p sint 1)
OD
FI;;
return_C ret__ptr_to_void_'_update s_';;
Guard DontReach {} SKIP
CATCH SKIP
END \<lbrace>\<acute>t_hrs = hrs_mem_update (heap_update_list (ptr_val \<^bsup>s\<^esup>s) (replicate (unat \<^bsup>s\<^esup>n) (UCAST(32 \<rightarrow> 8) \<^bsup>s\<^esup>c))) \<^bsup>s\<^esup>t_hrs\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>s. \<Gamma>\<turnstile> \<lbrace>s. ptr_val \<acute>s \<noteq> 0 \<and> ptr_val \<acute>s \<le> ptr_val \<acute>s + (\<acute>n - 1) \<and> {ptr_val \<acute>s..+unat \<acute>n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd \<acute>t_hrs) \<and> (gs_get_assn cap_get_capSizeBits_'proc \<acute>ghost'state = 0 \<or> \<acute>n \<le> gs_get_assn cap_get_capSizeBits_'proc \<acute>ghost'state)\<rbrace> TRY
  lvar_nondet_init p___ptr_to_unsigned_char_' p___ptr_to_unsigned_char_'_update;;
\<acute>ret__int :== (if \<acute>c = 0 then 1 else 0);;
IF \<acute>ret__int \<noteq> 0 THEN
  Guard Div_0 UNIV (\<acute>ret__int :== (if ptr_val \<acute>s mod 4 = 0 then 1 else 0))
FI;;
IF \<acute>ret__int \<noteq> 0 THEN
  Guard Div_0 UNIV (\<acute>ret__int :== (if \<acute>n mod 4 = 0 then 1 else 0))
FI;;
IF \<acute>ret__int \<noteq> 0 THEN
  CALL memzero_'proc()
ELSE
  \<acute>p___ptr_to_unsigned_char :== PTR_COERCE(unit \<rightarrow> 8 word) \<acute>s;;
While \<lbrace>0 < \<acute>n\<rbrace> (Guard C_Guard \<lbrace>ptr_safe \<acute>p___ptr_to_unsigned_char (hrs_htd \<acute>t_hrs) \<and> c_guard \<acute>p___ptr_to_unsigned_char\<rbrace> (\<acute>globals :== t_hrs_'_update (hrs_mem_update (heap_update \<acute>p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) \<acute>c))));;
\<acute>n :== \<acute>n - 1;;
Guard MemorySafety UNIV (\<acute>p___ptr_to_unsigned_char :== \<acute>p___ptr_to_unsigned_char +\<^sub>p 1))
FI;;
return_C ret__ptr_to_void_'_update s_';;
Guard DontReach {} SKIP
CATCH SKIP
END \<lbrace>\<acute>t_hrs = hrs_mem_update (heap_update_list (ptr_val \<^bsup>s\<^esup>s) (replicate (unat \<^bsup>s\<^esup>n) (UCAST(32 \<rightarrow> 8) \<^bsup>s\<^esup>c))) \<^bsup>s\<^esup>t_hrs\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<And>s. \<Gamma>\<turnstile> \<lbrace>s. ptr_val \<acute>s \<noteq> 0 \<and> ptr_val \<acute>s \<le> ptr_val \<acute>s + (\<acute>n - 1) \<and> {ptr_val \<acute>s..+unat \<acute>n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd \<acute>t_hrs) \<and> (gs_get_assn cap_get_capSizeBits_'proc \<acute>ghost'state = 0 \<or> \<acute>n \<le> gs_get_assn cap_get_capSizeBits_'proc \<acute>ghost'state)\<rbrace> TRY
  lvar_nondet_init p___ptr_to_unsigned_char_' p___ptr_to_unsigned_char_'_update;;
\<acute>ret__int :== (if \<acute>c = 0 then 1 else 0);;
IF \<acute>ret__int \<noteq> 0 THEN
  Guard Div_0 UNIV (\<acute>ret__int :== (if ptr_val \<acute>s mod 4 = 0 then 1 else 0))
FI;;
IF \<acute>ret__int \<noteq> 0 THEN
  Guard Div_0 UNIV (\<acute>ret__int :== (if \<acute>n mod 4 = 0 then 1 else 0))
FI;;
IF \<acute>ret__int \<noteq> 0 THEN
  CALL memzero_'proc()
ELSE
  \<acute>p___ptr_to_unsigned_char :== PTR_COERCE(unit \<rightarrow> 8 word) \<acute>s;;
WHILE 0 < \<acute>n
INV {t. (ptr_val (s_' s) \<le> ptr_val (s_' s) + (n_' s - 1) \<and> ptr_val (s_' s) \<noteq> 0) \<and> c_' t = c_' s \<and> ptr_val (s_' s) + (n_' s - n_' t) = ptr_val (p___ptr_to_unsigned_char_' t) \<and> n_' t \<le> n_' s \<and> {ptr_val (p___ptr_to_unsigned_char_' t)..+unat (n_' t)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (t_hrs_' (globals t))) \<and> globals t = globals s\<lparr>t_hrs_' := hrs_mem_update (heap_update_list (ptr_val (s_' s)) (replicate (unat (n_' s - n_' t)) (UCAST(32 \<rightarrow> 8) (c_' t)))) (t_hrs_' (globals s))\<rparr>}
DO
  Guard C_Guard \<lbrace>ptr_safe \<acute>p___ptr_to_unsigned_char (hrs_htd \<acute>t_hrs) \<and> c_guard \<acute>p___ptr_to_unsigned_char\<rbrace> (\<acute>globals :== t_hrs_'_update (hrs_mem_update (heap_update \<acute>p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) \<acute>c))));;
\<acute>n :== \<acute>n - 1;;
Guard MemorySafety UNIV (\<acute>p___ptr_to_unsigned_char :== \<acute>p___ptr_to_unsigned_char +\<^sub>p 1)
OD
FI;;
return_C ret__ptr_to_void_'_update s_';;
Guard DontReach {} SKIP
CATCH SKIP
END \<lbrace>\<acute>t_hrs = hrs_mem_update (heap_update_list (ptr_val \<^bsup>s\<^esup>s) (replicate (unat \<^bsup>s\<^esup>n) (UCAST(32 \<rightarrow> 8) \<^bsup>s\<^esup>c))) \<^bsup>s\<^esup>t_hrs\<rbrace> proof (prove)
goal (3 subgoals):
 1. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c. \<lbrakk>ptr_val s \<noteq> 0; ptr_val s \<le> ptr_val s + (n - 1); {ptr_val s..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs); ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) ghost'state = 0 \<or> n \<le> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) ghost'state\<rbrakk> \<Longrightarrow> ((if c = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> True \<and> ((if ptr_val s mod 4 = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> ((if n mod 4 = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> ptr_val s \<noteq> 0 \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> is_aligned (ptr_val s) 2 \<and> is_aligned n 2 \<and> {ptr_val s..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs) \<and> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>x. snd (snd x)) ghost'state \<in> insert 0 {n..} \<and> (\<forall>t_hrsa. t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(?'a77 \<rightarrow> 8) 0))) t_hrs \<longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs)) \<and> ((if n mod 4 = 0 then 1 else 0) = 0 \<longrightarrow> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> c = c \<and> ptr_val s + (n - n) = ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s) \<and> n \<le> n \<and> {ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s)..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs) \<and> \<lparr>t_hrs_' = t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - n)) (UCAST(32 \<rightarrow> 8) c))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>)) \<and> ((if ptr_val s mod 4 = 0 then 1 else 0) = 0 \<longrightarrow> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> c = c \<and> ptr_val s + (n - n) = ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s) \<and> n \<le> n \<and> {ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s)..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs) \<and> \<lparr>t_hrs_' = t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - n)) (UCAST(32 \<rightarrow> 8) c))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>)) \<and> (\<not> (if c = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> ((if c = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> True \<and> ((if n mod 4 = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> ptr_val s \<noteq> 0 \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> is_aligned (ptr_val s) 2 \<and> is_aligned n 2 \<and> {ptr_val s..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs) \<and> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>x. snd (snd x)) ghost'state \<in> insert 0 {n..} \<and> (\<forall>t_hrsa. t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(?'a77 \<rightarrow> 8) 0))) t_hrs \<longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs)) \<and> ((if n mod 4 = 0 then 1 else 0) = 0 \<longrightarrow> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> c = c \<and> ptr_val s + (n - n) = ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s) \<and> n \<le> n \<and> {ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s)..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs) \<and> \<lparr>t_hrs_' = t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - n)) (UCAST(32 \<rightarrow> 8) c))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>)) \<and> (\<not> (if c = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> ((if c = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> ptr_val s \<noteq> 0 \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> is_aligned (ptr_val s) 2 \<and> is_aligned n 2 \<and> {ptr_val s..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs) \<and> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>x. snd (snd x)) ghost'state \<in> insert 0 {n..} \<and> (\<forall>t_hrsa. t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(?'a77 \<rightarrow> 8) 0))) t_hrs \<longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs)) \<and> (\<not> (if c = 0 then 1 else 0) \<noteq> 0 \<longrightarrow> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> c = c \<and> ptr_val s + (n - n) = ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s) \<and> n \<le> n \<and> {ptr_val (PTR_COERCE(unit \<rightarrow> 8 word) s)..+unat n} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrs) \<and> \<lparr>t_hrs_' = t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - n)) (UCAST(32 \<rightarrow> 8) c))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>)))
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd t_hrsa) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> ca = c \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd (hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa)) \<and> \<lparr>t_hrs_' = hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b aa ab ba s n. \<lbrakk>ptr_val s \<noteq> 0; ptr_val s \<le> ptr_val s + (n - 1); {ptr_val s..+unat n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba) = 0 \<or> n \<le> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba); 4 dvd ptr_val s; 4 dvd n\<rbrakk> \<Longrightarrow> is_aligned (ptr_val s) 2 \<and> is_aligned n 2
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd t_hrsa) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> ca = c \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd (hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa)) \<and> \<lparr>t_hrs_' = hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b aa ab ba s n. \<lbrakk>ptr_val s \<noteq> 0; ptr_val s \<le> ptr_val s + (n - 1); {ptr_val s..+unat n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba) = 0 \<or> n \<le> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba); ptr_val s && mask 2 = 0; 4 dvd n\<rbrakk> \<Longrightarrow> is_aligned (ptr_val s) 2 \<and> is_aligned n 2
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd t_hrsa) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> ca = c \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd (hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa)) \<and> \<lparr>t_hrs_' = hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b aa ab ba s n. \<lbrakk>ptr_val s \<noteq> 0; ptr_val s \<le> ptr_val s + (n - 1); {ptr_val s..+unat n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba) = 0 \<or> n \<le> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba); ptr_val s && mask 2 = 0; n && mask 2 = 0\<rbrakk> \<Longrightarrow> is_aligned (ptr_val s) 2 \<and> is_aligned n 2
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd t_hrsa) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> ca = c \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd (hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa)) \<and> \<lparr>t_hrs_' = hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (4 subgoals):
 1. \<And>a b aa ab ba s n. \<lbrakk>ptr_val s \<noteq> 0; ptr_val s \<le> ptr_val s + (n - 1); {ptr_val s..+unat n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba) = 0 \<or> n \<le> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba); ptr_val s && mask 2 = 0; n && mask 2 = 0\<rbrakk> \<Longrightarrow> is_aligned (ptr_val s) 2
 2. \<And>a b aa ab ba s n. \<lbrakk>ptr_val s \<noteq> 0; ptr_val s \<le> ptr_val s + (n - 1); {ptr_val s..+unat n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba) = 0 \<or> n \<le> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba); ptr_val s && mask 2 = 0; n && mask 2 = 0\<rbrakk> \<Longrightarrow> is_aligned n 2
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd t_hrsa) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> ca = c \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd (hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa)) \<and> \<lparr>t_hrs_' = hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>
 4. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b aa ab ba s n. \<lbrakk>ptr_val s \<noteq> 0; ptr_val s \<le> ptr_val s + (n - 1); {ptr_val s..+unat n} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba) = 0 \<or> n \<le> ghost_assertion_data_get cap_get_capSizeBits_'proc (\<lambda>a. snd (snd a)) (aa, ab, ba); ptr_val s && mask 2 = 0; n && mask 2 = 0\<rbrakk> \<Longrightarrow> is_aligned n 2
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd t_hrsa) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> ca = c \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd (hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa)) \<and> \<lparr>t_hrs_' = hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (2 subgoals):
 1. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd t_hrsa) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s \<le> ptr_val s + (n - 1) \<and> ptr_val s \<noteq> 0 \<and> ca = c \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd (hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa)) \<and> \<lparr>t_hrs_' = hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) ca)) t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (2 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd (a, b)) \<and> c_guard p___ptr_to_unsigned_char \<and> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1) \<and> na - 1 \<le> n \<and> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)) \<and> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (7 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_safe p___ptr_to_unsigned_char (hrs_htd (a, b))
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> c_guard p___ptr_to_unsigned_char
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 6. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 7. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (7 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {(ptr_val p___ptr_to_unsigned_char, k) |k. k = SIndexVal \<or> k = SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> c_guard p___ptr_to_unsigned_char
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 6. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 7. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (7 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {(ptr_val p___ptr_to_unsigned_char, k) |k. k = SIndexVal \<or> k = SIndexTyp 0} \<subseteq> {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0}
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> c_guard p___ptr_to_unsigned_char
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 6. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 7. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> c_guard p___ptr_to_unsigned_char
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val p___ptr_to_unsigned_char \<noteq> 0
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - na) \<noteq> 0
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> 1 \<le> ptr_val s + (n - na)
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (7 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> 1 \<le> ?y186 a b s n c aa ba p___ptr_to_unsigned_char na
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ?y186 a b s n c aa ba p___ptr_to_unsigned_char na \<le> ptr_val s + (n - na)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 6. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 7. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s \<le> ptr_val s + (n - na)
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> n - na \<le> n - 1
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (8 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> 1 \<le> na
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na \<le> n
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 6. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 7. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 8. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (7 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na \<le> n
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> 1 \<le> n
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 6. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 7. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> 1 \<le> n
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (6 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<noteq> 0; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> 1 \<le> na
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 5. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 6. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (5 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> ptr_val s + (n - (na - 1)) = ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 4. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 5. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (4 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> na - 1 \<le> n
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 3. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 4. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b))
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> {ptr_val (p___ptr_to_unsigned_char +\<^sub>p 1)..+unat (na - 1)} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0}
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b n c aa ba na x ab bb. \<lbrakk>na \<le> n; (aa, ba) = hrs_mem_update (heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na; x \<le> x + (n - 1); x \<noteq> 0; ab \<in> {x + (n - na) + 1..+unat (na - 1)}; bb = SIndexVal \<or> bb = SIndexTyp 0\<rbrakk> \<Longrightarrow> ab \<in> {x + (n - na)..+unat na}
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b n c aa ba na x ab bb. \<lbrakk>na \<le> n; (aa, ba) = hrs_mem_update (heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na; x \<le> x + (n - 1); x \<noteq> 0; bb = SIndexVal \<or> bb = SIndexTyp 0\<rbrakk> \<Longrightarrow> unat 1 + unat (na - 1) \<le> unat na
 2. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (2 subgoals):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update p___ptr_to_unsigned_char (UCAST(32 \<rightarrow> 8) c)) (hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b)) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c))) (a, b)
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (2 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> heap_update (PTR(8 word) (x + (n - na))) (UCAST(32 \<rightarrow> 8) c) (heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c)) a) = heap_update_list x (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c)) a
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0; unat (n - (na - 1)) = Suc (unat (n - na))\<rbrakk> \<Longrightarrow> heap_update (PTR(8 word) (x + (n - na))) (UCAST(32 \<rightarrow> 8) c) (heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c)) a) = heap_update_list x (replicate (unat (n - (na - 1))) (UCAST(32 \<rightarrow> 8) c)) a
 2. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (n - (na - 1)) = Suc (unat (n - na))
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> heap_update (PTR(8 word) (x + (n - na))) (UCAST(32 \<rightarrow> 8) c) (heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c)) a) = heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c) @ [UCAST(32 \<rightarrow> 8) c]) a
 2. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (n - (na - 1)) = Suc (unat (n - na))
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> heap_update (PTR(8 word) (x + (n - na))) (UCAST(32 \<rightarrow> 8) c) (heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c)) a) = heap_update_list (x + word_of_nat (length (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c)))) [UCAST(32 \<rightarrow> 8) c] (heap_update_list x (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c)) a)
 2. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (n - (na - 1)) = Suc (unat (n - na))
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (2 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (n - (na - 1)) = Suc (unat (n - na))
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> 1 + (n - na) \<noteq> 0
 2. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (n - (na - 1)) = unat (1 + (n - na))
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (3 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> n - na + 1 \<noteq> 0
 2. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (n - (na - 1)) = unat (1 + (n - na))
 3. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (2 subgoals):
 1. \<And>a b n c na x. \<lbrakk>na \<le> n; {x + (n - na)..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); 0 < na; x \<le> x + (n - 1); x \<noteq> 0\<rbrakk> \<Longrightarrow> unat (n - (na - 1)) = unat (1 + (n - na))
 2. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (1 subgoal):
 1. \<And>t_hrs phantom_machine_state ghost'state avail_reg ksNumCPUs ndks_boot active_irq rootserver ksCurDomain ksCurThread ksDomainTime ksIdleThread tlbLockCount armKSNextASID current_fault ksReadyQueues armKSASIDTable rootserver_mem armKSHWASIDTable intStateIRQTable ksDomScheduleIdx ksSchedulerAction current_extra_caps isFPUEnabledCached current_lookup_fault ksWorkUnitsCompleted current_syscall_error ksReadyQueuesL1Bitmap ksReadyQueuesL2Bitmap more s n c t_hrsa phantom_machine_statea ghost'statea avail_rega ksNumCPUsa ndks_boota active_irqa rootservera ksCurDomaina ksCurThreada ksDomainTimea ksIdleThreada tlbLockCounta armKSNextASIDa current_faulta ksReadyQueuesa armKSASIDTablea rootserver_mema armKSHWASIDTablea intStateIRQTablea ksDomScheduleIdxa ksSchedulerActiona current_extra_capsa isFPUEnabledCacheda current_lookup_faulta ksWorkUnitsCompleteda current_syscall_errora ksReadyQueuesL1Bitmapa ksReadyQueuesL2Bitmapa morea p___ptr_to_unsigned_char na ca. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ca = c; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> insert SIndexVal (Collect ((=) (SIndexTyp 0))) \<subseteq> dom_s (hrs_htd t_hrsa); \<lparr>t_hrs_' = t_hrsa, phantom_machine_state_' = phantom_machine_statea, ghost'state_' = ghost'statea, avail_reg_' = avail_rega, ksNumCPUs_' = ksNumCPUsa, ndks_boot_' = ndks_boota, active_irq_' = active_irqa, rootserver_' = rootservera, ksCurDomain_' = ksCurDomaina, ksCurThread_' = ksCurThreada, ksDomainTime_' = ksDomainTimea, ksIdleThread_' = ksIdleThreada, tlbLockCount_' = tlbLockCounta, armKSNextASID_' = armKSNextASIDa, current_fault_' = current_faulta, ksReadyQueues_' = ksReadyQueuesa, armKSASIDTable_' = armKSASIDTablea, rootserver_mem_' = rootserver_mema, armKSHWASIDTable_' = armKSHWASIDTablea, intStateIRQTable_' = intStateIRQTablea, ksDomScheduleIdx_' = ksDomScheduleIdxa, ksSchedulerAction_' = ksSchedulerActiona, current_extra_caps_' = current_extra_capsa, isFPUEnabledCached_' = isFPUEnabledCacheda, current_lookup_fault_' = current_lookup_faulta, ksWorkUnitsCompleted_' = ksWorkUnitsCompleteda, current_syscall_error_' = current_syscall_errora, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmapa, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmapa, \<dots> = morea\<rparr> = \<lparr>t_hrs_' = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) ca))) t_hrs, phantom_machine_state_' = phantom_machine_state, ghost'state_' = ghost'state, avail_reg_' = avail_reg, ksNumCPUs_' = ksNumCPUs, ndks_boot_' = ndks_boot, active_irq_' = active_irq, rootserver_' = rootserver, ksCurDomain_' = ksCurDomain, ksCurThread_' = ksCurThread, ksDomainTime_' = ksDomainTime, ksIdleThread_' = ksIdleThread, tlbLockCount_' = tlbLockCount, armKSNextASID_' = armKSNextASID, current_fault_' = current_fault, ksReadyQueues_' = ksReadyQueues, armKSASIDTable_' = armKSASIDTable, rootserver_mem_' = rootserver_mem, armKSHWASIDTable_' = armKSHWASIDTable, intStateIRQTable_' = intStateIRQTable, ksDomScheduleIdx_' = ksDomScheduleIdx, ksSchedulerAction_' = ksSchedulerAction, current_extra_caps_' = current_extra_caps, isFPUEnabledCached_' = isFPUEnabledCached, current_lookup_fault_' = current_lookup_fault, ksWorkUnitsCompleted_' = ksWorkUnitsCompleted, current_syscall_error_' = current_syscall_error, ksReadyQueuesL1Bitmap_' = ksReadyQueuesL1Bitmap, ksReadyQueuesL2Bitmap_' = ksReadyQueuesL2Bitmap, \<dots> = more\<rparr>; \<not> 0 < na\<rbrakk> \<Longrightarrow> t_hrsa = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) t_hrs proof (prove)
goal (1 subgoal):
 1. \<And>a b s n c aa ba p___ptr_to_unsigned_char na. \<lbrakk>ptr_val s \<le> ptr_val s + (n - 1); ptr_val s \<noteq> 0; ptr_val s + (n - na) = ptr_val p___ptr_to_unsigned_char; na \<le> n; {ptr_val p___ptr_to_unsigned_char..+unat na} \<times> {SIndexVal, SIndexTyp 0} \<subseteq> dom_s (hrs_htd (a, b)); (aa, ba) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b); \<not> 0 < na\<rbrakk> \<Longrightarrow> hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat (n - na)) (UCAST(32 \<rightarrow> 8) c))) (a, b) = hrs_mem_update (heap_update_list (ptr_val s) (replicate (unat n) (UCAST(32 \<rightarrow> 8) c))) (a, b) proof (prove)
goal:
No subgoals!