[STATEMENT]
lemma share_all_until_volatile_write_share_commute:
shows "\<And> \<S> (sb'::'a memref list). \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts;
        \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk>
 \<Longrightarrow>
share_all_until_volatile_write ts (share sb' \<S>) =
share sb' (share_all_until_volatile_write ts \<S>)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>)
[PROOF STEP]
proof (induct ts)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>\<S> sb'. \<lbrakk>ownership_distinct []; sharing_consis \<S> []; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write [] (share sb' \<S>) = share sb' (share_all_until_volatile_write [] \<S>)
 2. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[PROOF STEP]
case Nil
[PROOF STATE]
proof (state)
this:
ownership_distinct []
sharing_consis \<S> []
\<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}

goal (2 subgoals):
 1. \<And>\<S> sb'. \<lbrakk>ownership_distinct []; sharing_consis \<S> []; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write [] (share sb' \<S>) = share sb' (share_all_until_volatile_write [] \<S>)
 2. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
ownership_distinct []
sharing_consis \<S> []
\<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}

goal (1 subgoal):
 1. share_all_until_volatile_write [] (share sb' \<S>) = share sb' (share_all_until_volatile_write [] \<S>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write [] (share sb' \<S>) = share sb' (share_all_until_volatile_write [] \<S>)

goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[PROOF STEP]
case (Cons t ts)
[PROOF STATE]
proof (state)
this:
\<lbrakk>ownership_distinct ts; sharing_consis ?\<S> ts; \<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 ?sb' \<union> all_unshared ?sb' \<union> all_acquired ?sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share ?sb' ?\<S>) = share ?sb' (share_all_until_volatile_write ts ?\<S>)
ownership_distinct (t # ts)
sharing_consis \<S> (t # ts)
\<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}

goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}

goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}

goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> 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> (all_shared sb' \<union> all_unshared sb' \<union> all_acquired 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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}

goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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 ?take"
[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> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[PROOF STEP]
let ?\<S>' = "(share ?take \<S>)"
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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>?i2 < length ts; ts ! ?i2 = (?p\<^sub>i2, ?is\<^sub>i2, ?\<theta>\<^sub>i2, ?sb\<^sub>i2, ?\<D>\<^sub>i2, ?\<O>\<^sub>i2, ?\<R>\<^sub>i2)\<rbrakk> \<Longrightarrow> all_acquired ?sb\<^sub>i2 \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared ?sb\<^sub>i2 \<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>?i2 < length ts; ts ! ?i2 = (?p\<^sub>i2, ?is\<^sub>i2, ?\<theta>\<^sub>i2, ?sb\<^sub>i2, ?\<D>\<^sub>i2, ?\<O>\<^sub>i2, ?\<R>\<^sub>i2)\<rbrakk> \<Longrightarrow> all_acquired ?sb\<^sub>i2 \<inter> dom \<S> - dom (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>) = {} \<and> all_unshared ?sb\<^sub>i2 \<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>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[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>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[PROOF STEP]
have "share_all_until_volatile_write ts (share ?take (share sb' \<S>)) =
        share sb' (share_all_until_volatile_write ts (share ?take \<S>))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[PROOF STEP]
proof -
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[PROOF STEP]
from share_append_commute [OF dist_t]
[PROOF STATE]
proof (chain)
picking this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' ?\<S>) = share sb' (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) ?\<S>)
[PROOF STEP]
have "(share ?take (share sb' \<S>)) = (share sb' (share ?take \<S>))"
[PROOF STATE]
proof (prove)
using this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' ?\<S>) = share sb' (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) ?\<S>)

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

goal (1 subgoal):
 1. share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>) = share sb' (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>)
[PROOF STEP]
have "share_all_until_volatile_write ts (share ?take (share sb' \<S>)) =
          share_all_until_volatile_write ts (share sb' (share ?take \<S>))"
[PROOF STATE]
proof (prove)
using this:
share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>) = share sb' (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>)

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

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

goal (1 subgoal):
 1. share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[PROOF STEP]
from Cons.hyps [OF dist' sharing_consis' dist_prop']
[PROOF STATE]
proof (chain)
picking this:
share_all_until_volatile_write ts (share sb' (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[PROOF STEP]
have "... = share sb' (share_all_until_volatile_write ts (share ?take \<S>))"
[PROOF STATE]
proof (prove)
using this:
share_all_until_volatile_write ts (share sb' (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))

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

goal (1 subgoal):
 1. share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[PROOF STEP]
finally
[PROOF STATE]
proof (chain)
picking this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[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\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))

goal (1 subgoal):
 1. share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[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\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))

goal (1 subgoal):
 1. \<And>a ts \<S> sb'. \<lbrakk>\<And>\<S> sb'. \<lbrakk>ownership_distinct ts; sharing_consis \<S> ts; \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write ts (share sb' \<S>) = share sb' (share_all_until_volatile_write ts \<S>); ownership_distinct (a # ts); sharing_consis \<S> (a # ts); \<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 sb' \<union> all_unshared sb' \<union> all_acquired sb') = {}\<rbrakk> \<Longrightarrow> share_all_until_volatile_write (a # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (a # ts) \<S>)
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) (share sb' \<S>)) = share sb' (share_all_until_volatile_write ts (share (takeWhile (Not \<circ> is_volatile_Write\<^sub>s\<^sub>b) sb\<^sub>t) \<S>))

goal (1 subgoal):
 1. share_all_until_volatile_write (t # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (t # ts) \<S>)
[PROOF STEP]
by (clarsimp simp add: t)
[PROOF STATE]
proof (state)
this:
share_all_until_volatile_write (t # ts) (share sb' \<S>) = share sb' (share_all_until_volatile_write (t # ts) \<S>)

goal:
No subgoals!
[PROOF STEP]
qed


[STATEMENT]
lemma iptables_goto_bigstep_induct
      [case_names
        Skip Allow Deny Log Nomatch Decision Seq Call_return Call_result Goto_Decision Goto_no_Decision,
       induct pred: iptables_goto_bigstep]:
    "\<lbrakk> \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs,s\<rangle> \<Rightarrow> t;
       \<And>t. P [] t t;
       \<And>m a. matches \<gamma> m p \<Longrightarrow> a = Accept \<Longrightarrow> P [Rule m a] Undecided (Decision FinalAllow);
       \<And>m a. matches \<gamma> m p \<Longrightarrow> a = Drop \<or> a = Reject \<Longrightarrow> P [Rule m a] Undecided (Decision FinalDeny);
       \<And>m a. matches \<gamma> m p \<Longrightarrow> a = Log \<or> a = Empty \<Longrightarrow> P [Rule m a] Undecided Undecided;
       \<And>m a. \<not> matches \<gamma> m p \<Longrightarrow> P [Rule m a] Undecided Undecided;
       \<And>rs X. P rs (Decision X) (Decision X);
       \<And>rs rs\<^sub>1 rs\<^sub>2 t t'. rs = rs\<^sub>1 @ rs\<^sub>2 \<Longrightarrow> \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs\<^sub>1,Undecided\<rangle> \<Rightarrow> t \<Longrightarrow> P rs\<^sub>1 Undecided t \<Longrightarrow>
                          \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs\<^sub>2,t\<rangle> \<Rightarrow> t' \<Longrightarrow> P rs\<^sub>2 t t' \<Longrightarrow> no_matching_Goto \<gamma> p rs\<^sub>1 \<Longrightarrow>
                          P rs Undecided t';
       \<And>m a chain rs\<^sub>1 m' rs\<^sub>2. matches \<gamma> m p \<Longrightarrow> a = Call chain \<Longrightarrow>
                              \<Gamma> chain = Some (rs\<^sub>1 @ [Rule m' Return] @ rs\<^sub>2) \<Longrightarrow>
                              matches \<gamma> m' p \<Longrightarrow> \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs\<^sub>1,Undecided\<rangle> \<Rightarrow> Undecided \<Longrightarrow>
                              no_matching_Goto \<gamma> p rs\<^sub>1 \<Longrightarrow>  P rs\<^sub>1 Undecided Undecided \<Longrightarrow>
                              P [Rule m a] Undecided Undecided;
       \<And>m a chain rs t. matches \<gamma> m p \<Longrightarrow> a = Call chain \<Longrightarrow> \<Gamma> chain = Some rs \<Longrightarrow>
                         \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs,Undecided\<rangle> \<Rightarrow> t \<Longrightarrow> P rs Undecided t \<Longrightarrow> P [Rule m a] Undecided t;
       \<And>m a chain rs rest X. matches \<gamma> m p \<Longrightarrow> a = Goto chain \<Longrightarrow> \<Gamma> chain = Some rs \<Longrightarrow>
                              \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs,Undecided\<rangle> \<Rightarrow> (Decision X) \<Longrightarrow> P rs Undecided (Decision X) \<Longrightarrow>
                              P (Rule m a#rest) Undecided (Decision X);
       \<And>m a chain rs rest. matches \<gamma> m p \<Longrightarrow> a = Goto chain \<Longrightarrow> \<Gamma> chain = Some rs \<Longrightarrow>
                           \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs,Undecided\<rangle> \<Rightarrow> Undecided \<Longrightarrow> P rs Undecided Undecided \<Longrightarrow>
                           P (Rule m a#rest) Undecided Undecided\<rbrakk> \<Longrightarrow>
     P rs s t"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>\<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs, s\<rangle> \<Rightarrow> t; \<And>t. P [] t t; \<And>m a. \<lbrakk>matches \<gamma> m p; a = Accept\<rbrakk> \<Longrightarrow> P [Rule m a] Undecided (Decision FinalAllow); \<And>m a. \<lbrakk>matches \<gamma> m p; a = Drop \<or> a = Reject\<rbrakk> \<Longrightarrow> P [Rule m a] Undecided (Decision FinalDeny); \<And>m a. \<lbrakk>matches \<gamma> m p; a = Log \<or> a = Empty\<rbrakk> \<Longrightarrow> P [Rule m a] Undecided Undecided; \<And>m a. \<not> matches \<gamma> m p \<Longrightarrow> P [Rule m a] Undecided Undecided; \<And>rs X. P rs (Decision X) (Decision X); \<And>rs rs\<^sub>1 rs\<^sub>2 t t'. \<lbrakk>rs = rs\<^sub>1 @ rs\<^sub>2; \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs\<^sub>1, Undecided\<rangle> \<Rightarrow> t; P rs\<^sub>1 Undecided t; \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs\<^sub>2, t\<rangle> \<Rightarrow> t'; P rs\<^sub>2 t t'; no_matching_Goto \<gamma> p rs\<^sub>1\<rbrakk> \<Longrightarrow> P rs Undecided t'; \<And>m a chain rs\<^sub>1 m' rs\<^sub>2. \<lbrakk>matches \<gamma> m p; a = Call chain; \<Gamma> chain = Some (rs\<^sub>1 @ [Rule m' Return] @ rs\<^sub>2); matches \<gamma> m' p; \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs\<^sub>1, Undecided\<rangle> \<Rightarrow> Undecided; no_matching_Goto \<gamma> p rs\<^sub>1; P rs\<^sub>1 Undecided Undecided\<rbrakk> \<Longrightarrow> P [Rule m a] Undecided Undecided; \<And>m a chain rs t. \<lbrakk>matches \<gamma> m p; a = Call chain; \<Gamma> chain = Some rs; \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs, Undecided\<rangle> \<Rightarrow> t; P rs Undecided t\<rbrakk> \<Longrightarrow> P [Rule m a] Undecided t; \<And>m a chain rs rest X. \<lbrakk>matches \<gamma> m p; a = Goto chain; \<Gamma> chain = Some rs; \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs, Undecided\<rangle> \<Rightarrow> Decision X; P rs Undecided (Decision X)\<rbrakk> \<Longrightarrow> P (Rule m a # rest) Undecided (Decision X); \<And>m a chain rs rest. \<lbrakk>matches \<gamma> m p; a = Goto chain; \<Gamma> chain = Some rs; \<Gamma>,\<gamma>,p\<turnstile>\<^sub>g \<langle>rs, Undecided\<rangle> \<Rightarrow> Undecided; P rs Undecided Undecided\<rbrakk> \<Longrightarrow> P (Rule m a # rest) Undecided Undecided\<rbrakk> \<Longrightarrow> P rs s t
[PROOF STEP]
by (induction rule: iptables_goto_bigstep.induct) auto