[STATEMENT]
lemma flush_flush_all_until_volatile_write_Write\<^sub>s\<^sub>b_volatile_commute:
  "\<And>i m. \<lbrakk>i < length ts; ts!i=(p,is,xs,Write\<^sub>s\<^sub>b True a sop v A L R W#sb,\<D>,\<O>,\<R>);
        \<forall>i < length ts. (\<forall>j < length ts. i \<noteq> j \<longrightarrow>
                  (let (_,_,_,sb\<^sub>i,_,_,_) = ts!i;
                      (_,_,_,sb\<^sub>j,_,_,_) = ts!j
                   in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter>
                      outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}));
        \<forall>j < length ts. i \<noteq> j \<longrightarrow>
                (let (_,_,_,sb\<^sub>j,_,_,_) = ts!j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk>
       \<Longrightarrow>
       flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)
         ((flush_all_until_volatile_write ts m)(a := v)) =
       flush_all_until_volatile_write (ts[i := (p,is,xs, sb, \<D>', \<O>',\<R>')])
         (m(a := v))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
proof (induct ts)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>i m. \<lbrakk>i < length []; [] ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length []. \<forall>j<length []. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = [] ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = [] ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length []. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = [] ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write [] m)(a := v)) = flush_all_until_volatile_write ([][i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
i < length []
[] ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
\<forall>i<length []. \<forall>j<length []. i \<noteq> j \<longrightarrow> (let a = [] ! i in case a of (uu_, uua_, uub_, sb\<^sub>i, uuc_, uud_, uue_) \<Rightarrow> let a = [] ! j in case a of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {})
\<forall>j<length []. i \<noteq> j \<longrightarrow> (let b = [] ! j in case b of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))

goal (2 subgoals):
 1. \<And>i m. \<lbrakk>i < length []; [] ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length []. \<forall>j<length []. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = [] ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = [] ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length []. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = [] ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write [] m)(a := v)) = flush_all_until_volatile_write ([][i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
i < length []
[] ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
\<forall>i<length []. \<forall>j<length []. i \<noteq> j \<longrightarrow> (let a = [] ! i in case a of (uu_, uua_, uub_, sb\<^sub>i, uuc_, uud_, uue_) \<Rightarrow> let a = [] ! j in case a of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {})
\<forall>j<length []. i \<noteq> j \<longrightarrow> (let b = [] ! j in case b of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))

goal (1 subgoal):
 1. flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write [] m)(a := v)) = flush_all_until_volatile_write ([][i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write [] m)(a := v)) = flush_all_until_volatile_write ([][i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))

goal (1 subgoal):
 1. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
case (Cons l ts)
[PROOF STATE]
proof (state)
this:
\<lbrakk>?i < length ts; ts ! ?i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let a = ts ! i in case a of (uu_, uua_, uub_, sb\<^sub>i, uuc_, uud_, uue_) \<Rightarrow> let a = ts ! j in case a of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. ?i \<noteq> j \<longrightarrow> (let b = ts ! j in case b of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts ?m)(a := v)) = flush_all_until_volatile_write (ts[?i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (?m(a := v))
i < length (l # ts)
(l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
\<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let a = (l # ts) ! i in case a of (uu_, uua_, uub_, sb\<^sub>i, uuc_, uud_, uue_) \<Rightarrow> let a = (l # ts) ! j in case a of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {})
\<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let b = (l # ts) ! j in case b of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))

goal (1 subgoal):
 1. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
note i_bound =  \<open>i < length (l#ts)\<close>
[PROOF STATE]
proof (state)
this:
i < length (l # ts)

goal (1 subgoal):
 1. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
note ith = \<open>(l#ts)!i = (p,is,xs,Write\<^sub>s\<^sub>b True a sop v A L R W#sb,\<D>,\<O>,\<R>)\<close>
[PROOF STATE]
proof (state)
this:
(l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)

goal (1 subgoal):
 1. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
note disj = \<open>\<forall>i < length (l#ts). (\<forall>j < length (l#ts). i \<noteq> j \<longrightarrow>
                  (let (_,_,_,sb\<^sub>i,_,_,_) = (l#ts)!i;
                      (_,_,_,sb\<^sub>j,_,_,_) = (l#ts)!j
                   in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter>
                      outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}))\<close>
[PROOF STATE]
proof (state)
this:
\<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {})

goal (1 subgoal):
 1. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
note a_notin = \<open>\<forall>j < length (l#ts). i \<noteq> j \<longrightarrow>
                (let (_,_,_,sb\<^sub>j,_,_,_) = (l#ts)!j
                 in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<close>
[PROOF STATE]
proof (state)
this:
\<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))

goal (1 subgoal):
 1. \<And>aa ts i m. \<lbrakk>\<And>i m. \<lbrakk>i < length ts; ts ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = ts ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = ts ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write (ts[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v)); i < length (aa # ts); (aa # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (aa # ts). \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (aa # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (aa # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (aa # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (aa # ts) m)(a := v)) = flush_all_until_volatile_write ((aa # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
proof (cases i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
from ith 0
[PROOF STATE]
proof (chain)
picking this:
(l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
i = 0
[PROOF STEP]
have l: "l = (p,is,xs,Write\<^sub>s\<^sub>b True a sop v A L R W#sb,\<D>,\<O>,\<R>)"
[PROOF STATE]
proof (prove)
using this:
(l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
i = 0

goal (1 subgoal):
 1. l = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
l = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
have a_notin_ts:
      "a \<notin> \<Union>((\<lambda>(_,_,_,sb,_,_,_). outstanding_refs is_Write\<^sub>s\<^sub>b
                            (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) ` set ts)" (is "a \<notin> ?U")
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> False
[PROOF STEP]
assume "a \<in> ?U"
[PROOF STATE]
proof (state)
this:
a \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. a \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> False
[PROOF STEP]
from in_Union_image_nth_conv [OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>i<length ts. a \<in> (case ts ! i of (uu_, uua_, uub_, sb, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))
[PROOF STEP]
obtain j p\<^sub>j "is\<^sub>j" "\<O>\<^sub>j" \<R>\<^sub>j \<D>\<^sub>j "xs\<^sub>j" "sb\<^sub>j" where
	j_bound: "j < length ts" and
	jth: "ts!j = (p\<^sub>j,is\<^sub>j,xs\<^sub>j,sb\<^sub>j,\<D>\<^sub>j,\<O>\<^sub>j,\<R>\<^sub>j)" and
	a_in_j: "a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)"
[PROOF STATE]
proof (prove)
using this:
\<exists>i<length ts. a \<in> (case ts ! i of (uu_, uua_, uub_, sb, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (\<And>j p\<^sub>j is\<^sub>j xs\<^sub>j sb\<^sub>j \<D>\<^sub>j \<O>\<^sub>j \<R>\<^sub>j. \<lbrakk>j < length ts; ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<O>\<^sub>j, \<R>\<^sub>j); a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
j < length ts
ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<O>\<^sub>j, \<R>\<^sub>j)
a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)

goal (1 subgoal):
 1. a \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> False
[PROOF STEP]
from a_notin [rule_format, of "Suc j"] j_bound 0 a_in_j
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>Suc j < length (l # ts); i \<noteq> Suc j\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! Suc j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
j < length ts
i = 0
a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Suc j < length (l # ts); i \<noteq> Suc j\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! Suc j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
j < length ts
i = 0
a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (auto simp add: jth)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
from a_notin_ts
[PROOF STATE]
proof (chain)
picking this:
a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))
[PROOF STEP]
have "(flush_all_until_volatile_write ts m)(a := v) =
                flush_all_until_volatile_write ts (m(a := v))"
[PROOF STATE]
proof (prove)
using this:
a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (flush_all_until_volatile_write ts m)(a := v) = flush_all_until_volatile_write ts (m(a := v))
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> (flush_all_until_volatile_write ts m)(a := v) = flush_all_until_volatile_write ts (m(a := v))
[PROOF STEP]
apply (rule update_commute' [where F="{a}" and G="?U" and
	g="flush_all_until_volatile_write ts"])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> \<forall>a m. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<longrightarrow> flush_all_until_volatile_write ts m a = m a
 2. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> \<forall>a m\<^sub>1 m\<^sub>2. a \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<longrightarrow> flush_all_until_volatile_write ts m\<^sub>1 a = flush_all_until_volatile_write ts m\<^sub>2 a
 3. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> \<forall>aa m. aa \<notin> {a} \<longrightarrow> (m(a := v)) aa = m aa
 4. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> \<forall>aa m\<^sub>1 m\<^sub>2. aa \<in> {a} \<longrightarrow> (m\<^sub>1(a := v)) aa = (m\<^sub>2(a := v)) aa
 5. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> {a} = {}
[PROOF STEP]
apply (auto intro: flush_all_until_volatile_wirte_mem_independent
             flush_all_until_volatile_write_unchanged_addresses)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(flush_all_until_volatile_write ts m)(a := v) = flush_all_until_volatile_write ts (m(a := v))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
(flush_all_until_volatile_write ts m)(a := v) = flush_all_until_volatile_write ts (m(a := v))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
let ?SB = "outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
have U_SB_disj: "?U \<inter> ?SB = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
fix a'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
assume a'_in_U: "a' \<in> ?U"
[PROOF STATE]
proof (state)
this:
a' \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
have "a' \<notin> ?SB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a' \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<Longrightarrow> False
[PROOF STEP]
assume a'_in_SB: "a' \<in> ?SB"
[PROOF STATE]
proof (state)
this:
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<Longrightarrow> False
[PROOF STEP]
hence a'_in_SB': "a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb"
[PROOF STATE]
proof (prove)
using this:
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb
[PROOF STEP]
apply (clarsimp simp add: outstanding_refs_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb); is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
apply (drule set_takeWhileD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x; x \<in> set sb \<and> (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) x\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x; x \<in> set sb \<and> (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) x\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
apply (rule_tac x=x in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x; x \<in> set sb \<and> (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) x\<rbrakk> \<Longrightarrow> x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
apply (auto simp add: is_Write\<^sub>s\<^sub>b_def split:memref.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb

goal (1 subgoal):
 1. a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<Longrightarrow> False
[PROOF STEP]
from in_Union_image_nth_conv [OF a'_in_U]
[PROOF STATE]
proof (chain)
picking this:
\<exists>i<length ts. a' \<in> (case ts ! i of (uu_, uua_, uub_, sb, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))
[PROOF STEP]
obtain j p\<^sub>j "is\<^sub>j" "\<O>\<^sub>j" \<R>\<^sub>j \<D>\<^sub>j "xs\<^sub>j" "sb\<^sub>j" where
	    j_bound: "j < length ts" and
	    jth: "ts!j = (p\<^sub>j,is\<^sub>j,xs\<^sub>j,sb\<^sub>j,\<D>\<^sub>j,\<O>\<^sub>j,\<R>\<^sub>j)" and
	    a'_in_j: "a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)"
[PROOF STATE]
proof (prove)
using this:
\<exists>i<length ts. a' \<in> (case ts ! i of (uu_, uua_, uub_, sb, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (\<And>j p\<^sub>j is\<^sub>j xs\<^sub>j sb\<^sub>j \<D>\<^sub>j \<O>\<^sub>j \<R>\<^sub>j. \<lbrakk>j < length ts; ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<O>\<^sub>j, \<R>\<^sub>j); a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
j < length ts
ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<O>\<^sub>j, \<R>\<^sub>j)
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)

goal (1 subgoal):
 1. a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<Longrightarrow> False
[PROOF STEP]
from disj [rule_format, of 0 "Suc j"] 0 j_bound a'_in_SB' a'_in_j jth l
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < length (l # ts); Suc j < length (l # ts); 0 \<noteq> Suc j\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! 0; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! Suc j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}
i = 0
j < length ts
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<O>\<^sub>j, \<R>\<^sub>j)
l = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (l # ts); Suc j < length (l # ts); 0 \<noteq> Suc j\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! 0; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! Suc j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}
i = 0
j < length ts
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<O>\<^sub>j, \<R>\<^sub>j)
l = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a' \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?a'2 \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> ?a'2 \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
?a'2 \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> ?a'2 \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
?a'2 \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> ?a'2 \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
fix a'
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
assume a'_in_SB: "a' \<in> ?SB"
[PROOF STATE]
proof (state)
this:
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
hence a'_in_SB': "a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb"
[PROOF STATE]
proof (prove)
using this:
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)

goal (1 subgoal):
 1. a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb
[PROOF STEP]
apply (clarsimp simp add: outstanding_refs_conv)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>x \<in> set (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb); is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
apply (drule set_takeWhileD)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>x. \<lbrakk>is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x; x \<in> set sb \<and> (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) x\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
subgoal for x
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x; x \<in> set sb \<and> (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) x\<rbrakk> \<Longrightarrow> \<exists>x. x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
apply (rule_tac x=x in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>is_Write\<^sub>s\<^sub>b x; a' \<in> address_of x; x \<in> set sb \<and> (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) x\<rbrakk> \<Longrightarrow> x \<in> set sb \<and> is_Write\<^sub>s\<^sub>b x \<and> a' \<in> address_of x
[PROOF STEP]
apply (auto simp add: is_Write\<^sub>s\<^sub>b_def split:memref.splits)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
have "a' \<notin> ?U"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a' \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a' \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> False
[PROOF STEP]
assume "a' \<in> ?U"
[PROOF STATE]
proof (state)
this:
a' \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. a' \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> False
[PROOF STEP]
from in_Union_image_nth_conv [OF this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>i<length ts. a' \<in> (case ts ! i of (uu_, uua_, uub_, sb, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))
[PROOF STEP]
obtain j p\<^sub>j "is\<^sub>j" "\<O>\<^sub>j" \<R>\<^sub>j \<D>\<^sub>j "xs\<^sub>j" "sb\<^sub>j" where
	    j_bound: "j < length ts" and
	    jth: "ts!j = (p\<^sub>j,is\<^sub>j,xs\<^sub>j,sb\<^sub>j,\<D>\<^sub>j,\<R>\<^sub>j,\<O>\<^sub>j)" and
	    a'_in_j: "a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)"
[PROOF STATE]
proof (prove)
using this:
\<exists>i<length ts. a' \<in> (case ts ! i of (uu_, uua_, uub_, sb, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (\<And>j p\<^sub>j is\<^sub>j xs\<^sub>j sb\<^sub>j \<D>\<^sub>j \<R>\<^sub>j \<O>\<^sub>j. \<lbrakk>j < length ts; ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<R>\<^sub>j, \<O>\<^sub>j); a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
j < length ts
ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<R>\<^sub>j, \<O>\<^sub>j)
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)

goal (1 subgoal):
 1. a' \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> False
[PROOF STEP]
from disj [rule_format, of 0 "Suc j"] j_bound a'_in_SB' a'_in_j jth  l
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < length (l # ts); Suc j < length (l # ts); 0 \<noteq> Suc j\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! 0; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! Suc j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}
j < length ts
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<R>\<^sub>j, \<O>\<^sub>j)
l = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (l # ts); Suc j < length (l # ts); 0 \<noteq> Suc j\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! 0; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! Suc j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}
j < length ts
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b sb
a' \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
ts ! j = (p\<^sub>j, is\<^sub>j, xs\<^sub>j, sb\<^sub>j, \<D>\<^sub>j, \<R>\<^sub>j, \<O>\<^sub>j)
l = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a' \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
?a'2 \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<Longrightarrow> ?a'2 \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
?a'2 \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> ?a'2 \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)
?a'2 \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<Longrightarrow> ?a'2 \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
?a'2 \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<Longrightarrow> ?a'2 \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)
?a'2 \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<Longrightarrow> ?a'2 \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb))

goal (1 subgoal):
 1. (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
(\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = {}

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
have "flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)
           (flush_all_until_volatile_write ts (m(a := v))) =
          flush_all_until_volatile_write ts
           (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (flush_all_until_volatile_write ts (m(a := v))) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))
[PROOF STEP]
apply (rule update_commute' [where g = "flush_all_until_volatile_write ts ",
             OF _ _ _ _ U_SB_disj])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<forall>a m. a \<notin> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<longrightarrow> flush_all_until_volatile_write ts m a = m a
 2. \<forall>a m\<^sub>1 m\<^sub>2. a \<in> (\<Union>(uu_, uu_, uu_, sb, uu_, uu_, uu_)\<in>set ts. outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<longrightarrow> flush_all_until_volatile_write ts m\<^sub>1 a = flush_all_until_volatile_write ts m\<^sub>2 a
 3. \<forall>a m. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) m a = m a
 4. \<forall>a m\<^sub>1 m\<^sub>2. a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) m\<^sub>1 a = flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) m\<^sub>2 a
[PROOF STEP]
apply (auto intro: flush_all_until_volatile_wirte_mem_independent
             flush_all_until_volatile_write_unchanged_addresses
             flush_unchanged_addresses
             flushed_values_mem_independent simp del: o_apply)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (flush_all_until_volatile_write ts (m(a := v))) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
(flush_all_until_volatile_write ts m)(a := v) = flush_all_until_volatile_write ts (m(a := v))
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (flush_all_until_volatile_write ts (m(a := v))) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))
[PROOF STEP]
have "flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)
           ((flush_all_until_volatile_write ts m)(a := v)) =
          flush_all_until_volatile_write ts
           (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))"
[PROOF STATE]
proof (prove)
using this:
(flush_all_until_volatile_write ts m)(a := v) = flush_all_until_volatile_write ts (m(a := v))
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (flush_all_until_volatile_write ts (m(a := v))) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))

goal (1 subgoal):
 1. flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
 2. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts m)(a := v)) = flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) (m(a := v)))

goal (1 subgoal):
 1. flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
by (auto simp add: l 0 o_def simp del: fun_upd_apply)
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
case (Suc n)
[PROOF STATE]
proof (state)
this:
i = Suc n

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
obtain p\<^sub>l "is\<^sub>l" \<O>\<^sub>l \<R>\<^sub>l \<D>\<^sub>j xs\<^sub>l sb\<^sub>l where l: "l = (p\<^sub>l,is\<^sub>l,xs\<^sub>l,sb\<^sub>l,\<D>\<^sub>j,\<O>\<^sub>l,\<R>\<^sub>l)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p\<^sub>l is\<^sub>l xs\<^sub>l sb\<^sub>l \<D>\<^sub>j \<O>\<^sub>l \<R>\<^sub>l. l = (p\<^sub>l, is\<^sub>l, xs\<^sub>l, sb\<^sub>l, \<D>\<^sub>j, \<O>\<^sub>l, \<R>\<^sub>l) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases l)
[PROOF STATE]
proof (state)
this:
l = (p\<^sub>l, is\<^sub>l, xs\<^sub>l, sb\<^sub>l, \<D>\<^sub>j, \<O>\<^sub>l, \<R>\<^sub>l)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
from i_bound ith disj a_notin
[PROOF STATE]
proof (chain)
picking this:
i < length (l # ts)
(l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
\<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {})
\<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))
[PROOF STEP]
have
      "flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)
        ((flush_all_until_volatile_write ts
           (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m))
          (a := v)) =
       flush_all_until_volatile_write (ts[n := (p,is, xs, sb,\<D>', \<O>',\<R>')])
        ((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v))"
[PROOF STATE]
proof (prove)
using this:
i < length (l # ts)
(l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
\<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {})
\<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))

goal (1 subgoal):
 1. flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m))(a := v)) = flush_all_until_volatile_write (ts[n := (p, is, xs, sb, \<D>', \<O>', \<R>')]) ((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v))
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length (l # ts); (l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m))(a := v)) = flush_all_until_volatile_write (ts[n := (p, is, xs, sb, \<D>', \<O>', \<R>')]) ((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v))
[PROOF STEP]
apply (rule Cons.hyps)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<lbrakk>i < length (l # ts); (l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> n < length ts
 2. \<lbrakk>i < length (l # ts); (l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> ts ! n = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>)
 3. \<lbrakk>i < length (l # ts); (l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> \<forall>i<length ts. \<forall>j<length ts. i \<noteq> j \<longrightarrow> (let a = ts ! i in case a of (uu_, uua_, uub_, sb\<^sub>i, uuc_, uud_, uue_) \<Rightarrow> let a = ts ! j in case a of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {})
 4. \<lbrakk>i < length (l # ts); (l # ts) ! i = (p, is, xs, Write\<^sub>s\<^sub>b True a sop v A L R W # sb, \<D>, \<O>, \<R>); \<forall>i<length (l # ts). \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>i, uu_, uu_, uu_) = (l # ts) ! i; (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in outstanding_refs is_Write\<^sub>s\<^sub>b sb\<^sub>i \<inter> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j) = {}); \<forall>j<length (l # ts). i \<noteq> j \<longrightarrow> (let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! j in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))\<rbrakk> \<Longrightarrow> \<forall>j<length ts. n \<noteq> j \<longrightarrow> (let b = ts ! j in case b of (uu_, uua_, uub_, sb\<^sub>j, uuc_, uud_, uue_) \<Rightarrow> a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j))
[PROOF STEP]
apply (force simp add: Suc Let_def simp del: o_apply)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m))(a := v)) = flush_all_until_volatile_write (ts[n := (p, is, xs, sb, \<D>', \<O>', \<R>')]) ((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v))

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m))(a := v)) = flush_all_until_volatile_write (ts[n := (p, is, xs, sb, \<D>', \<O>', \<R>')]) ((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v))

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
let ?SB = "outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
have "a \<notin> ?SB"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> False
[PROOF STEP]
assume "a \<in> ?SB"
[PROOF STATE]
proof (state)
this:
a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)

goal (1 subgoal):
 1. a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> False
[PROOF STEP]
with a_notin [rule_format, of 0]
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < length (l # ts); i \<noteq> 0\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! 0 in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (l # ts); i \<noteq> 0\<rbrakk> \<Longrightarrow> let (uu_, uu_, uu_, sb\<^sub>j, uu_, uu_, uu_) = (l # ts) ! 0 in a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>j)
a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)

goal (1 subgoal):
 1. False
[PROOF STEP]
by (auto simp add: l Suc)
[PROOF STATE]
proof (state)
this:
False

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)
[PROOF STEP]
have "((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v)) =
          (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) (m(a := v)))"
[PROOF STATE]
proof (prove)
using this:
a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l)

goal (1 subgoal):
 1. (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v) = flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) (m(a := v))
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v) = flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) (m(a := v))
[PROOF STEP]
apply (rule update_commute' [where m=m and F="{a}" and G="?SB"])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> \<forall>a m. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m a = m a
 2. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> \<forall>a m\<^sub>1 m\<^sub>2. a \<in> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m\<^sub>1 a = flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m\<^sub>2 a
 3. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> \<forall>aa m. aa \<notin> {a} \<longrightarrow> (m(a := v)) aa = m aa
 4. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> \<forall>aa m\<^sub>1 m\<^sub>2. aa \<in> {a} \<longrightarrow> (m\<^sub>1(a := v)) aa = (m\<^sub>2(a := v)) aa
 5. a \<notin> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<Longrightarrow> outstanding_refs is_Write\<^sub>s\<^sub>b (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) \<inter> {a} = {}
[PROOF STEP]
apply (auto intro:
             flush_unchanged_addresses
             flushed_values_mem_independent simp del: o_apply)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v) = flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) (m(a := v))

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m))(a := v)) = flush_all_until_volatile_write (ts[n := (p, is, xs, sb, \<D>', \<O>', \<R>')]) ((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v))
(flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v) = flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) (m(a := v))
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write ts (flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m))(a := v)) = flush_all_until_volatile_write (ts[n := (p, is, xs, sb, \<D>', \<O>', \<R>')]) ((flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v))
(flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) m)(a := v) = flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>l) (m(a := v))

goal (1 subgoal):
 1. flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))
[PROOF STEP]
by (simp add: l Suc del: fun_upd_apply o_apply)
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
flush (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) ((flush_all_until_volatile_write (l # ts) m)(a := v)) = flush_all_until_volatile_write ((l # ts)[i := (p, is, xs, sb, \<D>', \<O>', \<R>')]) (m(a := v))

goal:
No subgoals!
[PROOF STEP]
qed