[STATEMENT]
lemma ta_hb_consistent_Read_hb:
  fixes E E' defines "E'' \<equiv> lappend (llist_of E') E"
  assumes hb: "ta_hb_consistent P E' E"
  and tsa: "thread_start_actions_ok E''"
  and E'': "is_write_seen P (llist_of E') ws'"
  and new_actions_for_fun:
  "\<And>w w' adal. \<lbrakk> w \<in> new_actions_for P E'' adal;
                 w' \<in> new_actions_for P E'' adal \<rbrakk> \<Longrightarrow> w = w'"
  shows "\<exists>ws. P \<turnstile> (E'', ws) \<surd> \<and> (\<forall>n. n \<in> read_actions E'' \<longrightarrow> length E' \<le> n \<longrightarrow> P,E'' \<turnstile> ws n \<le>hb n) \<and>
              (\<forall>n. n < length E' \<longrightarrow> ws n = ws' n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ws. P \<turnstile> (E'', ws) \<surd> \<and> (\<forall>n. n \<in> read_actions E'' \<longrightarrow> length E' \<le> n \<longrightarrow> P,E'' \<turnstile> ws n \<le>hb n) \<and> (\<forall>n<length E'. ws n = ws' n)
[PROOF STEP]
proof(intro exI conjI strip)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. P \<turnstile> (E'', ?ws) \<surd>
 2. \<And>n. \<lbrakk>n \<in> read_actions E''; length E' \<le> n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n
 3. \<And>n. n < length E' \<Longrightarrow> ?ws n = ws' n
[PROOF STEP]
let ?P =
    "\<lambda>n w. case lnth E'' n of
        (t, NormalAction (ReadMem ad al v)) \<Rightarrow>
          (w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and>
          P,E'' \<turnstile> w \<le>hb n \<and>
          (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow>
              (P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or>
               is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n) \<longrightarrow>
              w' = w))"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. P \<turnstile> (E'', ?ws) \<surd>
 2. \<And>n. \<lbrakk>n \<in> read_actions E''; length E' \<le> n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n
 3. \<And>n. n < length E' \<Longrightarrow> ?ws n = ws' n
[PROOF STEP]
let ?ws = "\<lambda>n. if n < length E' then ws' n else Eps (?P n)"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. P \<turnstile> (E'', ?ws) \<surd>
 2. \<And>n. \<lbrakk>n \<in> read_actions E''; length E' \<le> n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n
 3. \<And>n. n < length E' \<Longrightarrow> ?ws n = ws' n
[PROOF STEP]
have "\<And>n. n < length E' \<Longrightarrow> ?ws n = ws' n"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>n. n < length E' \<Longrightarrow> (if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) = ws' n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
?n < length E' \<Longrightarrow> (if ?n < length E' then ws' ?n else SOME w. case lnth E'' ?n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb ?n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb ?n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so ?n \<longrightarrow> w' = w)) = ws' ?n

goal (3 subgoals):
 1. P \<turnstile> (E'', ?ws) \<surd>
 2. \<And>n. \<lbrakk>n \<in> read_actions E''; length E' \<le> n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n
 3. \<And>n. n < length E' \<Longrightarrow> ?ws n = ws' n
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?n < length E' \<Longrightarrow> (if ?n < length E' then ws' ?n else SOME w. case lnth E'' ?n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb ?n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb ?n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so ?n \<longrightarrow> w' = w)) = ws' ?n

goal (3 subgoals):
 1. P \<turnstile> (E'', ?ws) \<surd>
 2. \<And>n. \<lbrakk>n \<in> read_actions E''; length E' \<le> n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n
 3. \<And>n. n < length E' \<Longrightarrow> ?ws n = ws' n
[PROOF STEP]
have "P \<turnstile> (E'', ?ws) \<surd> \<and>
        (\<forall>n ad al v. n \<in> read_actions E'' \<longrightarrow> length E' \<le> n \<longrightarrow> action_obs E'' n = NormalAction (ReadMem ad al v) \<longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. P \<turnstile> (E'', \<lambda>n. if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) \<surd> \<and> (\<forall>n ad al v. n \<in> read_actions E'' \<longrightarrow> length E' \<le> n \<longrightarrow> action_obs E'' n = NormalAction (ReadMem ad al v) \<longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n)
[PROOF STEP]
proof(intro conjI wf_execI strip is_write_seenI)
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 3. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> value_written P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) (ad, al) = v
 4. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>hb (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 5. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>so (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 6. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>hb a'; P,E'' \<turnstile> a' \<le>hb a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 7. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; is_volatile P al; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>so a'; P,E'' \<turnstile> a' \<le>so a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 8. thread_start_actions_ok E''
 9. \<And>n ad al v. \<lbrakk>n \<in> read_actions E''; length E' \<le> n; action_obs E'' n = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n
[PROOF STEP]
fix a' ad al v
[PROOF STATE]
proof (state)
goal (9 subgoals):
 1. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 3. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> value_written P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) (ad, al) = v
 4. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>hb (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 5. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>so (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 6. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>hb a'; P,E'' \<turnstile> a' \<le>hb a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 7. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; is_volatile P al; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>so a'; P,E'' \<turnstile> a' \<le>so a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 8. thread_start_actions_ok E''
 9. \<And>n ad al v. \<lbrakk>n \<in> read_actions E''; length E' \<le> n; action_obs E'' n = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n
[PROOF STEP]
assume read: "a' \<in> read_actions E''"
      and aobs: "action_obs E'' a' = NormalAction (ReadMem ad al v)"
[PROOF STATE]
proof (state)
this:
a' \<in> read_actions E''
action_obs E'' a' = NormalAction (ReadMem ad al v)

goal (9 subgoals):
 1. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 3. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> value_written P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) (ad, al) = v
 4. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>hb (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 5. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>so (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 6. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>hb a'; P,E'' \<turnstile> a' \<le>hb a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 7. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; is_volatile P al; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>so a'; P,E'' \<turnstile> a' \<le>so a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 8. thread_start_actions_ok E''
 9. \<And>n ad al v. \<lbrakk>n \<in> read_actions E''; length E' \<le> n; action_obs E'' n = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a' \<in> read_actions E''
action_obs E'' a' = NormalAction (ReadMem ad al v)
[PROOF STEP]
obtain t where a': "enat a' < llength E''"
      and lnth'': "lnth E'' a' = (t, NormalAction (ReadMem ad al v))"
[PROOF STATE]
proof (prove)
using this:
a' \<in> read_actions E''
action_obs E'' a' = NormalAction (ReadMem ad al v)

goal (1 subgoal):
 1. (\<And>t. \<lbrakk>enat a' < llength E''; lnth E'' a' = (t, NormalAction (ReadMem ad al v))\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases)(cases "lnth E'' a'", clarsimp simp add: actions_def action_obs_def)
[PROOF STATE]
proof (state)
this:
enat a' < llength E''
lnth E'' a' = (t, NormalAction (ReadMem ad al v))

goal (9 subgoals):
 1. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 3. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> value_written P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) (ad, al) = v
 4. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>hb (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 5. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>so (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 6. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>hb a'; P,E'' \<turnstile> a' \<le>hb a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 7. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; is_volatile P al; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>so a'; P,E'' \<turnstile> a' \<le>so a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 8. thread_start_actions_ok E''
 9. \<And>n ad al v. \<lbrakk>n \<in> read_actions E''; length E' \<le> n; action_obs E'' n = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n
[PROOF STEP]
have "?ws a' \<in> write_actions E'' \<and>
      (ad, al) \<in> action_loc P E'' (?ws a') \<and>
      value_written P E'' (?ws a') (ad, al) = v \<and>
      (length E' \<le> a' \<longrightarrow> P,E'' \<turnstile> ?ws a' \<le>hb a') \<and>
      \<not> P,E'' \<turnstile> a' \<le>hb ?ws a' \<and>
      (is_volatile P al \<longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so ?ws a') \<and>
      (\<forall>a''. a'' \<in> write_actions E'' \<longrightarrow> (ad, al) \<in> action_loc P E'' a'' \<longrightarrow>
             (P,E'' \<turnstile> ?ws a' \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> ?ws a' \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a')
             \<longrightarrow> a'' = ?ws a')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> (length E' \<le> a' \<longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a') \<and> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> (is_volatile P al \<longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))) \<and> (\<forall>a''. a'' \<in> write_actions E'' \<longrightarrow> (ad, al) \<in> action_loc P E'' a'' \<longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a' \<longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
[PROOF STEP]
proof(cases "a' < length E'", safe del: notI disjE conjE)
[PROOF STATE]
proof (state)
goal (14 subgoals):
 1. a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 9. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 10. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
A total of 14 subgoals...
[PROOF STEP]
assume a'_E': "a' < length E'"
[PROOF STATE]
proof (state)
this:
a' < length E'

goal (14 subgoals):
 1. a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 9. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 10. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
A total of 14 subgoals...
[PROOF STEP]
with read aobs
[PROOF STATE]
proof (chain)
picking this:
a' \<in> read_actions E''
action_obs E'' a' = NormalAction (ReadMem ad al v)
a' < length E'
[PROOF STEP]
have a': "a' \<in> read_actions (llist_of E')"
        and aobs': "action_obs (llist_of E') a' = NormalAction (ReadMem ad al v)"
[PROOF STATE]
proof (prove)
using this:
a' \<in> read_actions E''
action_obs E'' a' = NormalAction (ReadMem ad al v)
a' < length E'

goal (1 subgoal):
 1. a' \<in> read_actions (llist_of E') &&& action_obs (llist_of E') a' = NormalAction (ReadMem ad al v)
[PROOF STEP]
by(auto simp add: E''_def action_obs_def lnth_lappend1 actions_def elim: read_actions.cases intro: read_actions.intros)
[PROOF STATE]
proof (state)
this:
a' \<in> read_actions (llist_of E')
action_obs (llist_of E') a' = NormalAction (ReadMem ad al v)

goal (14 subgoals):
 1. a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 9. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 10. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
A total of 14 subgoals...
[PROOF STEP]
have sim: "ltake (enat (length E')) (llist_of E') [\<approx>] ltake (enat (length E')) (lappend (llist_of E') E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ltake (enat (length E')) (llist_of E') [\<approx>] ltake (enat (length E')) (lappend (llist_of E') E)
[PROOF STEP]
by(rule eq_into_sim_actions)(simp add: ltake_all ltake_lappend1)
[PROOF STATE]
proof (state)
this:
ltake (enat (length E')) (llist_of E') [\<approx>] ltake (enat (length E')) (lappend (llist_of E') E)

goal (14 subgoals):
 1. a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 9. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 10. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
A total of 14 subgoals...
[PROOF STEP]
from tsa
[PROOF STATE]
proof (chain)
picking this:
thread_start_actions_ok E''
[PROOF STEP]
have tsa': "thread_start_actions_ok (llist_of E')"
[PROOF STATE]
proof (prove)
using this:
thread_start_actions_ok E''

goal (1 subgoal):
 1. thread_start_actions_ok (llist_of E')
[PROOF STEP]
by(rule thread_start_actions_ok_prefix)(simp add: E''_def lprefix_lappend)
[PROOF STATE]
proof (state)
this:
thread_start_actions_ok (llist_of E')

goal (14 subgoals):
 1. a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 9. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 10. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
A total of 14 subgoals...
[PROOF STEP]
from is_write_seenD[OF E'' a' aobs'] a'_E'
[PROOF STATE]
proof (chain)
picking this:
ws' a' \<in> write_actions (llist_of E') \<and> (ad, al) \<in> action_loc P (llist_of E') (ws' a') \<and> value_written P (llist_of E') (ws' a') (ad, al) = v \<and> \<not> P,llist_of E' \<turnstile> a' \<le>hb ws' a' \<and> (is_volatile P al \<longrightarrow> \<not> P,llist_of E' \<turnstile> a' \<le>so ws' a') \<and> (\<forall>a'a\<in>write_actions (llist_of E'). (ad, al) \<in> action_loc P (llist_of E') a'a \<and> (P,llist_of E' \<turnstile> ws' a' \<le>hb a'a \<and> P,llist_of E' \<turnstile> a'a \<le>hb a' \<or> is_volatile P al \<and> P,llist_of E' \<turnstile> ws' a' \<le>so a'a \<and> P,llist_of E' \<turnstile> a'a \<le>so a') \<longrightarrow> a'a = ws' a')
a' < length E'
[PROOF STEP]
show "?ws a' \<in> write_actions E''"
        and "(ad, al) \<in> action_loc P E'' (?ws a')"
        and "value_written P E'' (?ws a') (ad, al) = v"
        and "\<not> P,E'' \<turnstile> a' \<le>hb ?ws a'"
        and "is_volatile P al \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so ?ws a'"
[PROOF STATE]
proof (prove)
using this:
ws' a' \<in> write_actions (llist_of E') \<and> (ad, al) \<in> action_loc P (llist_of E') (ws' a') \<and> value_written P (llist_of E') (ws' a') (ad, al) = v \<and> \<not> P,llist_of E' \<turnstile> a' \<le>hb ws' a' \<and> (is_volatile P al \<longrightarrow> \<not> P,llist_of E' \<turnstile> a' \<le>so ws' a') \<and> (\<forall>a'a\<in>write_actions (llist_of E'). (ad, al) \<in> action_loc P (llist_of E') a'a \<and> (P,llist_of E' \<turnstile> ws' a' \<le>hb a'a \<and> P,llist_of E' \<turnstile> a'a \<le>hb a' \<or> is_volatile P al \<and> P,llist_of E' \<turnstile> ws' a' \<le>so a'a \<and> P,llist_of E' \<turnstile> a'a \<le>so a') \<longrightarrow> a'a = ws' a')
a' < length E'

goal (1 subgoal):
 1. ((if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' &&& (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))) &&& value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v &&& \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) &&& (is_volatile P al \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
[PROOF STEP]
by(auto elim!: write_actions.cases intro!: write_actions.intros simp add: E''_def lnth_lappend1 actions_def action_obs_def value_written_def enat_less_enat_plusI dest: happens_before_change_prefix[OF _ tsa' sim[symmetric]] sync_order_change_prefix[OF _ sim[symmetric]])
[PROOF STATE]
proof (state)
this:
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
(ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
\<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
is_volatile P al \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (9 subgoals):
 1. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 2. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 4. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 5. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 6. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 7. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 9. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
(ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
\<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
is_volatile P al \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (9 subgoals):
 1. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 2. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 4. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 5. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 6. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 7. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 9. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
assume "length E' \<le> a'"
[PROOF STATE]
proof (state)
this:
length E' \<le> a'

goal (9 subgoals):
 1. \<lbrakk>a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 2. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 4. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 5. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 6. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 7. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 9. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
thus "P,E'' \<turnstile> ?ws a' \<le>hb a'"
[PROOF STATE]
proof (prove)
using this:
length E' \<le> a'

goal (1 subgoal):
 1. P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
[PROOF STEP]
using a'_E'
[PROOF STATE]
proof (prove)
using this:
length E' \<le> a'
a' < length E'

goal (1 subgoal):
 1. P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'

goal (8 subgoals):
 1. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 3. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 4. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 5. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 6. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
length E' \<le> a' \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'

goal (8 subgoals):
 1. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 3. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 4. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 5. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 6. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
length E' \<le> a' \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'

goal (8 subgoals):
 1. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 3. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 4. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 5. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 6. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
fix w
[PROOF STATE]
proof (state)
goal (8 subgoals):
 1. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 3. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 4. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 5. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 6. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
assume w: "w \<in> write_actions E''" "(ad, al) \<in> action_loc P E'' w"
          and hbso: "P,E'' \<turnstile> ?ws a' \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> ?ws a' \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'"
[PROOF STATE]
proof (state)
this:
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'

goal (8 subgoals):
 1. \<And>a''. \<lbrakk>a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 3. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 4. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 5. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 6. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 8. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
show "w = ?ws a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
proof(cases "w < length E'")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
w < length E'

goal (2 subgoals):
 1. w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
with is_write_seenD[OF E'' a' aobs'] a'_E' w hbso
[PROOF STATE]
proof (chain)
picking this:
ws' a' \<in> write_actions (llist_of E') \<and> (ad, al) \<in> action_loc P (llist_of E') (ws' a') \<and> value_written P (llist_of E') (ws' a') (ad, al) = v \<and> \<not> P,llist_of E' \<turnstile> a' \<le>hb ws' a' \<and> (is_volatile P al \<longrightarrow> \<not> P,llist_of E' \<turnstile> a' \<le>so ws' a') \<and> (\<forall>a'a\<in>write_actions (llist_of E'). (ad, al) \<in> action_loc P (llist_of E') a'a \<and> (P,llist_of E' \<turnstile> ws' a' \<le>hb a'a \<and> P,llist_of E' \<turnstile> a'a \<le>hb a' \<or> is_volatile P al \<and> P,llist_of E' \<turnstile> ws' a' \<le>so a'a \<and> P,llist_of E' \<turnstile> a'a \<le>so a') \<longrightarrow> a'a = ws' a')
a' < length E'
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'
w < length E'
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ws' a' \<in> write_actions (llist_of E') \<and> (ad, al) \<in> action_loc P (llist_of E') (ws' a') \<and> value_written P (llist_of E') (ws' a') (ad, al) = v \<and> \<not> P,llist_of E' \<turnstile> a' \<le>hb ws' a' \<and> (is_volatile P al \<longrightarrow> \<not> P,llist_of E' \<turnstile> a' \<le>so ws' a') \<and> (\<forall>a'a\<in>write_actions (llist_of E'). (ad, al) \<in> action_loc P (llist_of E') a'a \<and> (P,llist_of E' \<turnstile> ws' a' \<le>hb a'a \<and> P,llist_of E' \<turnstile> a'a \<le>hb a' \<or> is_volatile P al \<and> P,llist_of E' \<turnstile> ws' a' \<le>so a'a \<and> P,llist_of E' \<turnstile> a'a \<le>so a') \<longrightarrow> a'a = ws' a')
a' < length E'
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'
w < length E'

goal (1 subgoal):
 1. w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
by(auto 4 3 elim!: write_actions.cases intro!: write_actions.intros simp add: E''_def lnth_lappend1 actions_def action_obs_def value_written_def enat_less_enat_plusI dest: happens_before_change_prefix[OF _ tsa[unfolded E''_def] sim] happens_before_change_prefix[OF _ tsa' sim[symmetric]] sync_order_change_prefix[OF _ sim, simplified] sync_order_change_prefix[OF _ sim[symmetric], simplified] bspec[where x=w])
[PROOF STATE]
proof (state)
this:
w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> w < length E'

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from hbso
[PROOF STATE]
proof (chain)
picking this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'
[PROOF STEP]
have "E'' \<turnstile> w \<le>a a'"
[PROOF STATE]
proof (prove)
using this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'

goal (1 subgoal):
 1. E'' \<turnstile> w \<le>a a'
[PROOF STEP]
by(auto intro: happens_before_into_action_order elim: sync_orderE)
[PROOF STATE]
proof (state)
this:
E'' \<turnstile> w \<le>a a'

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
E'' \<turnstile> w \<le>a a'

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from w(1) read
[PROOF STATE]
proof (chain)
picking this:
w \<in> write_actions E''
a' \<in> read_actions E''
[PROOF STEP]
have "w \<noteq> a'"
[PROOF STATE]
proof (prove)
using this:
w \<in> write_actions E''
a' \<in> read_actions E''

goal (1 subgoal):
 1. w \<noteq> a'
[PROOF STEP]
by(auto dest: read_actions_not_write_actions)
[PROOF STATE]
proof (state)
this:
w \<noteq> a'

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
E'' \<turnstile> w \<le>a a'
w \<noteq> a'
[PROOF STEP]
have new_w: "is_new_action (action_obs E'' w)"
[PROOF STATE]
proof (prove)
using this:
E'' \<turnstile> w \<le>a a'
w \<noteq> a'

goal (1 subgoal):
 1. is_new_action (action_obs E'' w)
[PROOF STEP]
using False aobs a'_E'
[PROOF STATE]
proof (prove)
using this:
E'' \<turnstile> w \<le>a a'
w \<noteq> a'
\<not> w < length E'
action_obs E'' a' = NormalAction (ReadMem ad al v)
a' < length E'

goal (1 subgoal):
 1. is_new_action (action_obs E'' w)
[PROOF STEP]
by(cases rule: action_orderE) auto
[PROOF STATE]
proof (state)
this:
is_new_action (action_obs E'' w)

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
is_new_action (action_obs E'' w)

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from hbso a'_E'
[PROOF STATE]
proof (chain)
picking this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'
a' < length E'
[PROOF STEP]
have "E'' \<turnstile> ws' a' \<le>a w"
[PROOF STATE]
proof (prove)
using this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w \<and> P,E'' \<turnstile> w \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w \<and> P,E'' \<turnstile> w \<le>so a'
a' < length E'

goal (1 subgoal):
 1. E'' \<turnstile> ws' a' \<le>a w
[PROOF STEP]
by(auto intro: happens_before_into_action_order elim: sync_orderE)
[PROOF STATE]
proof (state)
this:
E'' \<turnstile> ws' a' \<le>a w

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
hence new_a': "is_new_action (action_obs E'' (?ws a'))"
[PROOF STATE]
proof (prove)
using this:
E'' \<turnstile> ws' a' \<le>a w

goal (1 subgoal):
 1. is_new_action (action_obs E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
[PROOF STEP]
using new_w a'_E'
[PROOF STATE]
proof (prove)
using this:
E'' \<turnstile> ws' a' \<le>a w
is_new_action (action_obs E'' w)
a' < length E'

goal (1 subgoal):
 1. is_new_action (action_obs E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
[PROOF STEP]
by(cases rule: action_orderE) auto
[PROOF STATE]
proof (state)
this:
is_new_action (action_obs E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
is_new_action (action_obs E'' w)
is_new_action (action_obs E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
[PROOF STEP]
have "w \<in> new_actions_for P E'' (ad, al)" "?ws a' \<in> new_actions_for P E'' (ad, al)"
[PROOF STATE]
proof (prove)
using this:
is_new_action (action_obs E'' w)
is_new_action (action_obs E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))

goal (1 subgoal):
 1. w \<in> new_actions_for P E'' (ad, al) &&& (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> new_actions_for P E'' (ad, al)
[PROOF STEP]
using w is_write_seenD[OF E'' a' aobs'] a'_E'
[PROOF STATE]
proof (prove)
using this:
is_new_action (action_obs E'' w)
is_new_action (action_obs E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
ws' a' \<in> write_actions (llist_of E') \<and> (ad, al) \<in> action_loc P (llist_of E') (ws' a') \<and> value_written P (llist_of E') (ws' a') (ad, al) = v \<and> \<not> P,llist_of E' \<turnstile> a' \<le>hb ws' a' \<and> (is_volatile P al \<longrightarrow> \<not> P,llist_of E' \<turnstile> a' \<le>so ws' a') \<and> (\<forall>a'a\<in>write_actions (llist_of E'). (ad, al) \<in> action_loc P (llist_of E') a'a \<and> (P,llist_of E' \<turnstile> ws' a' \<le>hb a'a \<and> P,llist_of E' \<turnstile> a'a \<le>hb a' \<or> is_volatile P al \<and> P,llist_of E' \<turnstile> ws' a' \<le>so a'a \<and> P,llist_of E' \<turnstile> a'a \<le>so a') \<longrightarrow> a'a = ws' a')
a' < length E'

goal (1 subgoal):
 1. w \<in> new_actions_for P E'' (ad, al) &&& (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> new_actions_for P E'' (ad, al)
[PROOF STEP]
by(auto simp add: new_actions_for_def actions_def action_obs_def lnth_lappend1 E''_def enat_less_enat_plusI elim!: write_actions.cases)
[PROOF STATE]
proof (state)
this:
w \<in> new_actions_for P E'' (ad, al)
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> new_actions_for P E'' (ad, al)

goal (1 subgoal):
 1. \<not> w < length E' \<Longrightarrow> w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
w \<in> new_actions_for P E'' (ad, al)
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> new_actions_for P E'' (ad, al)

goal (1 subgoal):
 1. w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
by(rule new_actions_for_fun)
[PROOF STATE]
proof (state)
this:
w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
w = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?w2 \<in> write_actions E''; (ad, al) \<in> action_loc P E'' ?w2; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb ?w2 \<and> P,E'' \<turnstile> ?w2 \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so ?w2 \<and> P,E'' \<turnstile> ?w2 \<le>so a'\<rbrakk> \<Longrightarrow> ?w2 = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
assume "\<not> a' < length E'"
[PROOF STATE]
proof (state)
this:
\<not> a' < length E'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
hence a'_E': "length E' \<le> a'"
[PROOF STATE]
proof (prove)
using this:
\<not> a' < length E'

goal (1 subgoal):
 1. length E' \<le> a'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length E' \<le> a'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
define a where "a = a' - length E'"
[PROOF STATE]
proof (state)
this:
a = a' - length E'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
with a' a'_E'
[PROOF STATE]
proof (chain)
picking this:
enat a' < llength E''
length E' \<le> a'
a = a' - length E'
[PROOF STEP]
have a: "enat a < llength E"
[PROOF STATE]
proof (prove)
using this:
enat a' < llength E''
length E' \<le> a'
a = a' - length E'

goal (1 subgoal):
 1. enat a < llength E
[PROOF STEP]
by(simp add: E''_def) (metis enat_add_mono le_add_diff_inverse plus_enat_simps(1))
[PROOF STATE]
proof (state)
this:
enat a < llength E

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from a_def aobs lnth'' a'_E'
[PROOF STATE]
proof (chain)
picking this:
a = a' - length E'
action_obs E'' a' = NormalAction (ReadMem ad al v)
lnth E'' a' = (t, NormalAction (ReadMem ad al v))
length E' \<le> a'
[PROOF STEP]
have aobs: "action_obs E a = NormalAction (ReadMem ad al v)"
        and lnth: "lnth E a = (t, NormalAction (ReadMem ad al v))"
[PROOF STATE]
proof (prove)
using this:
a = a' - length E'
action_obs E'' a' = NormalAction (ReadMem ad al v)
lnth E'' a' = (t, NormalAction (ReadMem ad al v))
length E' \<le> a'

goal (1 subgoal):
 1. action_obs E a = NormalAction (ReadMem ad al v) &&& lnth E a = (t, NormalAction (ReadMem ad al v))
[PROOF STEP]
by(simp_all add: E''_def lnth_lappend2 action_obs_def)
[PROOF STATE]
proof (state)
this:
action_obs E a = NormalAction (ReadMem ad al v)
lnth E a = (t, NormalAction (ReadMem ad al v))

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
define E''' where "E''' = lappend (llist_of E') (ltake (enat a) E)"
[PROOF STATE]
proof (state)
this:
E''' = lappend (llist_of E') (ltake (enat a) E)

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
let ?E'' = "lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)"
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
note hb
[PROOF STATE]
proof (state)
this:
ta_hb_consistent P E' E

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
ta_hb_consistent P E' E

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
have E_unfold1: "E = lappend (ltake (enat a) E) (ldropn a E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. E = lappend (ltake (enat a) E) (ldropn a E)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
E = lappend (ltake (enat a) E) (ldropn a E)

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
also
[PROOF STATE]
proof (state)
this:
E = lappend (ltake (enat a) E) (ldropn a E)

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
have E_unfold2: "ldropn a E = LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ldropn a E = LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)
[PROOF STEP]
using a lnth
[PROOF STATE]
proof (prove)
using this:
enat a < llength E
lnth E a = (t, NormalAction (ReadMem ad al v))

goal (1 subgoal):
 1. ldropn a E = LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)
[PROOF STEP]
by (metis ldropn_Suc_conv_ldropn)
[PROOF STATE]
proof (state)
this:
ldropn a E = LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
ta_hb_consistent P E' (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)))
[PROOF STEP]
have "ta_hb_consistent P (E' @ list_of (ltake (enat a) E))
              (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))"
[PROOF STATE]
proof (prove)
using this:
ta_hb_consistent P E' (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)))

goal (1 subgoal):
 1. ta_hb_consistent P (E' @ list_of (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))
[PROOF STEP]
by(rule ta_hb_consistent_lappendD2) simp
[PROOF STATE]
proof (state)
this:
ta_hb_consistent P (E' @ list_of (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
with a a'_E' a_def
[PROOF STATE]
proof (chain)
picking this:
enat a < llength E
length E' \<le> a'
a = a' - length E'
ta_hb_consistent P (E' @ list_of (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))
[PROOF STEP]
obtain w where w: "w \<in> write_actions ?E''"
        and adal_w: "(ad, al) \<in> action_loc P ?E'' w"
        and written: "value_written P ?E'' w (ad, al) = v"
        and hb: "P,?E'' \<turnstile> w \<le>hb a'"
        and in_between_so:
        "\<And>w'. \<lbrakk> w' \<in> write_actions ?E''; (ad, al) \<in> action_loc P ?E'' w';
                is_volatile P al; P,?E'' \<turnstile> w \<le>so w'; P,?E'' \<turnstile> w' \<le>so a' \<rbrakk>
        \<Longrightarrow> w' = w"
        and in_between_hb:
        "\<And>w'. \<lbrakk> w' \<in> write_actions ?E''; (ad, al) \<in> action_loc P ?E'' w';
                P,?E'' \<turnstile> w \<le>hb w'; P,?E'' \<turnstile> w' \<le>hb a' \<rbrakk>
        \<Longrightarrow> w' = w"
[PROOF STATE]
proof (prove)
using this:
enat a < llength E
length E' \<le> a'
a = a' - length E'
ta_hb_consistent P (E' @ list_of (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))

goal (1 subgoal):
 1. (\<And>w. \<lbrakk>w \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)); (ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w; value_written P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w (ad, al) = v; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb a'; \<And>w'. \<lbrakk>w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)); (ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w'; is_volatile P al; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>so w'; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>so a'\<rbrakk> \<Longrightarrow> w' = w; \<And>w'. \<lbrakk>w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)); (ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w'; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb w'; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>hb a'\<rbrakk> \<Longrightarrow> w' = w\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(auto simp add: ta_hb_consistent_LCons length_list_of_conv_the_enat min_def lnth_ltake lappend_llist_of_llist_of[symmetric] E'''_def lappend_assoc simp del: lappend_llist_of_llist_of nth_list_of split: if_splits)
[PROOF STATE]
proof (state)
this:
w \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
(ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w
value_written P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w (ad, al) = v
P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb a'
\<lbrakk>?w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)); (ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) ?w'; is_volatile P al; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>so ?w'; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> ?w' \<le>so a'\<rbrakk> \<Longrightarrow> ?w' = w
\<lbrakk>?w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)); (ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) ?w'; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb ?w'; P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> ?w' \<le>hb a'\<rbrakk> \<Longrightarrow> ?w' = w

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from a' a'_E' a
[PROOF STATE]
proof (chain)
picking this:
enat a' < llength E''
length E' \<le> a'
enat a < llength E
[PROOF STEP]
have eq: "ltake (enat (Suc a')) ?E'' = ltake (enat (Suc a')) E''" (is "?lhs = ?rhs")
[PROOF STATE]
proof (prove)
using this:
enat a' < llength E''
length E' \<le> a'
enat a < llength E

goal (1 subgoal):
 1. ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = ltake (enat (Suc a')) E''
[PROOF STEP]
unfolding E''_def E'''_def lappend_assoc
[PROOF STATE]
proof (prove)
using this:
enat a' < llength (lappend (llist_of E') E)
length E' \<le> a'
enat a < llength E

goal (1 subgoal):
 1. ltake (enat (Suc a')) (lappend (llist_of E') (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil))) = ltake (enat (Suc a')) (lappend (llist_of E') E)
[PROOF STEP]
apply(subst (2) E_unfold1)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> ltake (enat (Suc a')) (lappend (llist_of E') (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil))) = ltake (enat (Suc a')) (lappend (llist_of E') (lappend (ltake (enat a) E) (ldropn a E)))
[PROOF STEP]
apply(subst E_unfold2)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> ltake (enat (Suc a')) (lappend (llist_of E') (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil))) = ltake (enat (Suc a')) (lappend (llist_of E') (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))))
[PROOF STEP]
apply(subst (1 2) ltake_lappend2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> llength (llist_of E') \<le> enat (Suc a')
 2. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> lappend (llist_of E') (ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil))) = lappend (llist_of E') (ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))))
[PROOF STEP]
apply(simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> lappend (llist_of E') (ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil))) = lappend (llist_of E') (ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))))
[PROOF STEP]
apply(rule arg_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> lappend (llist_of E') (ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil))) = lappend (llist_of E') (ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))))
[PROOF STEP]
back
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = ltake (enat (Suc a') - llength (llist_of E')) (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)))
[PROOF STEP]
apply(subst (1 2) ltake_lappend2)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> llength (ltake (enat a) E) \<le> enat (Suc a') - llength (llist_of E')
 2. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)))
[PROOF STEP]
apply(simp add: min_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>enat a' < enat (length E') + llength E; length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> enat a \<le> llength E \<longrightarrow> a \<le> Suc a' - length E'
 2. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)))
[PROOF STEP]
apply (metis Suc_diff_le a_def le_Suc_eq order_le_less)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)))
[PROOF STEP]
apply(rule arg_cong)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = lappend (ltake (enat a) E) (ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E)))
[PROOF STEP]
back
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < llength (lappend (llist_of E') E); length E' \<le> a'; enat a < llength E\<rbrakk> \<Longrightarrow> ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) LNil) = ltake (enat (Suc a') - llength (llist_of E') - llength (ltake (enat a) E)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc a) E))
[PROOF STEP]
apply(auto simp add: min_def a_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>enat a' < enat (length E') + llength E; length E' \<le> a'; enat (a' - length E') < llength E; enat (a' - length E') \<le> llength E\<rbrakk> \<Longrightarrow> ltake (enat (Suc 0)) (LCons (t, NormalAction (ReadMem ad al v)) LNil) = ltake (enat (Suc 0)) (LCons (t, NormalAction (ReadMem ad al v)) (ldropn (Suc (a' - length E')) E))
[PROOF STEP]
apply(auto simp add: eSuc_enat[symmetric] zero_enat_def[symmetric])
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = ltake (enat (Suc a')) E''

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
hence sim: "?lhs [\<approx>] ?rhs"
[PROOF STATE]
proof (prove)
using this:
ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) = ltake (enat (Suc a')) E''

goal (1 subgoal):
 1. ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) [\<approx>] ltake (enat (Suc a')) E''
[PROOF STEP]
by(rule eq_into_sim_actions)
[PROOF STATE]
proof (state)
this:
ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) [\<approx>] ltake (enat (Suc a')) E''

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from tsa
[PROOF STATE]
proof (chain)
picking this:
thread_start_actions_ok E''
[PROOF STEP]
have tsa': "thread_start_actions_ok ?E''"
[PROOF STATE]
proof (prove)
using this:
thread_start_actions_ok E''

goal (1 subgoal):
 1. thread_start_actions_ok (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
[PROOF STEP]
unfolding E''_def E'''_def lappend_assoc
[PROOF STATE]
proof (prove)
using this:
thread_start_actions_ok (lappend (llist_of E') E)

goal (1 subgoal):
 1. thread_start_actions_ok (lappend (llist_of E') (lappend (ltake (enat a) E) (LCons (t, NormalAction (ReadMem ad al v)) LNil)))
[PROOF STEP]
by(rule thread_start_actions_ok_prefix)(subst (2) E_unfold1, simp add: E_unfold2)
[PROOF STATE]
proof (state)
this:
thread_start_actions_ok (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from w a a' a_def a'_E'
[PROOF STATE]
proof (chain)
picking this:
w \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
enat a < llength E
enat a' < llength E''
a = a' - length E'
length E' \<le> a'
[PROOF STEP]
have w_a': "w < Suc a'"
[PROOF STATE]
proof (prove)
using this:
w \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
enat a < llength E
enat a' < llength E''
a = a' - length E'
length E' \<le> a'

goal (1 subgoal):
 1. w < Suc a'
[PROOF STEP]
by cases(simp add: actions_def E'''_def min_def zero_enat_def eSuc_enat split: if_split_asm)
[PROOF STATE]
proof (state)
this:
w < Suc a'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from w sim
[PROOF STATE]
proof (chain)
picking this:
w \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) [\<approx>] ltake (enat (Suc a')) E''
[PROOF STEP]
have "w \<in> write_actions E''"
[PROOF STATE]
proof (prove)
using this:
w \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) [\<approx>] ltake (enat (Suc a')) E''

goal (1 subgoal):
 1. w \<in> write_actions E''
[PROOF STEP]
by(rule write_actions_change_prefix)(simp add: w_a')
[PROOF STATE]
proof (state)
this:
w \<in> write_actions E''

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
w \<in> write_actions E''

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from adal_w action_loc_change_prefix[OF sim, of w P] w_a'
[PROOF STATE]
proof (chain)
picking this:
(ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w
enat w < enat (Suc a') \<Longrightarrow> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w = action_loc P E'' w
w < Suc a'
[PROOF STEP]
have "(ad, al) \<in> action_loc P E'' w"
[PROOF STATE]
proof (prove)
using this:
(ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w
enat w < enat (Suc a') \<Longrightarrow> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w = action_loc P E'' w
w < Suc a'

goal (1 subgoal):
 1. (ad, al) \<in> action_loc P E'' w
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(ad, al) \<in> action_loc P E'' w

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(ad, al) \<in> action_loc P E'' w

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from written value_written_change_prefix[OF eq, of w P] w_a'
[PROOF STATE]
proof (chain)
picking this:
value_written P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w (ad, al) = v
enat w < enat (Suc a') \<Longrightarrow> value_written P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w = value_written P E'' w
w < Suc a'
[PROOF STEP]
have "value_written P E'' w (ad, al) = v"
[PROOF STATE]
proof (prove)
using this:
value_written P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w (ad, al) = v
enat w < enat (Suc a') \<Longrightarrow> value_written P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w = value_written P E'' w
w < Suc a'

goal (1 subgoal):
 1. value_written P E'' w (ad, al) = v
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
value_written P E'' w (ad, al) = v

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
value_written P E'' w (ad, al) = v

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from hb tsa sim
[PROOF STATE]
proof (chain)
picking this:
P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb a'
thread_start_actions_ok E''
ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) [\<approx>] ltake (enat (Suc a')) E''
[PROOF STEP]
have "P,E'' \<turnstile> w \<le>hb a'"
[PROOF STATE]
proof (prove)
using this:
P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb a'
thread_start_actions_ok E''
ltake (enat (Suc a')) (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) [\<approx>] ltake (enat (Suc a')) E''

goal (1 subgoal):
 1. P,E'' \<turnstile> w \<le>hb a'
[PROOF STEP]
by(rule happens_before_change_prefix)(simp_all add: w_a')
[PROOF STATE]
proof (state)
this:
P,E'' \<turnstile> w \<le>hb a'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P,E'' \<turnstile> w \<le>hb a'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
P,E'' \<turnstile> w \<le>hb a'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
fix w'
[PROOF STATE]
proof (state)
goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
assume w': "w' \<in> write_actions E''"
          and adal: "(ad, al) \<in> action_loc P E'' w'"
          and hbso: "P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a'"
          (is "?hbso E''")
[PROOF STATE]
proof (state)
this:
w' \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w'
P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from hbso
[PROOF STATE]
proof (chain)
picking this:
P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a'
[PROOF STEP]
have ao: "E'' \<turnstile> w \<le>a w'" "E'' \<turnstile> w' \<le>a a'"
[PROOF STATE]
proof (prove)
using this:
P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a'

goal (1 subgoal):
 1. E'' \<turnstile> w \<le>a w' &&& E'' \<turnstile> w' \<le>a a'
[PROOF STEP]
by(auto dest: happens_before_into_action_order elim: sync_orderE)
[PROOF STATE]
proof (state)
this:
E'' \<turnstile> w \<le>a w'
E'' \<turnstile> w' \<le>a a'

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
have "w' = w"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. w' = w
[PROOF STEP]
proof(cases "is_new_action (action_obs E'' w')")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
 2. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
is_new_action (action_obs E'' w')

goal (2 subgoals):
 1. is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
 2. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
hence "w' \<in> new_actions_for P E'' (ad, al)"
[PROOF STATE]
proof (prove)
using this:
is_new_action (action_obs E'' w')

goal (1 subgoal):
 1. w' \<in> new_actions_for P E'' (ad, al)
[PROOF STEP]
using w' adal
[PROOF STATE]
proof (prove)
using this:
is_new_action (action_obs E'' w')
w' \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w'

goal (1 subgoal):
 1. w' \<in> new_actions_for P E'' (ad, al)
[PROOF STEP]
by(simp add: new_actions_for_def)
[PROOF STATE]
proof (state)
this:
w' \<in> new_actions_for P E'' (ad, al)

goal (2 subgoals):
 1. is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
 2. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
w' \<in> new_actions_for P E'' (ad, al)

goal (2 subgoals):
 1. is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
 2. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
from ao True
[PROOF STATE]
proof (chain)
picking this:
E'' \<turnstile> w \<le>a w'
E'' \<turnstile> w' \<le>a a'
is_new_action (action_obs E'' w')
[PROOF STEP]
have "is_new_action (action_obs E'' w)"
[PROOF STATE]
proof (prove)
using this:
E'' \<turnstile> w \<le>a w'
E'' \<turnstile> w' \<le>a a'
is_new_action (action_obs E'' w')

goal (1 subgoal):
 1. is_new_action (action_obs E'' w)
[PROOF STEP]
by(cases rule: action_orderE) simp_all
[PROOF STATE]
proof (state)
this:
is_new_action (action_obs E'' w)

goal (2 subgoals):
 1. is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
 2. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
with \<open>w \<in> write_actions E''\<close> \<open>(ad, al) \<in> action_loc P E'' w\<close>
[PROOF STATE]
proof (chain)
picking this:
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
is_new_action (action_obs E'' w)
[PROOF STEP]
have "w \<in> new_actions_for P E'' (ad, al)"
[PROOF STATE]
proof (prove)
using this:
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
is_new_action (action_obs E'' w)

goal (1 subgoal):
 1. w \<in> new_actions_for P E'' (ad, al)
[PROOF STEP]
by(simp add: new_actions_for_def)
[PROOF STATE]
proof (state)
this:
w \<in> new_actions_for P E'' (ad, al)

goal (2 subgoals):
 1. is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
 2. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
w' \<in> new_actions_for P E'' (ad, al)
w \<in> new_actions_for P E'' (ad, al)
[PROOF STEP]
show "w' = w"
[PROOF STATE]
proof (prove)
using this:
w' \<in> new_actions_for P E'' (ad, al)
w \<in> new_actions_for P E'' (ad, al)

goal (1 subgoal):
 1. w' = w
[PROOF STEP]
by(rule new_actions_for_fun)
[PROOF STATE]
proof (state)
this:
w' = w

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> is_new_action (action_obs E'' w')

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
with ao
[PROOF STATE]
proof (chain)
picking this:
E'' \<turnstile> w \<le>a w'
E'' \<turnstile> w' \<le>a a'
\<not> is_new_action (action_obs E'' w')
[PROOF STEP]
have "w' \<le> a'"
[PROOF STATE]
proof (prove)
using this:
E'' \<turnstile> w \<le>a w'
E'' \<turnstile> w' \<le>a a'
\<not> is_new_action (action_obs E'' w')

goal (1 subgoal):
 1. w' \<le> a'
[PROOF STEP]
by(auto elim: action_orderE)
[PROOF STATE]
proof (state)
this:
w' \<le> a'

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
hence w'_a: "enat w' < enat (Suc a')"
[PROOF STATE]
proof (prove)
using this:
w' \<le> a'

goal (1 subgoal):
 1. enat w' < enat (Suc a')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
enat w' < enat (Suc a')

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
with hbso w_a'
[PROOF STATE]
proof (chain)
picking this:
P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a'
w < Suc a'
enat w' < enat (Suc a')
[PROOF STEP]
have "?hbso ?E''"
[PROOF STATE]
proof (prove)
using this:
P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a'
w < Suc a'
enat w' < enat (Suc a')

goal (1 subgoal):
 1. P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>so w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>so a'
[PROOF STEP]
by(auto 4 3 elim: happens_before_change_prefix[OF _ tsa' sim[symmetric]] sync_order_change_prefix[OF _ sim[symmetric]] del: disjCI intro: disjI1 disjI2)
[PROOF STATE]
proof (state)
this:
P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>so w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>so a'

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>so w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>so a'

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
from w' \<open>w' \<le> a'\<close> a' a lnth a'_E'
[PROOF STATE]
proof (chain)
picking this:
w' \<in> write_actions E''
w' \<le> a'
enat a' < llength E''
enat a < llength E
lnth E a = (t, NormalAction (ReadMem ad al v))
length E' \<le> a'
[PROOF STEP]
have "w' \<in> write_actions ?E''"
[PROOF STATE]
proof (prove)
using this:
w' \<in> write_actions E''
w' \<le> a'
enat a' < llength E''
enat a < llength E
lnth E a = (t, NormalAction (ReadMem ad al v))
length E' \<le> a'

goal (1 subgoal):
 1. w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
[PROOF STEP]
by(cases)(cases "w' < a'", auto intro!: write_actions.intros simp add: E'''_def actions_def action_obs_def lnth_lappend min_def zero_enat_def eSuc_enat lnth_ltake a_def E''_def not_le not_less)
[PROOF STATE]
proof (state)
this:
w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
from adal \<open>w' \<le> a'\<close> a a' lnth w' a'_E'
[PROOF STATE]
proof (chain)
picking this:
(ad, al) \<in> action_loc P E'' w'
w' \<le> a'
enat a < llength E
enat a' < llength E''
lnth E a = (t, NormalAction (ReadMem ad al v))
w' \<in> write_actions E''
length E' \<le> a'
[PROOF STEP]
have "(ad, al) \<in> action_loc P ?E'' w'"
[PROOF STATE]
proof (prove)
using this:
(ad, al) \<in> action_loc P E'' w'
w' \<le> a'
enat a < llength E
enat a' < llength E''
lnth E a = (t, NormalAction (ReadMem ad al v))
w' \<in> write_actions E''
length E' \<le> a'

goal (1 subgoal):
 1. (ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w'
[PROOF STEP]
by(cases "w' < a'")(cases "w' < length E'", auto simp add: E'''_def action_obs_def lnth_lappend lappend_assoc[symmetric] min_def lnth_ltake less_trans[where y="enat a"] a_def E''_def lnth_ltake elim: write_actions.cases)
[PROOF STATE]
proof (state)
this:
(ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w'

goal (1 subgoal):
 1. \<not> is_new_action (action_obs E'' w') \<Longrightarrow> w' = w
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>so w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>so a'
w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
(ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w'
[PROOF STEP]
show "w' = w"
[PROOF STATE]
proof (prove)
using this:
P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>hb w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w \<le>so w' \<and> P,lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil) \<turnstile> w' \<le>so a'
w' \<in> write_actions (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil))
(ad, al) \<in> action_loc P (lappend E''' (LCons (t, NormalAction (ReadMem ad al v)) LNil)) w'

goal (1 subgoal):
 1. w' = w
[PROOF STEP]
by(blast dest: in_between_so in_between_hb)
[PROOF STATE]
proof (state)
this:
w' = w

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

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?w'2 \<in> write_actions E''; (ad, al) \<in> action_loc P E'' ?w'2; P,E'' \<turnstile> w \<le>hb ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>so a'\<rbrakk> \<Longrightarrow> ?w'2 = w

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
value_written P E'' w (ad, al) = v
P,E'' \<turnstile> w \<le>hb a'
\<lbrakk>?w'2 \<in> write_actions E''; (ad, al) \<in> action_loc P E'' ?w'2; P,E'' \<turnstile> w \<le>hb ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>so a'\<rbrakk> \<Longrightarrow> ?w'2 = w
[PROOF STEP]
have "?P a' w"
[PROOF STATE]
proof (prove)
using this:
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
value_written P E'' w (ad, al) = v
P,E'' \<turnstile> w \<le>hb a'
\<lbrakk>?w'2 \<in> write_actions E''; (ad, al) \<in> action_loc P E'' ?w'2; P,E'' \<turnstile> w \<le>hb ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>so a'\<rbrakk> \<Longrightarrow> ?w'2 = w

goal (1 subgoal):
 1. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)
[PROOF STEP]
using a'_E' lnth
[PROOF STATE]
proof (prove)
using this:
w \<in> write_actions E''
(ad, al) \<in> action_loc P E'' w
value_written P E'' w (ad, al) = v
P,E'' \<turnstile> w \<le>hb a'
\<lbrakk>?w'2 \<in> write_actions E''; (ad, al) \<in> action_loc P E'' ?w'2; P,E'' \<turnstile> w \<le>hb ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so ?w'2 \<and> P,E'' \<turnstile> ?w'2 \<le>so a'\<rbrakk> \<Longrightarrow> ?w'2 = w
length E' \<le> a'
lnth E a = (t, NormalAction (ReadMem ad al v))

goal (1 subgoal):
 1. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)
[PROOF STEP]
unfolding E''_def a_def
[PROOF STATE]
proof (prove)
using this:
w \<in> write_actions (lappend (llist_of E') E)
(ad, al) \<in> action_loc P (lappend (llist_of E') E) w
value_written P (lappend (llist_of E') E) w (ad, al) = v
P,lappend (llist_of E') E \<turnstile> w \<le>hb a'
\<lbrakk>?w'2 \<in> write_actions (lappend (llist_of E') E); (ad, al) \<in> action_loc P (lappend (llist_of E') E) ?w'2; P,lappend (llist_of E') E \<turnstile> w \<le>hb ?w'2 \<and> P,lappend (llist_of E') E \<turnstile> ?w'2 \<le>hb a' \<or> is_volatile P al \<and> P,lappend (llist_of E') E \<turnstile> w \<le>so ?w'2 \<and> P,lappend (llist_of E') E \<turnstile> ?w'2 \<le>so a'\<rbrakk> \<Longrightarrow> ?w'2 = w
length E' \<le> a'
lnth E (a' - length E') = (t, NormalAction (ReadMem ad al v))

goal (1 subgoal):
 1. case lnth (lappend (llist_of E') E) a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions (lappend (llist_of E') E) \<and> (ad, al) \<in> action_loc P (lappend (llist_of E') E) w \<and> value_written P (lappend (llist_of E') E) w (ad, al) = v \<and> P,lappend (llist_of E') E \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions (lappend (llist_of E') E). (ad, al) \<in> action_loc P (lappend (llist_of E') E) w' \<longrightarrow> P,lappend (llist_of E') E \<turnstile> w \<le>hb w' \<and> P,lappend (llist_of E') E \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,lappend (llist_of E') E \<turnstile> w \<le>so w' \<and> P,lappend (llist_of E') E \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)
[PROOF STEP]
by(simp add: lnth_lappend)
[PROOF STATE]
proof (state)
this:
case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
hence P: "?P a' (Eps (?P a'))"
[PROOF STATE]
proof (prove)
using this:
case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)

goal (1 subgoal):
 1. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
[PROOF STEP]
by(rule someI[where P="?P a'"])
[PROOF STATE]
proof (state)
this:
case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))

goal (7 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<not> a' < length E' \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<not> a' < length E' \<Longrightarrow> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
 4. \<lbrakk>\<not> a' < length E'; length E' \<le> a'\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
 5. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 6. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 7. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
from P lnth'' a'_E'
[PROOF STATE]
proof (chain)
picking this:
case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
lnth E'' a' = (t, NormalAction (ReadMem ad al v))
length E' \<le> a'
[PROOF STEP]
show "?ws a' \<in> write_actions E''"
        and "(ad, al) \<in> action_loc P E'' (?ws a')"
        and "value_written P E'' (?ws a') (ad, al) = v"
        and "P,E'' \<turnstile> ?ws a' \<le>hb a'"
[PROOF STATE]
proof (prove)
using this:
case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
lnth E'' a' = (t, NormalAction (ReadMem ad al v))
length E' \<le> a'

goal (1 subgoal):
 1. ((if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' &&& (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))) &&& value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v &&& P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
(ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'

goal (3 subgoals):
 1. \<not> a' < length E' \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 3. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
show "\<not> P,E'' \<turnstile> a' \<le>hb ?ws a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<Longrightarrow> False
[PROOF STEP]
assume "P,E'' \<turnstile> a' \<le>hb ?ws a'"
[PROOF STATE]
proof (state)
this:
P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<Longrightarrow> False
[PROOF STEP]
with \<open>P,E'' \<turnstile> ?ws a' \<le>hb a'\<close>
[PROOF STATE]
proof (chain)
picking this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
have "a' = ?ws a'"
[PROOF STATE]
proof (prove)
using this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
by(blast dest: antisymPD[OF antisym_action_order] happens_before_into_action_order)
[PROOF STATE]
proof (state)
this:
a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<Longrightarrow> False
[PROOF STEP]
with read \<open>?ws a' \<in> write_actions E''\<close>
[PROOF STATE]
proof (chain)
picking this:
a' \<in> read_actions E''
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a' \<in> read_actions E''
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. False
[PROOF STEP]
by(auto dest: read_actions_not_write_actions)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (2 subgoals):
 1. \<lbrakk>\<not> a' < length E'; is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
 2. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
show "\<not> P,E'' \<turnstile> a' \<le>so ?ws a'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<Longrightarrow> False
[PROOF STEP]
assume "P,E'' \<turnstile> a' \<le>so ?ws a'"
[PROOF STATE]
proof (state)
this:
P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<Longrightarrow> False
[PROOF STEP]
hence "E'' \<turnstile> a' \<le>a ?ws a'"
[PROOF STATE]
proof (prove)
using this:
P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. E'' \<turnstile> a' \<le>a (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
by(blast elim: sync_orderE)
[PROOF STATE]
proof (state)
this:
E'' \<turnstile> a' \<le>a (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<Longrightarrow> False
[PROOF STEP]
with \<open>P,E'' \<turnstile> ?ws a' \<le>hb a'\<close>
[PROOF STATE]
proof (chain)
picking this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
E'' \<turnstile> a' \<le>a (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
have "a' = ?ws a'"
[PROOF STATE]
proof (prove)
using this:
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
E'' \<turnstile> a' \<le>a (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
by(blast dest: antisymPD[OF antisym_action_order] happens_before_into_action_order)
[PROOF STATE]
proof (state)
this:
a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<Longrightarrow> False
[PROOF STEP]
with read \<open>?ws a' \<in> write_actions E''\<close>
[PROOF STATE]
proof (chain)
picking this:
a' \<in> read_actions E''
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
a' \<in> read_actions E''
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
a' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. False
[PROOF STEP]
by(auto dest: read_actions_not_write_actions)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
fix a''
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
assume "a'' \<in> write_actions E''" "(ad, al) \<in> action_loc P E'' a''"
        and "P,E'' \<turnstile> ?ws a' \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or>
             is_volatile P al \<and> P,E'' \<turnstile> ?ws a' \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'"
[PROOF STATE]
proof (state)
this:
a'' \<in> write_actions E''
(ad, al) \<in> action_loc P E'' a''
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'

goal (1 subgoal):
 1. \<And>a''. \<lbrakk>\<not> a' < length E'; a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
thus "a'' = ?ws a'"
[PROOF STATE]
proof (prove)
using this:
a'' \<in> write_actions E''
(ad, al) \<in> action_loc P E'' a''
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'

goal (1 subgoal):
 1. a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
using lnth'' P a'_E'
[PROOF STATE]
proof (prove)
using this:
a'' \<in> write_actions E''
(ad, al) \<in> action_loc P E'' a''
P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a'
lnth E'' a' = (t, NormalAction (ReadMem ad al v))
case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = (SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
length E' \<le> a'

goal (1 subgoal):
 1. a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
[PROOF STEP]
by -(erule disjE, clarsimp+)
[PROOF STATE]
proof (state)
this:
a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> (length E' \<le> a' \<longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a') \<and> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> (is_volatile P al \<longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))) \<and> (\<forall>a''. a'' \<in> write_actions E'' \<longrightarrow> (ad, al) \<in> action_loc P E'' a'' \<longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a' \<longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))

goal (9 subgoals):
 1. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) \<in> write_actions E''
 2. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> (ad, al) \<in> action_loc P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 3. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> value_written P E'' (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w)) (ad, al) = v
 4. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>hb (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 5. \<And>a ad al v. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); is_volatile P al\<rbrakk> \<Longrightarrow> \<not> P,E'' \<turnstile> a \<le>so (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 6. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>hb a'; P,E'' \<turnstile> a' \<le>hb a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 7. \<And>a ad al v a'. \<lbrakk>a \<in> read_actions E''; action_obs E'' a = NormalAction (ReadMem ad al v); a' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a'; is_volatile P al; P,E'' \<turnstile> if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w) \<le>so a'; P,E'' \<turnstile> a' \<le>so a\<rbrakk> \<Longrightarrow> a' = (if a < length E' then ws' a else SOME w. case lnth E'' a of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a \<longrightarrow> w' = w))
 8. thread_start_actions_ok E''
 9. \<And>n ad al v. \<lbrakk>n \<in> read_actions E''; length E' \<le> n; action_obs E'' n = NormalAction (ReadMem ad al v)\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n
[PROOF STEP]
thus "?ws a' \<in> write_actions E''"
      and "(ad, al) \<in> action_loc P E'' (?ws a')"
      and "value_written P E'' (?ws a') (ad, al) = v"
      and "length E' \<le> a' \<Longrightarrow> P,E'' \<turnstile> ?ws a' \<le>hb a'"
      and "\<not> P,E'' \<turnstile> a' \<le>hb ?ws a'"
      and "is_volatile P al \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so ?ws a'"
      and "\<And>a''. \<lbrakk> a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> ?ws a' \<le>hb a''; P,E'' \<turnstile> a'' \<le>hb a' \<rbrakk> \<Longrightarrow> a'' = ?ws a'"
      and "\<And>a''. \<lbrakk> a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; is_volatile P al; P,E'' \<turnstile> ?ws a' \<le>so a''; P,E'' \<turnstile> a'' \<le>so a' \<rbrakk> \<Longrightarrow> a'' = ?ws a'"
[PROOF STATE]
proof (prove)
using this:
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v \<and> (length E' \<le> a' \<longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a') \<and> \<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<and> (is_volatile P al \<longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))) \<and> (\<forall>a''. a'' \<in> write_actions E'' \<longrightarrow> (ad, al) \<in> action_loc P E'' a'' \<longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'' \<and> P,E'' \<turnstile> a'' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a'' \<and> P,E'' \<turnstile> a'' \<le>so a' \<longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))

goal (1 subgoal):
 1. (((if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E'' &&& (ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))) &&& value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v &&& (length E' \<le> a' \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a')) &&& (\<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) &&& (is_volatile P al \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))) &&& (\<And>a''. \<lbrakk>a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a''; P,E'' \<turnstile> a'' \<le>hb a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))) &&& (\<And>a''. \<lbrakk>a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' a''; is_volatile P al; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so a''; P,E'' \<turnstile> a'' \<le>so a'\<rbrakk> \<Longrightarrow> a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)))
[PROOF STEP]
by blast+
[PROOF STATE]
proof (state)
this:
(if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) \<in> write_actions E''
(ad, al) \<in> action_loc P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
value_written P E'' (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w)) (ad, al) = v
length E' \<le> a' \<Longrightarrow> P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb a'
\<not> P,E'' \<turnstile> a' \<le>hb (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
is_volatile P al \<Longrightarrow> \<not> P,E'' \<turnstile> a' \<le>so (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
\<lbrakk>?a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' ?a''; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>hb ?a''; P,E'' \<turnstile> ?a'' \<le>hb a'\<rbrakk> \<Longrightarrow> ?a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))
\<lbrakk>?a'' \<in> write_actions E''; (ad, al) \<in> action_loc P E'' ?a''; is_volatile P al; P,E'' \<turnstile> if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w) \<le>so ?a''; P,E'' \<turnstile> ?a'' \<le>so a'\<rbrakk> \<Longrightarrow> ?a'' = (if a' < length E' then ws' a' else SOME w. case lnth E'' a' of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb a' \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb a' \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so a' \<longrightarrow> w' = w))

goal (1 subgoal):
 1. thread_start_actions_ok E''
[PROOF STEP]
qed(assumption|rule tsa)+
[PROOF STATE]
proof (state)
this:
P \<turnstile> (E'', \<lambda>n. if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) \<surd> \<and> (\<forall>n ad al v. n \<in> read_actions E'' \<longrightarrow> length E' \<le> n \<longrightarrow> action_obs E'' n = NormalAction (ReadMem ad al v) \<longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n)

goal (3 subgoals):
 1. P \<turnstile> (E'', ?ws) \<surd>
 2. \<And>n. \<lbrakk>n \<in> read_actions E''; length E' \<le> n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n
 3. \<And>n. n < length E' \<Longrightarrow> ?ws n = ws' n
[PROOF STEP]
thus "P \<turnstile> (E'', ?ws) \<surd>"
    and "\<And>n. \<lbrakk> n \<in> read_actions E''; length E' \<le> n \<rbrakk> \<Longrightarrow> P,E'' \<turnstile> ?ws n \<le>hb n"
[PROOF STATE]
proof (prove)
using this:
P \<turnstile> (E'', \<lambda>n. if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) \<surd> \<and> (\<forall>n ad al v. n \<in> read_actions E'' \<longrightarrow> length E' \<le> n \<longrightarrow> action_obs E'' n = NormalAction (ReadMem ad al v) \<longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n)

goal (1 subgoal):
 1. P \<turnstile> (E'', \<lambda>n. if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) \<surd> &&& (\<And>n. \<lbrakk>n \<in> read_actions E''; length E' \<le> n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w) \<le>hb n)
[PROOF STEP]
by(blast elim: read_actions.cases intro: read_actions.intros)+
[PROOF STATE]
proof (state)
this:
P \<turnstile> (E'', \<lambda>n. if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) \<surd>
\<lbrakk>?n \<in> read_actions E''; length E' \<le> ?n\<rbrakk> \<Longrightarrow> P,E'' \<turnstile> if ?n < length E' then ws' ?n else SOME w. case lnth E'' ?n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb ?n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb ?n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so ?n \<longrightarrow> w' = w) \<le>hb ?n

goal (1 subgoal):
 1. \<And>n. n < length E' \<Longrightarrow> (if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) = ws' n
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>n. n < length E' \<Longrightarrow> (if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) = ws' n
[PROOF STEP]
assume "n < length E'"
[PROOF STATE]
proof (state)
this:
n < length E'

goal (1 subgoal):
 1. \<And>n. n < length E' \<Longrightarrow> (if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) = ws' n
[PROOF STEP]
thus "?ws n = ws' n"
[PROOF STATE]
proof (prove)
using this:
n < length E'

goal (1 subgoal):
 1. (if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) = ws' n
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
(if n < length E' then ws' n else SOME w. case lnth E'' n of (t, NormalAction (ReadMem ad al v)) \<Rightarrow> w \<in> write_actions E'' \<and> (ad, al) \<in> action_loc P E'' w \<and> value_written P E'' w (ad, al) = v \<and> P,E'' \<turnstile> w \<le>hb n \<and> (\<forall>w'\<in>write_actions E''. (ad, al) \<in> action_loc P E'' w' \<longrightarrow> P,E'' \<turnstile> w \<le>hb w' \<and> P,E'' \<turnstile> w' \<le>hb n \<or> is_volatile P al \<and> P,E'' \<turnstile> w \<le>so w' \<and> P,E'' \<turnstile> w' \<le>so n \<longrightarrow> w' = w)) = ws' n

goal:
No subgoals!
[PROOF STEP]
qed