theory RPCTo

lemma get_increment_64_x_nf:
  "\<forall>s43'.
    \<lbrace>\<lambda>s44'. globals_frame_intact s44' \<and>
            ipc_buffer_valid s44' \<and>
            tls_valid s44' \<and>
            thread_index_C (tls s44') \<in> {1..thread_count} \<and>
            is_valid_w64 s44' (Ptr (symbol_table ''increment_64_x_1'')) \<and>
            is_valid_w64 s44' (Ptr (symbol_table ''increment_64_x_2'')) \<and>
            s44' = s43'\<rbrace>
     get_increment_64_x'
    \<lbrace>\<lambda>r45' s44'. r45' \<in> {Ptr (symbol_table
      ''increment_64_x_1''), Ptr (symbol_table ''increment_64_x_2'')} \<and>
      s44' = s43'\<rbrace>!" apply (rule allI) apply (simp add:get_increment_64_x'_def) apply (wp seL4_GetIPCBuffer_wp) apply (clarsimp simp:thread_count_def tls_valid_def tls_def) apply unat_arith done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<forall>s43'. \<lbrace>\<lambda>s44'. globals_frame_intact s44' \<and> ipc_buffer_valid s44' \<and> tls_valid s44' \<and> thread_index_C (tls s44') \<in> {1..thread_count} \<and> is_valid_w64 s44' (PTR(64 word) (symbol_table ''increment_64_x_1'')) \<and> is_valid_w64 s44' (PTR(64 word) (symbol_table ''increment_64_x_2'')) \<and> s44' = s43'\<rbrace> get_increment_64_x' \<lbrace>\<lambda>r45' s44'. r45' \<in> {PTR(64 word) (symbol_table ''increment_64_x_1''), PTR(64 word) (symbol_table ''increment_64_x_2'')} \<and> s44' = s43'\<rbrace>! proof (prove)
goal (1 subgoal):
 1. \<And>s43'. \<lbrace>\<lambda>s44'. globals_frame_intact s44' \<and> ipc_buffer_valid s44' \<and> tls_valid s44' \<and> thread_index_C (tls s44') \<in> {1..thread_count} \<and> is_valid_w64 s44' (PTR(64 word) (symbol_table ''increment_64_x_1'')) \<and> is_valid_w64 s44' (PTR(64 word) (symbol_table ''increment_64_x_2'')) \<and> s44' = s43'\<rbrace> get_increment_64_x' \<lbrace>\<lambda>r45' s44'. r45' \<in> {PTR(64 word) (symbol_table ''increment_64_x_1''), PTR(64 word) (symbol_table ''increment_64_x_2'')} \<and> s44' = s43'\<rbrace>! proof (prove)
goal (1 subgoal):
 1. \<And>s43'. \<lbrace>\<lambda>s44'. globals_frame_intact s44' \<and> ipc_buffer_valid s44' \<and> tls_valid s44' \<and> 1 \<le> thread_index_C (tls s44') \<and> thread_index_C (tls s44') \<le> thread_count \<and> is_valid_w64 s44' (PTR(64 word) (symbol_table ''increment_64_x_1'')) \<and> is_valid_w64 s44' (PTR(64 word) (symbol_table ''increment_64_x_2'')) \<and> s44' = s43'\<rbrace> do ret' <- camkes_get_tls';
y <- guard (\<lambda>s. is_valid_camkes_tls_t_C s ret');
condition (\<lambda>s. thread_index_C (heap_camkes_tls_t_C s ret') = 1)
  (do y <- guard (\<lambda>s. is_valid_w64 s (PTR(64 word) (symbol_table ''increment_64_x_1'')));
return (PTR(64 word) (symbol_table ''increment_64_x_1''))
od)
  condition (\<lambda>s. thread_index_C (heap_camkes_tls_t_C s ret') = 2)
  (do y <- guard (\<lambda>s. is_valid_w64 s (PTR(64 word) (symbol_table ''increment_64_x_2'')));
return (PTR(64 word) (symbol_table ''increment_64_x_2''))
od)
  (do y <- abort';
fail
od)
od \<lbrace>\<lambda>r45' s44'. (r45' = PTR(64 word) (symbol_table ''increment_64_x_1'') \<or> r45' = PTR(64 word) (symbol_table ''increment_64_x_2'')) \<and> s44' = s43'\<rbrace>! proof (prove)
goal (1 subgoal):
 1. \<And>s43' s. globals_frame_intact s \<and> ipc_buffer_valid s \<and> tls_valid s \<and> 1 \<le> thread_index_C (tls s) \<and> thread_index_C (tls s) \<le> thread_count \<and> is_valid_w64 s (PTR(64 word) (symbol_table ''increment_64_x_1'')) \<and> is_valid_w64 s (PTR(64 word) (symbol_table ''increment_64_x_2'')) \<and> s = s43' \<Longrightarrow> tls_valid s \<and> globals_frame_intact s \<and> (if thread_index_C (heap_camkes_tls_t_C s (tls_ptr s)) = 1 then ((PTR(64 word) (symbol_table ''increment_64_x_1'') = PTR(64 word) (symbol_table ''increment_64_x_1'') \<or> PTR(64 word) (symbol_table ''increment_64_x_1'') = PTR(64 word) (symbol_table ''increment_64_x_2'')) \<and> s = s43') \<and> is_valid_w64 s (PTR(64 word) (symbol_table ''increment_64_x_1'')) else if thread_index_C (heap_camkes_tls_t_C s (tls_ptr s)) = 2 then ((PTR(64 word) (symbol_table ''increment_64_x_2'') = PTR(64 word) (symbol_table ''increment_64_x_1'') \<or> PTR(64 word) (symbol_table ''increment_64_x_2'') = PTR(64 word) (symbol_table ''increment_64_x_2'')) \<and> s = s43') \<and> is_valid_w64 s (PTR(64 word) (symbol_table ''increment_64_x_2'')) else False) \<and> is_valid_camkes_tls_t_C s (tls_ptr s) proof (prove)
goal (1 subgoal):
 1. \<And>s43'. \<lbrakk>globals_frame_intact s43'; ipc_buffer_valid s43'; is_valid_camkes_tls_t_C s43' (tls_ptr s43'); 1 \<le> thread_index_C (heap_camkes_tls_t_C s43' (tls_ptr s43')); thread_index_C (heap_camkes_tls_t_C s43' (tls_ptr s43')) \<le> 2; is_valid_w64 s43' (PTR(64 word) (symbol_table ''increment_64_x_1'')); is_valid_w64 s43' (PTR(64 word) (symbol_table ''increment_64_x_2'')); thread_index_C (heap_camkes_tls_t_C s43' (tls_ptr s43')) \<noteq> 2\<rbrakk> \<Longrightarrow> thread_index_C (heap_camkes_tls_t_C s43' (tls_ptr s43')) = 1 proof (prove)
goal:
No subgoals!