theory Syscall_R

lemma threadSet_tcbDomain_update_ct_not_inQ:
  "\<lbrace>ct_not_inQ \<rbrace> threadSet (tcbDomain_update (\<lambda>_. domain)) t \<lbrace>\<lambda>_. ct_not_inQ\<rbrace>" apply (simp add: threadSet_def ct_not_inQ_def) apply (wp) apply (rule hoare_convert_imp [OF setObject_nosch]) apply (rule updateObject_tcb_inv) apply (wps setObject_ct_inv) apply (wp setObject_tcb_strongest getObject_tcb_wp)+ apply (case_tac "t = ksCurThread s") apply (clarsimp simp: obj_at'_def)+ done

(* Proof state trace *)
proof (prove)
goal (1 subgoal):
 1. \<lbrace>ct_not_inQ\<rbrace> threadSet (tcbDomain_update (\<lambda>_. domain)) t \<lbrace>\<lambda>_. ct_not_inQ\<rbrace> proof (prove)
goal (1 subgoal):
 1. \<lbrace>\<lambda>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s\<rbrace> do tcb <- getObject t;
setObject t (tcbDomain_update (\<lambda>_. domain) tcb)
od \<lbrace>\<lambda>_ s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s\<rbrace> proof (prove)
goal (3 subgoals):
 1. \<And>tcb. \<lbrace>?B1 tcb\<rbrace> setObject t (tcbDomain_update (\<lambda>_. domain) tcb) \<lbrace>\<lambda>_ s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s\<rbrace>
 2. \<lbrace>?Q\<rbrace> getObject t \<lbrace>?B1\<rbrace>
 3. \<And>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s \<Longrightarrow> ?Q s proof (prove)
goal (4 subgoals):
 1. \<And>tcb p q n ko. \<lbrace>\<lambda>s. ksSchedulerAction s \<noteq> ResumeCurrentThread\<rbrace> updateObject (tcbDomain_update (\<lambda>_. domain) tcb) p q n ko \<lbrace>\<lambda>_ s. ksSchedulerAction s \<noteq> ResumeCurrentThread\<rbrace>
 2. \<And>tcb. \<lbrace>?R2 tcb\<rbrace> setObject t (tcbDomain_update (\<lambda>_. domain) tcb) \<lbrace>\<lambda>rv s. obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s\<rbrace>
 3. \<lbrace>?Q\<rbrace> getObject t \<lbrace>\<lambda>tcb s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ?R2 tcb s\<rbrace>
 4. \<And>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s \<Longrightarrow> ?Q s proof (prove)
goal (3 subgoals):
 1. \<And>tcb. \<lbrace>?R2 tcb\<rbrace> setObject t (tcbDomain_update (\<lambda>_. domain) tcb) \<lbrace>\<lambda>rv s. obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s\<rbrace>
 2. \<lbrace>?Q\<rbrace> getObject t \<lbrace>\<lambda>tcb s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ?R2 tcb s\<rbrace>
 3. \<And>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s \<Longrightarrow> ?Q s proof (prove)
goal (3 subgoals):
 1. \<And>tcb prev_s. \<lbrace>?P8 tcb prev_s\<rbrace> setObject t (tcbDomain_update (\<lambda>_. domain) tcb) \<lbrace>\<lambda>rv. obj_at' (Not \<circ> tcbQueued) (ksCurThread prev_s)\<rbrace>
 2. \<lbrace>?Q\<rbrace> getObject t \<lbrace>\<lambda>tcb s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> ?P8 tcb s s\<rbrace>
 3. \<And>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s \<Longrightarrow> ?Q s proof (prove)
goal (1 subgoal):
 1. \<And>s. ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s \<Longrightarrow> tcb_at' t s \<longrightarrow> (\<exists>ta. ko_at' ta t s \<and> (ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> (if t = ksCurThread s then (Not \<circ> tcbQueued) (tcbDomain_update (\<lambda>_. domain) ta) else obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s))) proof (prove)
goal (2 subgoals):
 1. \<And>s. \<lbrakk>ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s; t = ksCurThread s\<rbrakk> \<Longrightarrow> tcb_at' t s \<longrightarrow> (\<exists>ta. ko_at' ta t s \<and> (ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> (if t = ksCurThread s then (Not \<circ> tcbQueued) (tcbDomain_update (\<lambda>_. domain) ta) else obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s)))
 2. \<And>s. \<lbrakk>ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s; t \<noteq> ksCurThread s\<rbrakk> \<Longrightarrow> tcb_at' t s \<longrightarrow> (\<exists>ta. ko_at' ta t s \<and> (ksSchedulerAction s = ResumeCurrentThread \<longrightarrow> (if t = ksCurThread s then (Not \<circ> tcbQueued) (tcbDomain_update (\<lambda>_. domain) ta) else obj_at' (Not \<circ> tcbQueued) (ksCurThread s) s))) proof (prove)
goal:
No subgoals!