[STATEMENT]
lemma OV_inv3_obsv_round:
  "{OV_inv3 \<inter> OV_inv2} obsv_round r S v D Ob {> OV_inv3}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. {OV_inv3 \<inter> OV_inv2} obsv_round r S v D Ob {> OV_inv3}
[PROOF STEP]
proof(clarsimp simp add: PO_hoare_defs intro!: OV_inv3I)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x ra p va xa. \<lbrakk>obsv_state.obs x ra p = Some va; (xa, x) \<in> obsv_round r S v D Ob; xa \<in> OV_inv3; xa \<in> OV_inv2\<rbrakk> \<Longrightarrow> obs_safe ra x va
[PROOF STEP]
fix s s' r_w p w
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>x ra p va xa. \<lbrakk>obsv_state.obs x ra p = Some va; (xa, x) \<in> obsv_round r S v D Ob; xa \<in> OV_inv3; xa \<in> OV_inv2\<rbrakk> \<Longrightarrow> obs_safe ra x va
[PROOF STEP]
assume Assms:
    "obs s' r_w p = Some w"
    "s \<in> OV_inv3"
    "(s, s') \<in> obsv_round r S v D Ob"
    "s \<in> OV_inv2"
[PROOF STATE]
proof (state)
this:
obsv_state.obs s' r_w p = Some w
s \<in> OV_inv3
(s, s') \<in> obsv_round r S v D Ob
s \<in> OV_inv2

goal (1 subgoal):
 1. \<And>x ra p va xa. \<lbrakk>obsv_state.obs x ra p = Some va; (xa, x) \<in> obsv_round r S v D Ob; xa \<in> OV_inv3; xa \<in> OV_inv2\<rbrakk> \<Longrightarrow> obs_safe ra x va
[PROOF STEP]
hence "s' \<in> OV_inv2"
[PROOF STATE]
proof (prove)
using this:
obsv_state.obs s' r_w p = Some w
s \<in> OV_inv3
(s, s') \<in> obsv_round r S v D Ob
s \<in> OV_inv2

goal (1 subgoal):
 1. s' \<in> OV_inv2
[PROOF STEP]
by(force simp add: obsv_TS_defs intro: OV_inv2_inductive(2)[THEN hoareD, OF \<open>s \<in> OV_inv2\<close>])
[PROOF STATE]
proof (state)
this:
s' \<in> OV_inv2

goal (1 subgoal):
 1. \<And>x ra p va xa. \<lbrakk>obsv_state.obs x ra p = Some va; (xa, x) \<in> obsv_round r S v D Ob; xa \<in> OV_inv3; xa \<in> OV_inv2\<rbrakk> \<Longrightarrow> obs_safe ra x va
[PROOF STEP]
hence "r_w \<le> next_round s'"
[PROOF STATE]
proof (prove)
using this:
s' \<in> OV_inv2

goal (1 subgoal):
 1. r_w \<le> next_round s'
[PROOF STEP]
using Assms
[PROOF STATE]
proof (prove)
using this:
s' \<in> OV_inv2
obsv_state.obs s' r_w p = Some w
s \<in> OV_inv3
(s, s') \<in> obsv_round r S v D Ob
s \<in> OV_inv2

goal (1 subgoal):
 1. r_w \<le> next_round s'
[PROOF STEP]
by(auto simp add: OV_inv2_def intro!: leI)
[PROOF STATE]
proof (state)
this:
r_w \<le> next_round s'

goal (1 subgoal):
 1. \<And>x ra p va xa. \<lbrakk>obsv_state.obs x ra p = Some va; (xa, x) \<in> obsv_round r S v D Ob; xa \<in> OV_inv3; xa \<in> OV_inv2\<rbrakk> \<Longrightarrow> obs_safe ra x va
[PROOF STEP]
hence r_w_le: "r_w \<le> next_round s"
[PROOF STATE]
proof (prove)
using this:
r_w \<le> next_round s'

goal (1 subgoal):
 1. r_w \<le> next_round s
[PROOF STEP]
using Assms
[PROOF STATE]
proof (prove)
using this:
r_w \<le> next_round s'
obsv_state.obs s' r_w p = Some w
s \<in> OV_inv3
(s, s') \<in> obsv_round r S v D Ob
s \<in> OV_inv2

goal (1 subgoal):
 1. r_w \<le> next_round s
[PROOF STEP]
by(auto simp add: obsv_round_def le_Suc_eq)
[PROOF STATE]
proof (state)
this:
r_w \<le> next_round s

goal (1 subgoal):
 1. \<And>x ra p va xa. \<lbrakk>obsv_state.obs x ra p = Some va; (xa, x) \<in> obsv_round r S v D Ob; xa \<in> OV_inv3; xa \<in> OV_inv2\<rbrakk> \<Longrightarrow> obs_safe ra x va
[PROOF STEP]
show "obs_safe r_w s' w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. obs_safe r_w s' w
[PROOF STEP]
proof(cases "r_w = next_round s")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. r_w = next_round s \<Longrightarrow> obs_safe r_w s' w
 2. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
r_w = next_round s

goal (2 subgoals):
 1. r_w = next_round s \<Longrightarrow> obs_safe r_w s' w
 2. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
r_w = next_round s

goal (1 subgoal):
 1. obs_safe r_w s' w
[PROOF STEP]
using Assms
[PROOF STATE]
proof (prove)
using this:
r_w = next_round s
obsv_state.obs s' r_w p = Some w
s \<in> OV_inv3
(s, s') \<in> obsv_round r S v D Ob
s \<in> OV_inv2

goal (1 subgoal):
 1. obs_safe r_w s' w
[PROOF STEP]
by(auto simp add: obsv_round_def const_map_is_Some obs_safe_def)
[PROOF STATE]
proof (state)
this:
obs_safe r_w s' w

goal (1 subgoal):
 1. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
r_w \<noteq> next_round s

goal (1 subgoal):
 1. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
hence "r_w < next_round s"
[PROOF STATE]
proof (prove)
using this:
r_w \<noteq> next_round s

goal (1 subgoal):
 1. r_w < next_round s
[PROOF STEP]
using r_w_le
[PROOF STATE]
proof (prove)
using this:
r_w \<noteq> next_round s
r_w \<le> next_round s

goal (1 subgoal):
 1. r_w < next_round s
[PROOF STEP]
by(metis less_le)
[PROOF STATE]
proof (state)
this:
r_w < next_round s

goal (1 subgoal):
 1. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
r_w < next_round s

goal (1 subgoal):
 1. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
have "\<forall>r'. r' \<noteq> next_round s \<longrightarrow> obs s' r' = obs s r'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>r'. r' \<noteq> next_round s \<longrightarrow> obsv_state.obs s' r' = obsv_state.obs s r'
[PROOF STEP]
using Assms(3)
[PROOF STATE]
proof (prove)
using this:
(s, s') \<in> obsv_round r S v D Ob

goal (1 subgoal):
 1. \<forall>r'. r' \<noteq> next_round s \<longrightarrow> obsv_state.obs s' r' = obsv_state.obs s r'
[PROOF STEP]
by(auto simp add: obsv_round_def)
[PROOF STATE]
proof (state)
this:
\<forall>r'. r' \<noteq> next_round s \<longrightarrow> obsv_state.obs s' r' = obsv_state.obs s r'

goal (1 subgoal):
 1. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
r_w < next_round s
\<forall>r'. r' \<noteq> next_round s \<longrightarrow> obsv_state.obs s' r' = obsv_state.obs s r'
[PROOF STEP]
have
      "\<forall>r' \<le> r_w. obs s' r' = obs s r'"
[PROOF STATE]
proof (prove)
using this:
r_w < next_round s
\<forall>r'. r' \<noteq> next_round s \<longrightarrow> obsv_state.obs s' r' = obsv_state.obs s r'

goal (1 subgoal):
 1. \<forall>r'\<le>r_w. obsv_state.obs s' r' = obsv_state.obs s r'
[PROOF STEP]
by(auto)
[PROOF STATE]
proof (state)
this:
\<forall>r'\<le>r_w. obsv_state.obs s' r' = obsv_state.obs s r'

goal (1 subgoal):
 1. r_w \<noteq> next_round s \<Longrightarrow> obs_safe r_w s' w
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<forall>r'\<le>r_w. obsv_state.obs s' r' = obsv_state.obs s r'

goal (1 subgoal):
 1. obs_safe r_w s' w
[PROOF STEP]
using Assms
[PROOF STATE]
proof (prove)
using this:
\<forall>r'\<le>r_w. obsv_state.obs s' r' = obsv_state.obs s r'
obsv_state.obs s' r_w p = Some w
s \<in> OV_inv3
(s, s') \<in> obsv_round r S v D Ob
s \<in> OV_inv2

goal (1 subgoal):
 1. obs_safe r_w s' w
[PROOF STEP]
by(auto simp add: OV_inv3_def obs_safe_def)
[PROOF STATE]
proof (state)
this:
obs_safe r_w s' w

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
obs_safe r_w s' w

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma jmm'_exec_instrI:
  "\<lbrakk> (ta, xcphfrs) \<in> JVM_heap_base.exec_instr addr2thread_id thread_id2addr spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs;
     final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta \<rbrakk>
  \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr addr2thread_id thread_id2addr spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
[PROOF STEP]
apply(cases i)
[PROOF STATE]
proof (prove)
goal (24 subgoals):
 1. \<And>x1. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = Load x1\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 2. \<And>x2. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = Store x2\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 3. \<And>x3. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = Push x3\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 4. \<And>x4. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = New x4\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 5. \<And>x5. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = NewArray x5\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 6. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = ALoad\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 7. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = AStore\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 8. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = ALength\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 9. \<And>x91 x92. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = Getfield x91 x92\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
 10. \<And>x101 x102. \<lbrakk>(ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write i P t h stk loc C M pc frs; final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta; i = Putfield x101 x102\<rbrakk> \<Longrightarrow> \<exists>ta xcphfrs. (ta, xcphfrs) \<in> JVM_heap_base.exec_instr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write i P t h stk loc C M pc frs \<and> final_thread.actions_ok (final_thread.init_fin_final JVM_final) s t ta
A total of 24 subgoals...
[PROOF STEP]
apply(auto simp add: JVM_heap_base.exec_instr.simps split_beta final_thread.actions_ok_iff intro!: jmm_heap_read_typed_default_val rev_image_eqI simp del: split_paired_Ex split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>x111 x112 h'. \<lbrakk>i = CAS x111 x112; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk)\<rbrace>; xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)); jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk) h'\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
 2. \<And>x111 x112 v''. \<lbrakk>i = CAS x111 x112; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v''\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v''; v'' \<noteq> hd (tl stk)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
 3. \<And>x141 x142 a aa ab ac ad b va h'. \<lbrakk>i = Invoke x141 x142; stk ! x142 \<noteq> Null; lock_ok_las (locks s) t a; thread_oks (thr s) aa; final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t ab; wset_actions_ok (wset s) t ac; interrupt_actions_ok (interrupts s) ad; snd (snd (snd (method P (class_type_of (the (typeof_addr h (the_Addr (stk ! x142))))) x141))) = None; ta = (a, map (convert_new_thread_action (extNTA2JVM P)) aa, ab, ac, ad, b); xcphfrs = extRet2JVM x142 h' stk loc C M pc frs va; ((a, aa, ab, ac, ad, b), va, h') \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write P t (the_Addr (stk ! x142)) x141 (rev (take x142 stk)) h\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs taa. ta = extTA2JVM P taa \<and> (\<exists>va h'. xcphfrs = extRet2JVM x142 h' stk loc C M pc frs va \<and> (taa, va, h') \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write P t (the_Addr (stk ! x142)) x141 (rev (take x142 stk)) h)) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
subgoal for F D
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace>; xcphfrs = (None, h'_, (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)); jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h'_\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
apply(cases "hd (tl stk) = (default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T))")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace>; xcphfrs = (None, h'_, (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)); jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h'_; hd (tl stk) = default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
 2. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace>; xcphfrs = (None, h'_, (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)); jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h'_; hd (tl stk) \<noteq> default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace>; xcphfrs = (None, h'_, (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)); jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h'_; hd (tl stk) = default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
by(auto simp add: JVM_heap_base.exec_instr.simps split_beta final_thread.actions_ok_iff intro!: jmm_heap_read_typed_default_val rev_image_eqI simp del: split_paired_Ex split: if_split_asm del: disjCI intro!: disjI1 exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace>; xcphfrs = (None, h'_, (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)); jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h'_; hd (tl stk) \<noteq> default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace>; xcphfrs = (None, h'_, (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)); jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h'_; hd (tl stk) \<noteq> default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
by(auto simp add: JVM_heap_base.exec_instr.simps split_beta final_thread.actions_ok_iff intro!: jmm_heap_read_typed_default_val rev_image_eqI simp del: split_paired_Ex split: if_split_asm del: disjCI intro!: disjI2 exI)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>x111 x112 v''. \<lbrakk>i = CAS x111 x112; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v''\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v''; v'' \<noteq> hd (tl stk)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField x112 x111) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
 2. \<And>x141 x142 a aa ab ac ad b va h'. \<lbrakk>i = Invoke x141 x142; stk ! x142 \<noteq> Null; lock_ok_las (locks s) t a; thread_oks (thr s) aa; final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t ab; wset_actions_ok (wset s) t ac; interrupt_actions_ok (interrupts s) ad; snd (snd (snd (method P (class_type_of (the (typeof_addr h (the_Addr (stk ! x142))))) x141))) = None; ta = (a, map (convert_new_thread_action (extNTA2JVM P)) aa, ab, ac, ad, b); xcphfrs = extRet2JVM x142 h' stk loc C M pc frs va; ((a, aa, ab, ac, ad, b), va, h') \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write P t (the_Addr (stk ! x142)) x141 (rev (take x142 stk)) h\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs taa. ta = extTA2JVM P taa \<and> (\<exists>va h'. xcphfrs = extRet2JVM x142 h' stk loc C M pc frs va \<and> (taa, va, h') \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write P t (the_Addr (stk ! x142)) x141 (rev (take x142 stk)) h)) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
subgoal for F D
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''_\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) v''_; v''_ \<noteq> hd (tl stk)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
apply(cases "hd (tl stk) = (default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T))")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''_\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) v''_; v''_ \<noteq> hd (tl stk); hd (tl stk) = default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
 2. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''_\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) v''_; v''_ \<noteq> hd (tl stk); hd (tl stk) \<noteq> default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''_\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) v''_; v''_ \<noteq> hd (tl stk); hd (tl stk) = default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
by(auto simp add: JVM_heap_base.exec_instr.simps split_beta final_thread.actions_ok_iff intro!: jmm_heap_read_typed_default_val rev_image_eqI simp del: split_paired_Ex split: if_split_asm del: disjCI intro!: disjI1 exI jmm_heap_write.intros)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''_\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) v''_; v''_ \<noteq> hd (tl stk); hd (tl stk) \<noteq> default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = CAS F D; hd (tl (tl stk)) \<noteq> Null; lock_ok_las (locks s) t (K$ []); final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t []; wset s t = None; ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''_\<rbrace>; xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs); jmm_heap_read h (the_Addr (hd (tl (tl stk)))) (CField D F) v''_; v''_ \<noteq> hd (tl stk); hd (tl stk) \<noteq> default_val (THE T. heap_base.addr_loc_type typeof_addr P h (the_Addr (hd (tl (tl stk)))) (CField D F) T)\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)), WriteMem (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk)\<rbrace> \<and> (\<exists>h'. xcphfrs = (None, h', (Bool True # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd (tl stk)) \<and> jmm_heap_write h (the_Addr (hd (tl (tl stk)))) (CField D F) (hd stk) h') \<or> (\<exists>v''. ta = \<lbrace>ReadMem (the_Addr (hd (tl (tl stk)))) (CField D F) v''\<rbrace> \<and> xcphfrs = (None, h, (Bool False # tl (tl (tl stk)), loc, C, M, Suc pc) # frs) \<and> heap_base.heap_read_typed typeof_addr jmm_heap_read P h (the_Addr (hd (tl (tl stk)))) (CField D F) v'' \<and> v'' \<noteq> hd (tl stk))) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
by(rule exI conjI disjI2 refl jmm_heap_read_typed_default_val|assumption)+ auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x141 x142 a aa ab ac ad b va h'. \<lbrakk>i = Invoke x141 x142; stk ! x142 \<noteq> Null; lock_ok_las (locks s) t a; thread_oks (thr s) aa; final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t ab; wset_actions_ok (wset s) t ac; interrupt_actions_ok (interrupts s) ad; snd (snd (snd (method P (class_type_of (the (typeof_addr h (the_Addr (stk ! x142))))) x141))) = None; ta = (a, map (convert_new_thread_action (extNTA2JVM P)) aa, ab, ac, ad, b); xcphfrs = extRet2JVM x142 h' stk loc C M pc frs va; ((a, aa, ab, ac, ad, b), va, h') \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write P t (the_Addr (stk ! x142)) x141 (rev (take x142 stk)) h\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs taa. ta = extTA2JVM P taa \<and> (\<exists>va h'. xcphfrs = extRet2JVM x142 h' stk loc C M pc frs va \<and> (taa, va, h') \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write P t (the_Addr (stk ! x142)) x141 (rev (take x142 stk)) h)) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
subgoal
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = Invoke x141_ x142_; stk ! x142_ \<noteq> Null; lock_ok_las (locks s) t a_; thread_oks (thr s) aa_; final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t ab_; wset_actions_ok (wset s) t ac_; interrupt_actions_ok (interrupts s) ad_; snd (snd (snd (method P (class_type_of (the (typeof_addr h (the_Addr (stk ! x142_))))) x141_))) = None; ta = (a_, map (convert_new_thread_action (extNTA2JVM P)) aa_, ab_, ac_, ad_, b_); xcphfrs = extRet2JVM x142_ h'_ stk loc C M pc frs va_; ((a_, aa_, ab_, ac_, ad_, b_), va_, h'_) \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr jmm_heap_read jmm_heap_write P t (the_Addr (stk ! x142_)) x141_ (rev (take x142_ stk)) h\<rbrakk> \<Longrightarrow> \<exists>ta. (\<exists>xcphfrs taa. ta = extTA2JVM P taa \<and> (\<exists>va h'. xcphfrs = extRet2JVM x142_ h' stk loc C M pc frs va \<and> (taa, va, h') \<in> heap_base.red_external_aggr (\<lambda>x. x) (\<lambda>x. x) spurious_wakeups empty_heap allocate typeof_addr (heap_base.heap_read_typed typeof_addr jmm_heap_read P) jmm_heap_write P t (the_Addr (stk ! x142_)) x141_ (rev (take x142_ stk)) h)) \<and> lock_ok_las (locks s) t \<lbrace>ta\<rbrace>\<^bsub>l\<^esub> \<and> thread_oks (thr s) \<lbrace>ta\<rbrace>\<^bsub>t\<^esub> \<and> final_thread.cond_action_oks (final_thread.init_fin_final JVM_final) s t \<lbrace>ta\<rbrace>\<^bsub>c\<^esub> \<and> wset_actions_ok (wset s) t \<lbrace>ta\<rbrace>\<^bsub>w\<^esub> \<and> interrupt_actions_ok (interrupts s) \<lbrace>ta\<rbrace>\<^bsub>i\<^esub>
[PROOF STEP]
by(drule red_external_aggr_heap_read_typedI)(fastforce simp add: final_thread.actions_ok_iff simp del: split_paired_Ex)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done