[STATEMENT]
lemma share_all_until_volatile_write_flush_commute:
assumes takeWhile_empty: "(takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) = []"
shows "\<And> \<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts;
        ts!i = (p,is,\<theta>,sb,\<D>,\<O>,\<R>);
        \<forall>i p is \<O> \<R> \<D> \<theta> (sb::'a memref list). i < length ts
            \<longrightarrow> ts!i=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
                    (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union>
                     all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union>
                     all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter>
                    (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union>
                     all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union>
                     all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {};
        \<forall>j p is \<O> \<R> \<D> \<theta> (sb::'a memref list). j < length ts \<longrightarrow> i\<noteq>j
            \<longrightarrow> ts!j=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
                    (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter>
                    (R \<union> L \<union> A) = {}\<rbrakk>
 \<Longrightarrow>
share_all_until_volatile_write (ts[i :=(p',is',\<theta>',sb',\<D>',\<O>',\<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) =
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
proof (induct ts)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<S> R L W A i. \<lbrakk>ownership_distinct []; sharing_consis \<S> []; i < length []; [] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length [] \<longrightarrow> [] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length [] \<longrightarrow> i \<noteq> j \<longrightarrow> [] ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ([][i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write [] \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
ownership_distinct []
sharing_consis \<S> []
i < length []
[] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length [] \<longrightarrow> [] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length [] \<longrightarrow> i \<noteq> j \<longrightarrow> [] ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}

goal (2 subgoals):
 1. \<And>\<S> R L W A i. \<lbrakk>ownership_distinct []; sharing_consis \<S> []; i < length []; [] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length [] \<longrightarrow> [] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length [] \<longrightarrow> i \<noteq> j \<longrightarrow> [] ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ([][i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write [] \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
ownership_distinct []
sharing_consis \<S> []
i < length []
[] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length [] \<longrightarrow> [] ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length [] \<longrightarrow> i \<noteq> j \<longrightarrow> [] ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. share_all_until_volatile_write ([][i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write [] \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ([][i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write [] \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
case (Cons t ts)
[PROOF STATE]
proof (state)
this:
\<lbrakk>ownership_distinct ts; sharing_consis ?\<S> ts; ?i < length ts; ts ! ?i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> ?i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (?R \<union> ?L \<union> ?A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[?i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (?\<S> \<oplus>\<^bsub>?W\<^esub> ?R \<ominus>\<^bsub>?A\<^esub> ?L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts ?\<S> \<oplus>\<^bsub>?W\<^esub> ?R \<ominus>\<^bsub>?A\<^esub> ?L)
ownership_distinct (t # ts)
sharing_consis \<S> (t # ts)
i < length (t # ts)
(t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
obtain p\<^sub>t "is\<^sub>t" \<O>\<^sub>t \<R>\<^sub>t \<D>\<^sub>t \<theta>\<^sub>t sb\<^sub>t where
    t: "t=(p\<^sub>t,is\<^sub>t,\<theta>\<^sub>t,sb\<^sub>t,\<D>\<^sub>t,\<O>\<^sub>t,\<R>\<^sub>t)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>p\<^sub>t is\<^sub>t \<theta>\<^sub>t sb\<^sub>t \<D>\<^sub>t \<O>\<^sub>t \<R>\<^sub>t. t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t) \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by (cases t)
[PROOF STATE]
proof (state)
this:
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
let ?take = "(takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
let ?take_sb' = "(takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
let ?drop = "(dropWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have dist: "ownership_distinct (t#ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ownership_distinct (t # ts)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
ownership_distinct (t # ts)

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
ownership_distinct (t # ts)
[PROOF STEP]
interpret ownership_distinct "t#ts"
[PROOF STATE]
proof (prove)
using this:
ownership_distinct (t # ts)

goal (1 subgoal):
 1. ownership_distinct (t # ts)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have consis: "sharing_consis \<S> (t#ts)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. sharing_consis \<S> (t # ts)
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
sharing_consis \<S> (t # ts)

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sharing_consis \<S> (t # ts)
[PROOF STEP]
interpret sharing_consis \<S> "t#ts"
[PROOF STATE]
proof (prove)
using this:
sharing_consis \<S> (t # ts)

goal (1 subgoal):
 1. sharing_consis \<S> (t # ts)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have dist_prop: "\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t#ts)
            \<longrightarrow> (t#ts)!i=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
                    (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union>
                     all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union>
                     all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter>
                    (all_shared ?take_sb' \<union> all_unshared ?take_sb' \<union> all_acquired ?take_sb') = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from dist_prop [rule_format, of 0] t
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < length (t # ts); (t # ts) ! 0 = (?p, ?is, ?\<theta>, ?sb, ?\<D>, ?\<O>, ?\<R>)\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) ?sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) ?sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) ?sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)
[PROOF STEP]
have dist_t: "(all_shared ?take \<union> all_unshared ?take \<union> all_acquired ?take) \<inter>
         (all_shared ?take_sb' \<union> all_unshared ?take_sb' \<union> all_acquired ?take_sb') = {}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (t # ts); (t # ts) ! 0 = (?p, ?is, ?\<theta>, ?sb, ?\<D>, ?\<O>, ?\<R>)\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) ?sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) ?sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) ?sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)

goal (1 subgoal):
 1. (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from dist_prop
[PROOF STATE]
proof (chain)
picking this:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
[PROOF STEP]
have
  dist_prop':"\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts
            \<longrightarrow> ts!i=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
                    (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union>
                     all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union>
                     all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter>
                    (all_shared ?take_sb' \<union> all_unshared ?take_sb' \<union> all_acquired ?take_sb') = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}

goal (1 subgoal):
 1. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
[PROOF STEP]
apply (clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i p is \<O> \<R> \<D> \<theta> sb. \<lbrakk>\<forall>i<Suc (length ts). \<forall>p is \<O> \<R> \<D> \<theta> sb. (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
[PROOF STEP]
subgoal for i p "is" \<O> \<R> \<D> \<theta> sb
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<Suc (length ts). \<forall>p is \<O> \<R> \<D> \<theta> sb. (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
[PROOF STEP]
apply (drule_tac x="Suc i" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); Suc i < Suc (length ts) \<longrightarrow> (\<forall>p is \<O> \<R> \<D> \<theta> sb. (t # ts) ! Suc i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {})\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
[PROOF STEP]
apply clarsimp
[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:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have dist_prop_R_L_A: "\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t#ts) \<longrightarrow> i \<noteq> j
            \<longrightarrow> (t#ts)!j=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
                    (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter>
                    (R \<union> L \<union> A) = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
by fact
[PROOF STATE]
proof (state)
this:
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from ownership_distinct_tl [OF dist]
[PROOF STATE]
proof (chain)
picking this:
ownership_distinct ts
[PROOF STEP]
have dist': "ownership_distinct ts"
[PROOF STATE]
proof (prove)
using this:
ownership_distinct ts

goal (1 subgoal):
 1. ownership_distinct ts
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
ownership_distinct ts

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from sharing_consis_tl [OF consis]
[PROOF STATE]
proof (chain)
picking this:
sharing_consis \<S> ts
[PROOF STEP]
have consis': "sharing_consis \<S> ts"
[PROOF STATE]
proof (prove)
using this:
sharing_consis \<S> ts

goal (1 subgoal):
 1. sharing_consis \<S> ts
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sharing_consis \<S> ts

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
sharing_consis \<S> ts
[PROOF STEP]
interpret consis': sharing_consis \<S> "ts"
[PROOF STATE]
proof (prove)
using this:
sharing_consis \<S> ts

goal (1 subgoal):
 1. sharing_consis \<S> ts
[PROOF STEP]
.
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from sharing_consis [of 0, simplified, OF t]
[PROOF STATE]
proof (chain)
picking this:
sharing_consistent \<S> \<O>\<^sub>t sb\<^sub>t
[PROOF STEP]
have "sharing_consistent \<S> \<O>\<^sub>t sb\<^sub>t"
[PROOF STATE]
proof (prove)
using this:
sharing_consistent \<S> \<O>\<^sub>t sb\<^sub>t

goal (1 subgoal):
 1. sharing_consistent \<S> \<O>\<^sub>t sb\<^sub>t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sharing_consistent \<S> \<O>\<^sub>t sb\<^sub>t

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from sharing_consistent_takeWhile [OF this]
[PROOF STATE]
proof (chain)
picking this:
sharing_consistent \<S> \<O>\<^sub>t (takeWhile ?P sb\<^sub>t)
[PROOF STEP]
have consis_sb: "sharing_consistent \<S> \<O>\<^sub>t (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)"
[PROOF STATE]
proof (prove)
using this:
sharing_consistent \<S> \<O>\<^sub>t (takeWhile ?P sb\<^sub>t)

goal (1 subgoal):
 1. sharing_consistent \<S> \<O>\<^sub>t (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sharing_consistent \<S> \<O>\<^sub>t (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have aargh: "(Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) = (\<lambda>a. \<not> is_volatile_Write\<^sub>s\<^sub>b a)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Not \<circ> is_volatile_Write\<^sub>s\<^sub>b = (\<lambda>a. \<not> is_volatile_Write\<^sub>s\<^sub>b a)
[PROOF STEP]
by (rule ext) auto
[PROOF STATE]
proof (state)
this:
Not \<circ> is_volatile_Write\<^sub>s\<^sub>b = (\<lambda>a. \<not> is_volatile_Write\<^sub>s\<^sub>b a)

goal (1 subgoal):
 1. \<And>a ts \<S> R L W A i. \<lbrakk>\<And>\<S> R L W A i. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> i \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (ts[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); i < length (a # ts); (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (a # ts) \<longrightarrow> (a # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}; \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (a # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (a # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ((a # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (a # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
proof (cases i)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
case 0
[PROOF STATE]
proof (state)
this:
i = 0

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
with t Cons.prems
[PROOF STATE]
proof (chain)
picking this:
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)
ownership_distinct (t # ts)
sharing_consis \<S> (t # ts)
i < length (t # ts)
(t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = 0
[PROOF STEP]
have eqs: "p\<^sub>t=p" "is\<^sub>t=is" "\<O>\<^sub>t=\<O>" "\<R>\<^sub>t=\<R>" "\<theta>\<^sub>t=\<theta>" "sb\<^sub>t=sb" "\<D>\<^sub>t=\<D>"
[PROOF STATE]
proof (prove)
using this:
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)
ownership_distinct (t # ts)
sharing_consis \<S> (t # ts)
i < length (t # ts)
(t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = 0

goal (1 subgoal):
 1. (p\<^sub>t = p &&& is\<^sub>t = is &&& \<O>\<^sub>t = \<O>) &&& (\<R>\<^sub>t = \<R> &&& \<theta>\<^sub>t = \<theta>) &&& sb\<^sub>t = sb &&& \<D>\<^sub>t = \<D>
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
p\<^sub>t = p
is\<^sub>t = is
\<O>\<^sub>t = \<O>
\<R>\<^sub>t = \<R>
\<theta>\<^sub>t = \<theta>
sb\<^sub>t = sb
\<D>\<^sub>t = \<D>

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
let ?\<S>' = "\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L"
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from dist_prop_R_L_A 0
[PROOF STATE]
proof (chain)
picking this:
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = 0
[PROOF STEP]
have
      dist_prop_R_L_A':"\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts
            \<longrightarrow> ts!i=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
                    (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter>
                    (R \<union> L \<union> A) = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = 0

goal (1 subgoal):
 1. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ia p is \<O> \<R> \<D> \<theta> sb. \<lbrakk>\<forall>j<Suc (length ts). 0 < j \<longrightarrow> (\<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! (j - Suc 0) = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}); i = 0; ia < length ts; ts ! ia = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
subgoal for i1 p "is" \<O> \<R> \<D> \<theta> sb
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j<Suc (length ts). 0 < j \<longrightarrow> (\<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! (j - Suc 0) = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}); i = 0; i1 < length ts; ts ! i1 = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (drule_tac x="Suc i1" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = 0; i1 < length ts; ts ! i1 = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); Suc i1 < Suc (length ts) \<longrightarrow> 0 < Suc i1 \<longrightarrow> (\<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! (Suc i1 - Suc 0) = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {})\<rbrakk> \<Longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply clarsimp
[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:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
have dist_prop_R_L_A'':"\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts
        \<longrightarrow> ts!i=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
      (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union>
      all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter>
      (R \<union> L \<union> A) = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i p is \<O> \<R> \<D> \<theta> sb. \<lbrakk>\<forall>i<length ts. \<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
subgoal for i p "is" \<O> \<R> \<D> \<theta> sb
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<length ts. \<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (cut_tac sb=sb in all_shared_takeWhile_subset [where P="Not \<circ> is_volatile_Write\<^sub>s\<^sub>b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<length ts. \<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<subseteq> all_shared sb\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (cut_tac sb=sb in all_unshared_takeWhile_subset [where P="Not \<circ> is_volatile_Write\<^sub>s\<^sub>b"])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<length ts. \<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<subseteq> all_shared sb; all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<subseteq> all_unshared sb\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (cut_tac sb=sb in all_acquired_takeWhile_subset [where P="Not \<circ> is_volatile_Write\<^sub>s\<^sub>b" ])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>i<length ts. \<forall>p is \<O> \<R> \<D> \<theta> sb. ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}; i < length ts; ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<subseteq> all_shared sb; all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<subseteq> all_unshared sb; all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<subseteq> all_acquired sb\<rbrakk> \<Longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply fastforce
[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:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have  sep: "\<forall>i<length ts.
      let (_, _, _, sb, _, _, _) = ts ! i
      in \<forall>a\<in>all_acquired sb. ?\<S>' a = \<S> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
fix i p\<^sub>i "is\<^sub>i" \<O>\<^sub>i \<R>\<^sub>i \<D>\<^sub>i acq\<^sub>i \<theta>\<^sub>i sb\<^sub>i a
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
assume i_bound: "i < length ts"
[PROOF STATE]
proof (state)
this:
i < length ts

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
assume ts_i: "ts ! i = (p\<^sub>i,is\<^sub>i,\<theta>\<^sub>i,sb\<^sub>i,\<D>\<^sub>i,\<O>\<^sub>i,\<R>\<^sub>i)"
[PROOF STATE]
proof (state)
this:
ts ! i = (p\<^sub>i, is\<^sub>i, \<theta>\<^sub>i, sb\<^sub>i, \<D>\<^sub>i, \<O>\<^sub>i, \<R>\<^sub>i)

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
assume a_in: "a \<in> all_acquired sb\<^sub>i"
[PROOF STATE]
proof (state)
this:
a \<in> all_acquired sb\<^sub>i

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
have "?\<S>' a = \<S> a"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
from dist_prop_R_L_A' [rule_format, OF i_bound ts_i] a_in
[PROOF STATE]
proof (chain)
picking this:
(all_shared sb\<^sub>i \<union> all_unshared sb\<^sub>i \<union> all_acquired sb\<^sub>i) \<inter> (R \<union> L \<union> A) = {}
a \<in> all_acquired sb\<^sub>i
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
(all_shared sb\<^sub>i \<union> all_unshared sb\<^sub>i \<union> all_acquired sb\<^sub>i) \<inter> (R \<union> L \<union> A) = {}
a \<in> all_acquired sb\<^sub>i

goal (1 subgoal):
 1. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
by (auto simp add: augment_shared_def restrict_shared_def split: option.splits)
[PROOF STATE]
proof (state)
this:
(\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
(\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?ia3 < length ts; ts ! ?ia3 = (?p\<^sub>i3, ?is\<^sub>i3, ?\<theta>\<^sub>i3, ?sb\<^sub>i3, ?\<D>\<^sub>i3, ?\<O>\<^sub>i3, ?\<R>\<^sub>i3); ?a3 \<in> all_acquired ?sb\<^sub>i3\<rbrakk> \<Longrightarrow> (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) ?a3 = \<S> ?a3

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?ia3 < length ts; ts ! ?ia3 = (?p\<^sub>i3, ?is\<^sub>i3, ?\<theta>\<^sub>i3, ?sb\<^sub>i3, ?\<D>\<^sub>i3, ?\<O>\<^sub>i3, ?\<R>\<^sub>i3); ?a3 \<in> all_acquired ?sb\<^sub>i3\<rbrakk> \<Longrightarrow> (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) ?a3 = \<S> ?a3

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<length ts. let (uu_, uu_, uu_, sb, uu_, uu_, uu_) = ts ! i in \<forall>a\<in>all_acquired sb. (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) a = \<S> a

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from consis'.sharing_consis_shared_exchange [OF sep]
[PROOF STATE]
proof (chain)
picking this:
sharing_consis (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) ts
[PROOF STEP]
have sharing_consis': "sharing_consis ?\<S>' ts"
[PROOF STATE]
proof (prove)
using this:
sharing_consis (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) ts

goal (1 subgoal):
 1. sharing_consis (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) ts
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sharing_consis (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) ts

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from share_all_until_volatile_write_share_commute [of ts "(\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)" "(takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')", OF dist' sharing_consis' dist_prop']
[PROOF STATE]
proof (chain)
picking this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))
[PROOF STEP]
have "share_all_until_volatile_write ts (share ?take_sb' ?\<S>') =
          share ?take_sb' (share_all_until_volatile_write ts ?\<S>')"
[PROOF STATE]
proof (prove)
using this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))

goal (1 subgoal):
 1. share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from dist_prop_R_L_A''
[PROOF STATE]
proof (chain)
picking this:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
have "(share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) =
          (share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L
[PROOF STEP]
apply -
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {} \<Longrightarrow> share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L
[PROOF STEP]
apply (rule  share_all_until_volatile_write_commute [OF dist' consis', of L A R W,symmetric])
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {} \<Longrightarrow> \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<inter> L = {}
 2. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {} \<Longrightarrow> \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<inter> A = {}
 3. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {} \<Longrightarrow> \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<inter> R = {}
 4. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {} \<Longrightarrow> \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<inter> R = {}
 5. \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (R \<union> L \<union> A) = {} \<Longrightarrow> \<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length ts \<longrightarrow> ts ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<inter> R = {}
[PROOF STEP]
apply (clarsimp,blast)+
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L

goal (2 subgoals):
 1. i = 0 \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
 2. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))
share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))
share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L

goal (1 subgoal):
 1. share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
using takeWhile_empty
[PROOF STATE]
proof (prove)
using this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L))
share_all_until_volatile_write ts (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share_all_until_volatile_write ts \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L
takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb = []

goal (1 subgoal):
 1. share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
by (clarsimp simp add: t 0  aargh eqs)
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
case (Suc k)
[PROOF STATE]
proof (state)
this:
i = Suc k

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from Cons.prems Suc
[PROOF STATE]
proof (chain)
picking this:
ownership_distinct (t # ts)
sharing_consis \<S> (t # ts)
i < length (t # ts)
(t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = Suc k
[PROOF STEP]
obtain k_bound: "k < length ts" and ts_k: "ts!k =  (p, is,\<theta>, sb, \<D>, \<O>,\<R>)"
[PROOF STATE]
proof (prove)
using this:
ownership_distinct (t # ts)
sharing_consis \<S> (t # ts)
i < length (t # ts)
(t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)
\<forall>i p is \<O> \<R> \<D> \<theta> sb. i < length (t # ts) \<longrightarrow> (t # ts) ! i = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb)) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb')) = {}
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = Suc k

goal (1 subgoal):
 1. (\<lbrakk>k < length ts; ts ! k = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
k < length ts
ts ! k = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
let ?\<S>' = "(share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from freshly_shared_owned [OF consis_sb]
[PROOF STATE]
proof (chain)
picking this:
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t
[PROOF STEP]
have fresh_owned: "dom ?\<S>' - dom \<S> \<subseteq> \<O>\<^sub>t"
[PROOF STATE]
proof (prove)
using this:
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t

goal (1 subgoal):
 1. dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from unshared_all_unshared [OF consis_sb] unshared_acquired_or_owned [OF consis_sb]
[PROOF STATE]
proof (chain)
picking this:
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)
all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t
[PROOF STEP]
have unshared_acq_owned: "dom \<S> - dom ?\<S>'
                 \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t"
[PROOF STATE]
proof (prove)
using this:
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)
all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t

goal (1 subgoal):
 1. dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from freshly_shared_owned [OF consis_sb]
[PROOF STATE]
proof (chain)
picking this:
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t
[PROOF STEP]
have fresh_owned: "dom ?\<S>' - dom \<S> \<subseteq> \<O>\<^sub>t"
[PROOF STATE]
proof (prove)
using this:
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t

goal (1 subgoal):
 1. dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from unshared_all_unshared [OF consis_sb] unshared_acquired_or_owned [OF consis_sb]
[PROOF STATE]
proof (chain)
picking this:
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)
all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t
[PROOF STEP]
have unshared_acq_owned: "dom \<S> - dom ?\<S>'
                 \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t"
[PROOF STATE]
proof (prove)
using this:
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)
all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t

goal (1 subgoal):
 1. dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have sep:
      "\<forall>i < length ts. let (_,_,_,sb',_,_,_) = ts!i in
          all_acquired sb' \<inter> dom \<S> - dom ?\<S>' = {} \<and>
          all_unshared sb' \<inter> dom ?\<S>' - dom \<S> = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
{
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
fix i p\<^sub>i "is\<^sub>i" \<O>\<^sub>i \<R>\<^sub>i \<D>\<^sub>i acq\<^sub>i \<theta>\<^sub>i sb\<^sub>i
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
assume i_bound: "i < length ts"
[PROOF STATE]
proof (state)
this:
i < length ts

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
assume ts_i: "ts ! i = (p\<^sub>i,is\<^sub>i,\<theta>\<^sub>i,sb\<^sub>i,\<D>\<^sub>i,\<O>\<^sub>i,\<R>\<^sub>i)"
[PROOF STATE]
proof (state)
this:
ts ! i = (p\<^sub>i, is\<^sub>i, \<theta>\<^sub>i, sb\<^sub>i, \<D>\<^sub>i, \<O>\<^sub>i, \<R>\<^sub>i)

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
have "all_acquired sb\<^sub>i \<inter> dom \<S> - dom ?\<S>' = {} \<and>
              all_unshared sb\<^sub>i \<inter> dom ?\<S>' - dom \<S> = {}"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
from ownership_distinct [of "0" "Suc i"] ts_i t i_bound
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < length (t # ts); Suc i < length (t # ts); 0 \<noteq> Suc i; (t # ts) ! 0 = (?p\<^sub>i, ?is\<^sub>i, ?\<theta>\<^sub>i, ?sb\<^sub>i, ?\<D>\<^sub>i, ?\<O>\<^sub>i, ?\<R>\<^sub>i); (t # ts) ! Suc i = (?p\<^sub>j, ?is\<^sub>j, ?\<theta>\<^sub>j, ?sb\<^sub>j, ?\<D>\<^sub>j, ?\<O>\<^sub>j, ?\<R>\<^sub>j)\<rbrakk> \<Longrightarrow> (?\<O>\<^sub>i \<union> all_acquired ?sb\<^sub>i) \<inter> (?\<O>\<^sub>j \<union> all_acquired ?sb\<^sub>j) = {}
ts ! i = (p\<^sub>i, is\<^sub>i, \<theta>\<^sub>i, sb\<^sub>i, \<D>\<^sub>i, \<O>\<^sub>i, \<R>\<^sub>i)
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)
i < length ts
[PROOF STEP]
have dist: "(\<O>\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (\<O>\<^sub>i \<union> all_acquired sb\<^sub>i) = {}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (t # ts); Suc i < length (t # ts); 0 \<noteq> Suc i; (t # ts) ! 0 = (?p\<^sub>i, ?is\<^sub>i, ?\<theta>\<^sub>i, ?sb\<^sub>i, ?\<D>\<^sub>i, ?\<O>\<^sub>i, ?\<R>\<^sub>i); (t # ts) ! Suc i = (?p\<^sub>j, ?is\<^sub>j, ?\<theta>\<^sub>j, ?sb\<^sub>j, ?\<D>\<^sub>j, ?\<O>\<^sub>j, ?\<R>\<^sub>j)\<rbrakk> \<Longrightarrow> (?\<O>\<^sub>i \<union> all_acquired ?sb\<^sub>i) \<inter> (?\<O>\<^sub>j \<union> all_acquired ?sb\<^sub>j) = {}
ts ! i = (p\<^sub>i, is\<^sub>i, \<theta>\<^sub>i, sb\<^sub>i, \<D>\<^sub>i, \<O>\<^sub>i, \<R>\<^sub>i)
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)
i < length ts

goal (1 subgoal):
 1. (\<O>\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (\<O>\<^sub>i \<union> all_acquired sb\<^sub>i) = {}
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
(\<O>\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (\<O>\<^sub>i \<union> all_acquired sb\<^sub>i) = {}

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
from dist unshared_acq_owned all_acquired_takeWhile [of "(Not \<circ> is_volatile_Write\<^sub>s\<^sub>b)" sb\<^sub>t]
[PROOF STATE]
proof (chain)
picking this:
(\<O>\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (\<O>\<^sub>i \<union> all_acquired sb\<^sub>i) = {}
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t
all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<subseteq> all_acquired sb\<^sub>t
[PROOF STEP]
have "all_acquired sb\<^sub>i \<inter> dom \<S> - dom ?\<S>' = {}"
[PROOF STATE]
proof (prove)
using this:
(\<O>\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (\<O>\<^sub>i \<union> all_acquired sb\<^sub>i) = {}
dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<subseteq> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> \<O>\<^sub>t
all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<subseteq> all_acquired sb\<^sub>t

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {}

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {}

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
from sharing_consis [of "Suc i"] ts_i i_bound
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>Suc i < length (t # ts); (t # ts) ! Suc i = (?p, ?is, ?\<theta>, ?sb, ?\<D>, ?\<O>, ?\<R>)\<rbrakk> \<Longrightarrow> sharing_consistent \<S> ?\<O> ?sb
ts ! i = (p\<^sub>i, is\<^sub>i, \<theta>\<^sub>i, sb\<^sub>i, \<D>\<^sub>i, \<O>\<^sub>i, \<R>\<^sub>i)
i < length ts
[PROOF STEP]
have "sharing_consistent \<S> \<O>\<^sub>i sb\<^sub>i"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>Suc i < length (t # ts); (t # ts) ! Suc i = (?p, ?is, ?\<theta>, ?sb, ?\<D>, ?\<O>, ?\<R>)\<rbrakk> \<Longrightarrow> sharing_consistent \<S> ?\<O> ?sb
ts ! i = (p\<^sub>i, is\<^sub>i, \<theta>\<^sub>i, sb\<^sub>i, \<D>\<^sub>i, \<O>\<^sub>i, \<R>\<^sub>i)
i < length ts

goal (1 subgoal):
 1. sharing_consistent \<S> \<O>\<^sub>i sb\<^sub>i
[PROOF STEP]
by force
[PROOF STATE]
proof (state)
this:
sharing_consistent \<S> \<O>\<^sub>i sb\<^sub>i

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
from unshared_acquired_or_owned [OF this]
[PROOF STATE]
proof (chain)
picking this:
all_unshared sb\<^sub>i \<subseteq> all_acquired sb\<^sub>i \<union> \<O>\<^sub>i
[PROOF STEP]
have "all_unshared sb\<^sub>i \<subseteq> all_acquired sb\<^sub>i \<union> \<O>\<^sub>i"
[PROOF STATE]
proof (prove)
using this:
all_unshared sb\<^sub>i \<subseteq> all_acquired sb\<^sub>i \<union> \<O>\<^sub>i

goal (1 subgoal):
 1. all_unshared sb\<^sub>i \<subseteq> all_acquired sb\<^sub>i \<union> \<O>\<^sub>i
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
all_unshared sb\<^sub>i \<subseteq> all_acquired sb\<^sub>i \<union> \<O>\<^sub>i

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
with dist fresh_owned
[PROOF STATE]
proof (chain)
picking this:
(\<O>\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (\<O>\<^sub>i \<union> all_acquired sb\<^sub>i) = {}
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t
all_unshared sb\<^sub>i \<subseteq> all_acquired sb\<^sub>i \<union> \<O>\<^sub>i
[PROOF STEP]
have "all_unshared sb\<^sub>i \<inter> dom ?\<S>' - dom \<S> = {}"
[PROOF STATE]
proof (prove)
using this:
(\<O>\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (\<O>\<^sub>i \<union> all_acquired sb\<^sub>i) = {}
dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> \<subseteq> \<O>\<^sub>t
all_unshared sb\<^sub>i \<subseteq> all_acquired sb\<^sub>i \<union> \<O>\<^sub>i

goal (1 subgoal):
 1. all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {}
all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {}
all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal (1 subgoal):
 1. all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
all_acquired sb\<^sub>i \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb\<^sub>i \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?ia3 < length ts; ts ! ?ia3 = (?p\<^sub>i3, ?is\<^sub>i3, ?\<theta>\<^sub>i3, ?sb\<^sub>i3, ?\<D>\<^sub>i3, ?\<O>\<^sub>i3, ?\<R>\<^sub>i3)\<rbrakk> \<Longrightarrow> all_acquired ?sb\<^sub>i3 \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared ?sb\<^sub>i3 \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
thus ?thesis
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>?ia3 < length ts; ts ! ?ia3 = (?p\<^sub>i3, ?is\<^sub>i3, ?\<theta>\<^sub>i3, ?sb\<^sub>i3, ?\<D>\<^sub>i3, ?\<O>\<^sub>i3, ?\<R>\<^sub>i3)\<rbrakk> \<Longrightarrow> all_acquired ?sb\<^sub>i3 \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared ?sb\<^sub>i3 \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal (1 subgoal):
 1. \<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}
[PROOF STEP]
by (fastforce simp add: Let_def)
[PROOF STATE]
proof (state)
this:
\<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<forall>i<length ts. let (uu_, uu_, uu_, sb', uu_, uu_, uu_) = ts ! i in all_acquired sb' \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared sb' \<inter> dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) - dom \<S> = {}

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from consis'.sharing_consis_preservation [OF sep]
[PROOF STATE]
proof (chain)
picking this:
sharing_consis (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) ts
[PROOF STEP]
have sharing_consis': "sharing_consis ?\<S>' ts"
[PROOF STATE]
proof (prove)
using this:
sharing_consis (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) ts

goal (1 subgoal):
 1. sharing_consis (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) ts
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
sharing_consis (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) ts

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from dist_prop_R_L_A [rule_format, of 0] Suc t
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>0 < length (t # ts); i \<noteq> 0; (t # ts) ! 0 = (?p, ?is, ?\<theta>, ?sb, ?\<D>, ?\<O>, ?\<R>)\<rbrakk> \<Longrightarrow> (all_shared ?sb \<union> all_unshared ?sb \<union> all_acquired ?sb) \<inter> (R \<union> L \<union> A) = {}
i = Suc k
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)
[PROOF STEP]
have dist_t_R_L_A: "(all_shared sb\<^sub>t \<union> all_unshared sb\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter>
         (R \<union> L \<union> A) = {}"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>0 < length (t # ts); i \<noteq> 0; (t # ts) ! 0 = (?p, ?is, ?\<theta>, ?sb, ?\<D>, ?\<O>, ?\<R>)\<rbrakk> \<Longrightarrow> (all_shared ?sb \<union> all_unshared ?sb \<union> all_acquired ?sb) \<inter> (R \<union> L \<union> A) = {}
i = Suc k
t = (p\<^sub>t, is\<^sub>t, \<theta>\<^sub>t, sb\<^sub>t, \<D>\<^sub>t, \<O>\<^sub>t, \<R>\<^sub>t)

goal (1 subgoal):
 1. (all_shared sb\<^sub>t \<union> all_unshared sb\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(all_shared sb\<^sub>t \<union> all_unshared sb\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from dist_t_R_L_A
[PROOF STATE]
proof (chain)
picking this:
(all_shared sb\<^sub>t \<union> all_unshared sb\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
have "(R \<union> L \<union> A) \<inter> (all_shared ?take \<union> all_unshared ?take \<union> all_acquired ?take) = {}"
[PROOF STATE]
proof (prove)
using this:
(all_shared sb\<^sub>t \<union> all_unshared sb\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. (R \<union> L \<union> A) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)) = {}
[PROOF STEP]
using all_shared_append [of ?take ?drop] all_unshared_append [of ?take ?drop] all_acquired_append [of ?take ?drop]
[PROOF STATE]
proof (prove)
using this:
(all_shared sb\<^sub>t \<union> all_unshared sb\<^sub>t \<union> all_acquired sb\<^sub>t) \<inter> (R \<union> L \<union> A) = {}
all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t @ dropWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) = all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_shared (dropWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)
all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t @ dropWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) = all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_unshared (dropWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)
all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t @ dropWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) = all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_acquired (dropWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)

goal (1 subgoal):
 1. (R \<union> L \<union> A) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)) = {}
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
(R \<union> L \<union> A) \<inter> (all_shared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_unshared (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<union> all_acquired (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t)) = {}

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from share_augment_release_commute [OF this]
[PROOF STATE]
proof (chain)
picking this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) ?\<S> \<oplus>\<^bsub>?W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (?\<S> \<oplus>\<^bsub>?W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
have "share ?take \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share ?take (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)"
[PROOF STATE]
proof (prove)
using this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) ?\<S> \<oplus>\<^bsub>?W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (?\<S> \<oplus>\<^bsub>?W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal (1 subgoal):
 1. share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
.
[PROOF STATE]
proof (state)
this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
from dist_prop_R_L_A Suc
[PROOF STATE]
proof (chain)
picking this:
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = Suc k
[PROOF STEP]
have "\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (ts) \<longrightarrow> k \<noteq> j
      \<longrightarrow> (ts)!j=(p,is,\<theta>,sb,\<D>,\<O>,\<R>) \<longrightarrow>
                    (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter>
                    (R \<union> L \<union> A) = {}"
[PROOF STATE]
proof (prove)
using this:
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length (t # ts) \<longrightarrow> i \<noteq> j \<longrightarrow> (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
i = Suc k

goal (1 subgoal):
 1. \<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> k \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (clarsimp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>j p is \<O> \<R> \<D> \<theta> sb. \<lbrakk>\<forall>j<Suc (length ts). Suc k \<noteq> j \<longrightarrow> (\<forall>p is \<O> \<R> \<D> \<theta> sb. (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}); i = Suc k; j < length ts; k \<noteq> j; ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
subgoal for j p "is" \<O> \<R> \<D> \<theta> sb
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<forall>j<Suc (length ts). Suc k \<noteq> j \<longrightarrow> (\<forall>p is \<O> \<R> \<D> \<theta> sb. (t # ts) ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}); i = Suc k; j < length ts; k \<noteq> j; ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>)\<rbrakk> \<Longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply (drule_tac x="Suc j" in spec)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>i = Suc k; j < length ts; k \<noteq> j; ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>); Suc j < Suc (length ts) \<longrightarrow> Suc k \<noteq> Suc j \<longrightarrow> (\<forall>p is \<O> \<R> \<D> \<theta> sb. (t # ts) ! Suc j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {})\<rbrakk> \<Longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}
[PROOF STEP]
apply clarsimp
[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:
\<forall>j p is \<O> \<R> \<D> \<theta> sb. j < length ts \<longrightarrow> k \<noteq> j \<longrightarrow> ts ! j = (p, is, \<theta>, sb, \<D>, \<O>, \<R>) \<longrightarrow> (all_shared sb \<union> all_unshared sb \<union> all_acquired sb) \<inter> (R \<union> L \<union> A) = {}

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
note Cons.hyps [OF dist' sharing_consis' k_bound ts_k dist_prop' this, of W]
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write (ts[k := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal (1 subgoal):
 1. \<And>nat. i = Suc nat \<Longrightarrow> share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
share_all_until_volatile_write (ts[k := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
share_all_until_volatile_write (ts[k := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal (1 subgoal):
 1. share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)
[PROOF STEP]
by (clarsimp simp add: t Suc )
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ((t # ts)[i := (p', is', \<theta>', sb', \<D>', \<O>', \<R>')]) (\<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L) = share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb') (share_all_until_volatile_write (t # ts) \<S> \<oplus>\<^bsub>W\<^esub> R \<ominus>\<^bsub>A\<^esub> L)

goal:
No subgoals!
[PROOF STEP]
qed