theory SyscallArgs_C

lemma is_syscall_error_codes:
  "is_syscall_error_code f
       (Basic (globals_update (current_syscall_error_'_update f));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f' o f)
       (Basic (globals_update (current_syscall_error_'_update f));;
        Basic (globals_update (current_syscall_error_'_update f'));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f'' o f' o f)
       (Basic (globals_update (current_syscall_error_'_update f));;
        Basic (globals_update (current_syscall_error_'_update f'));;
        Basic (globals_update (current_syscall_error_'_update f''));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code f
       (SKIP;;
        Basic (globals_update (current_syscall_error_'_update f));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f' o f)
       (SKIP;;
        Basic (globals_update (current_syscall_error_'_update f));;
        Basic (globals_update (current_syscall_error_'_update f'));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f'' o f' o f)
       (SKIP;;
        Basic (globals_update (current_syscall_error_'_update f));;
        Basic (globals_update (current_syscall_error_'_update f'));;
        Basic (globals_update (current_syscall_error_'_update f''));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code f
       (Basic_with_globals (globals_update (current_syscall_error_'_update f));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f' o f)
       (Basic_with_globals (globals_update (current_syscall_error_'_update f));;
        Basic_with_globals (globals_update (current_syscall_error_'_update f'));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f'' o f' o f)
       (Basic_with_globals (globals_update (current_syscall_error_'_update f));;
        Basic_with_globals (globals_update (current_syscall_error_'_update f'));;
        Basic_with_globals (globals_update (current_syscall_error_'_update f''));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code f
       (SKIP;;
        Basic_with_globals (globals_update (current_syscall_error_'_update f));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f' o f)
       (SKIP;;
        Basic_with_globals (globals_update (current_syscall_error_'_update f));;
        Basic_with_globals (globals_update (current_syscall_error_'_update f'));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))"
  "is_syscall_error_code (f'' o f' o f)
       (SKIP;;
        Basic_with_globals (globals_update (current_syscall_error_'_update f));;
        Basic_with_globals (globals_update (current_syscall_error_'_update f'));;
        Basic_with_globals (globals_update (current_syscall_error_'_update f''));;
        return_C ret__unsigned_long_'_update (\<lambda>_. scast EXCEPTION_SYSCALL_ERROR))" by ((rule iffD2[OF is_syscall_error_code_def], intro allI,
      rule conseqPre, vcg, safe, (simp_all add: o_def)?)+)

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. ((is_syscall_error_code f (\<acute>globals :== current_syscall_error_'_update f;;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f' \<circ> f) (\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f'' \<circ> f' \<circ> f) (\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
\<acute>globals :== current_syscall_error_'_update f'';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR))) &&& is_syscall_error_code f (SKIP;;
\<acute>globals :== current_syscall_error_'_update f;;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f' \<circ> f) (SKIP;;
\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f'' \<circ> f' \<circ> f) (SKIP;;
\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
\<acute>globals :== current_syscall_error_'_update f'';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR))) &&& (is_syscall_error_code f (\<acute>globals :== current_syscall_error_'_update f;;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f' \<circ> f) (\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f'' \<circ> f' \<circ> f) (\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
\<acute>globals :== current_syscall_error_'_update f'';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR))) &&& is_syscall_error_code f (SKIP;;
\<acute>globals :== current_syscall_error_'_update f;;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f' \<circ> f) (SKIP;;
\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR)) &&& is_syscall_error_code (f'' \<circ> f' \<circ> f) (SKIP;;
\<acute>globals :== current_syscall_error_'_update f;;
\<acute>globals :== current_syscall_error_'_update f';;
\<acute>globals :== current_syscall_error_'_update f'';;
return_C ret__unsigned_long_'_update (\<lambda>_. SCAST(32 signed \<rightarrow> 32) EXCEPTION_SYSCALL_ERROR))