[STATEMENT]
lemma vpa_trans_observable_moves:
  assumes "valid_path_aux cs as" and "m -as\<rightarrow>* m'" and "preds (kinds as) s"
  and "transfers (kinds as) s = s'" and "valid_call_list cs m"
  and "\<forall>i < length rs. rs!i \<in> get_return_edges (cs!i)"
  and "valid_return_list rs m"
  and "length rs = length cs" and "length s = Suc (length cs)"
  obtains ms ms'' s'' ms' as' as''
  where "S,kind \<turnstile> (m#ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'')"
  and "S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')"
  and "ms = targetnodes rs" and "length ms = length cs"
  and "\<forall>i<length cs. call_of_return_node (ms!i) (sourcenode (cs!i))"
  and "slice_edges S cs as = slice_edges S cs as''"
  and "m -as''@as'\<rightarrow>* m'" and "valid_path_aux cs (as''@as')"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (\<And>ms ms'' s'' as' ms' as''. \<lbrakk>S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; length ms = length cs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; m -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
proof(atomize_elim)
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from assms
[PROOF STATE]
proof (chain)
picking this:
valid_path_aux cs as
m -as\<rightarrow>* m'
preds (kinds as) s
transfers (kinds as) s = s'
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)
[PROOF STEP]
show "\<exists>ms ms'' s'' as' ms' as''.
    S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and>
    S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and>
    ms = targetnodes rs \<and> length ms = length cs \<and>
    (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and>
    slice_edges S cs as = slice_edges S cs as'' \<and>
    m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')"
[PROOF STATE]
proof (prove)
using this:
valid_path_aux cs as
m -as\<rightarrow>* m'
preds (kinds as) s
transfers (kinds as) s = s'
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
proof(induct arbitrary:m s rs rule:vpa_induct)
[PROOF STATE]
proof (state)
goal (5 subgoals):
 1. \<And>cs m s rs. \<lbrakk>m -[]\<rightarrow>* m'; preds (kinds []) s; transfers (kinds []) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 5. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case (vpa_empty cs)
[PROOF STATE]
proof (state)
this:
m -[]\<rightarrow>* m'
preds (kinds []) s
transfers (kinds []) s = s'
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)

goal (5 subgoals):
 1. \<And>cs m s rs. \<lbrakk>m -[]\<rightarrow>* m'; preds (kinds []) s; transfers (kinds []) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 5. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>m -[]\<rightarrow>* m'\<close>
[PROOF STATE]
proof (chain)
picking this:
m -[]\<rightarrow>* m'
[PROOF STEP]
have [simp]:"m' = m"
[PROOF STATE]
proof (prove)
using this:
m -[]\<rightarrow>* m'

goal (1 subgoal):
 1. m' = m
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
m' = m

goal (5 subgoals):
 1. \<And>cs m s rs. \<lbrakk>m -[]\<rightarrow>* m'; preds (kinds []) s; transfers (kinds []) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 5. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>transfers (kinds []) s = s'\<close> \<open>length s = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
transfers (kinds []) s = s'
length s = Suc (length cs)
[PROOF STEP]
have [simp]:"s' = s"
[PROOF STATE]
proof (prove)
using this:
transfers (kinds []) s = s'
length s = Suc (length cs)

goal (1 subgoal):
 1. s' = s
[PROOF STEP]
by(cases cs)(auto simp:kinds_def)
[PROOF STATE]
proof (state)
this:
s' = s

goal (5 subgoals):
 1. \<And>cs m s rs. \<lbrakk>m -[]\<rightarrow>* m'; preds (kinds []) s; transfers (kinds []) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 5. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_call_list cs m\<close> \<open>valid_return_list rs m\<close>
      \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close> \<open>length rs = length cs\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_call_list cs m
valid_return_list rs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
length rs = length cs
[PROOF STEP]
have "\<forall>i<length cs. call_of_return_node (targetnodes rs!i) (sourcenode (cs!i))"
[PROOF STATE]
proof (prove)
using this:
valid_call_list cs m
valid_return_list rs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
length rs = length cs

goal (1 subgoal):
 1. \<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))
[PROOF STEP]
by(rule get_return_edges_call_of_return_nodes)
[PROOF STATE]
proof (state)
this:
\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))

goal (5 subgoals):
 1. \<And>cs m s rs. \<lbrakk>m -[]\<rightarrow>* m'; preds (kinds []) s; transfers (kinds []) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 5. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>length s = Suc (length cs)\<close> \<open>m -[]\<rightarrow>* m'\<close> \<open>length rs = length cs\<close>
[PROOF STATE]
proof (chain)
picking this:
length s = Suc (length cs)
m -[]\<rightarrow>* m'
length rs = length cs
\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
length s = Suc (length cs)
m -[]\<rightarrow>* m'
length rs = length cs
\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="targetnodes rs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length s = Suc (length cs); m -[]\<rightarrow>* m'; length rs = length cs; \<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # targetnodes rs,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnodes rs = targetnodes rs \<and> length (targetnodes rs) = length cs \<and> (\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="m#targetnodes rs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length s = Suc (length cs); m -[]\<rightarrow>* m'; length rs = length cs; \<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # targetnodes rs,s) =slice_edges S cs []\<Rightarrow>* (m # targetnodes rs,s'') \<and> S,kind \<turnstile> (m # targetnodes rs,s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnodes rs = targetnodes rs \<and> length (targetnodes rs) = length cs \<and> (\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length s = Suc (length cs); m -[]\<rightarrow>* m'; length rs = length cs; \<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # targetnodes rs,s) =slice_edges S cs []\<Rightarrow>* (m # targetnodes rs,s) \<and> S,kind \<turnstile> (m # targetnodes rs,s) =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnodes rs = targetnodes rs \<and> length (targetnodes rs) = length cs \<and> (\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="[]" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length s = Suc (length cs); m -[]\<rightarrow>* m'; length rs = length cs; \<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # targetnodes rs,s) =slice_edges S cs []\<Rightarrow>* (m # targetnodes rs,s) \<and> S,kind \<turnstile> (m # targetnodes rs,s) =[]\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnodes rs = targetnodes rs \<and> length (targetnodes rs) = length cs \<and> (\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ []\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ [])
[PROOF STEP]
apply(rule_tac x="targetnodes rs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length s = Suc (length cs); m -[]\<rightarrow>* m'; length rs = length cs; \<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # targetnodes rs,s) =slice_edges S cs []\<Rightarrow>* (m # targetnodes rs,s) \<and> S,kind \<turnstile> (m # targetnodes rs,s) =[]\<Rightarrow>\<^sub>\<tau> (m' # targetnodes rs,s') \<and> targetnodes rs = targetnodes rs \<and> length (targetnodes rs) = length cs \<and> (\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ []\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ [])
[PROOF STEP]
apply(rule_tac x="[]" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>length s = Suc (length cs); m -[]\<rightarrow>* m'; length rs = length cs; \<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # targetnodes rs,s) =slice_edges S cs []\<Rightarrow>* (m # targetnodes rs,s) \<and> S,kind \<turnstile> (m # targetnodes rs,s) =[]\<Rightarrow>\<^sub>\<tau> (m' # targetnodes rs,s') \<and> targetnodes rs = targetnodes rs \<and> length (targetnodes rs) = length cs \<and> (\<forall>i<length cs. call_of_return_node (targetnodes rs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs [] \<and> m -[] @ []\<rightarrow>* m' \<and> valid_path_aux cs ([] @ [])
[PROOF STEP]
by(fastforce intro:tom_Nil silent_moves_Nil simp:targetnodes_def)
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs []\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs [] = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case (vpa_intra cs a as)
[PROOF STATE]
proof (state)
this:
intra_kind (kind a)
valid_path_aux cs as
\<lbrakk>?m -as\<rightarrow>* m'; preds (kinds as) ?s; transfers (kinds as) ?s = s'; valid_call_list cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (cs ! i); valid_return_list ?rs ?m; length ?rs = length cs; length ?s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (?m # ms,?s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes ?rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> ?m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
m -a # as\<rightarrow>* m'
preds (kinds (a # as)) s
transfers (kinds (a # as)) s = s'
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
note IH = \<open>\<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s';
      valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i);
      valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk>
      \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''.
      S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and>
      S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and>
      length ms = length cs \<and>
      (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and>
      slice_edges S cs as = slice_edges S cs as'' \<and>
      m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>?m -as\<rightarrow>* m'; preds (kinds as) ?s; transfers (kinds as) ?s = s'; valid_call_list cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (cs ! i); valid_return_list ?rs ?m; length ?rs = length cs; length ?s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (?m # ms,?s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes ?rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> ?m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>m -a # as\<rightarrow>* m'\<close>
[PROOF STATE]
proof (chain)
picking this:
m -a # as\<rightarrow>* m'
[PROOF STEP]
have "m = sourcenode a" and "valid_edge a"
      and "targetnode a -as\<rightarrow>* m'"
[PROOF STATE]
proof (prove)
using this:
m -a # as\<rightarrow>* m'

goal (1 subgoal):
 1. m = sourcenode a &&& valid_edge a &&& targetnode a -as\<rightarrow>* m'
[PROOF STEP]
by(auto elim:path_split_Cons)
[PROOF STATE]
proof (state)
this:
m = sourcenode a
valid_edge a
targetnode a -as\<rightarrow>* m'

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>preds (kinds (a # as)) s\<close>
[PROOF STATE]
proof (chain)
picking this:
preds (kinds (a # as)) s
[PROOF STEP]
have "pred (kind a) s"
      and "preds (kinds as) (transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
preds (kinds (a # as)) s

goal (1 subgoal):
 1. pred (kind a) s &&& preds (kinds as) (transfer (kind a) s)
[PROOF STEP]
by(auto simp:kinds_def)
[PROOF STATE]
proof (state)
this:
pred (kind a) s
preds (kinds as) (transfer (kind a) s)

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>transfers (kinds (a # as)) s = s'\<close>
[PROOF STATE]
proof (chain)
picking this:
transfers (kinds (a # as)) s = s'
[PROOF STEP]
have "transfers (kinds as) (transfer (kind a) s) = s'"
[PROOF STATE]
proof (prove)
using this:
transfers (kinds (a # as)) s = s'

goal (1 subgoal):
 1. transfers (kinds as) (transfer (kind a) s) = s'
[PROOF STEP]
by(fastforce simp:kinds_def)
[PROOF STATE]
proof (state)
this:
transfers (kinds as) (transfer (kind a) s) = s'

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>intra_kind (kind a)\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
intra_kind (kind a)
[PROOF STEP]
have "get_proc (sourcenode a) = get_proc (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
intra_kind (kind a)

goal (1 subgoal):
 1. get_proc (sourcenode a) = get_proc (targetnode a)
[PROOF STEP]
by(rule get_proc_intra)
[PROOF STATE]
proof (state)
this:
get_proc (sourcenode a) = get_proc (targetnode a)

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_call_list cs m\<close> \<open>m = sourcenode a\<close>
      \<open>get_proc (sourcenode a) = get_proc (targetnode a)\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_call_list cs m
m = sourcenode a
get_proc (sourcenode a) = get_proc (targetnode a)
[PROOF STEP]
have "valid_call_list cs (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_call_list cs m
m = sourcenode a
get_proc (sourcenode a) = get_proc (targetnode a)

goal (1 subgoal):
 1. valid_call_list cs (targetnode a)
[PROOF STEP]
apply(clarsimp simp:valid_call_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs'a ca. (\<exists>cs''a. cs' @ c # cs'' = cs'a @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q r fs. kind ca = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs'a of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (sourcenodes cs'a))\<^esub>fs); m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a); cs = cs' @ c # cs''\<rbrakk> \<Longrightarrow> \<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs
[PROOF STEP]
apply(erule_tac x="cs'" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a); cs = cs' @ c # cs''; \<forall>ca. (\<exists>cs''a. cs' @ c # cs'' = cs' @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q r fs. kind ca = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs)\<rbrakk> \<Longrightarrow> \<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs
[PROOF STEP]
apply(erule_tac x="c" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a); cs = cs' @ c # cs''; (\<exists>cs''a. cs' @ c # cs'' = cs' @ c # cs''a) \<longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs)\<rbrakk> \<Longrightarrow> \<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs
[PROOF STEP]
by(auto split:list.split)
[PROOF STATE]
proof (state)
this:
valid_call_list cs (targetnode a)

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>intra_kind (kind a)\<close> \<open>length s = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
intra_kind (kind a)
length s = Suc (length cs)
[PROOF STEP]
have "length (transfer (kind a) s) = Suc (length cs)"
[PROOF STATE]
proof (prove)
using this:
intra_kind (kind a)
length s = Suc (length cs)

goal (1 subgoal):
 1. length (transfer (kind a) s) = Suc (length cs)
[PROOF STEP]
by(cases s)(auto simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
length (transfer (kind a) s) = Suc (length cs)

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_return_list rs m\<close> \<open>m = sourcenode a\<close>
     \<open>get_proc (sourcenode a) = get_proc (targetnode a)\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_return_list rs m
m = sourcenode a
get_proc (sourcenode a) = get_proc (targetnode a)
[PROOF STEP]
have "valid_return_list rs (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_return_list rs m
m = sourcenode a
get_proc (sourcenode a) = get_proc (targetnode a)

goal (1 subgoal):
 1. valid_return_list rs (targetnode a)
[PROOF STEP]
apply(clarsimp simp:valid_return_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs'a ca. (\<exists>cs''a. cs' @ c # cs'' = cs'a @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q f. kind ca = Q\<hookleftarrow>\<^bsub>get_proc (case cs'a of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs'a))\<^esub>f); m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a); rs = cs' @ c # cs''\<rbrakk> \<Longrightarrow> \<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f
[PROOF STEP]
apply(erule_tac x="cs'" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a); rs = cs' @ c # cs''; \<forall>ca. (\<exists>cs''a. cs' @ c # cs'' = cs' @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q f. kind ca = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f)\<rbrakk> \<Longrightarrow> \<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f
[PROOF STEP]
apply clarsimp
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs'' Q f. \<lbrakk>m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a); rs = cs' @ c # cs''; valid_edge c; kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f\<rbrakk> \<Longrightarrow> get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs')) = get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (targetnodes cs'))
[PROOF STEP]
by(case_tac cs') auto
[PROOF STATE]
proof (state)
this:
valid_return_list rs (targetnode a)

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from IH[OF \<open>targetnode a -as\<rightarrow>* m'\<close> \<open>preds (kinds as) (transfer (kind a) s)\<close>
      \<open>transfers (kinds as) (transfer (kind a) s) = s'\<close>
      \<open>valid_call_list cs (targetnode a)\<close>
      \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close> this \<open>length rs = length cs\<close>
      \<open>length (transfer (kind a) s) = Suc (length cs)\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> targetnode a -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
obtain ms ms'' s'' as' ms' as'' where "length ms = length cs"
      and "S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>*
                       (ms'',s'')"
      and paths:"S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')"
      "ms = targetnodes rs"
      "\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))"
      "slice_edges S cs as = slice_edges S cs as''"
      "targetnode a -as'' @ as'\<rightarrow>* m'" "valid_path_aux cs (as'' @ as')"
[PROOF STATE]
proof (prove)
using this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> targetnode a -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. (\<And>ms ms'' s'' as' ms' as''. \<lbrakk>length ms = length cs; S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length ms = length cs
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
slice_edges S cs as = slice_edges S cs as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux cs (as'' @ as')

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))\<close>
      \<open>length ms = length cs\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
length ms = length cs
[PROOF STEP]
have "\<forall>mx \<in> set ms. return_node mx"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
length ms = length cs

goal (1 subgoal):
 1. Ball (set ms) return_node
[PROOF STEP]
by(auto simp:call_of_return_node_def in_set_conv_nth)
[PROOF STATE]
proof (state)
this:
Ball (set ms) return_node

goal (4 subgoals):
 1. \<And>cs a as m s rs. \<lbrakk>intra_kind (kind a); valid_path_aux cs as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 4. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
proof(cases "(\<forall>m \<in> set ms. \<exists>m'. call_of_return_node m m' \<and>
        m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>m = sourcenode a\<close> \<open>length ms = length cs\<close> \<open>intra_kind (kind a)\<close>
        \<open>\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))\<close>
[PROOF STATE]
proof (chain)
picking this:
m = sourcenode a
length ms = length cs
intra_kind (kind a)
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
(\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "slice_edge S cs a"
[PROOF STATE]
proof (prove)
using this:
m = sourcenode a
length ms = length cs
intra_kind (kind a)
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
(\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. slice_edge S cs a
[PROOF STEP]
by(fastforce simp:slice_edge_def in_set_conv_nth intra_kind_def)
[PROOF STATE]
proof (state)
this:
slice_edge S cs a

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>intra_kind (kind a)\<close>
[PROOF STATE]
proof (chain)
picking this:
intra_kind (kind a)
slice_edge S cs a
[PROOF STEP]
have "slice_edges S cs (a#as) = a#slice_edges S cs as"
[PROOF STATE]
proof (prove)
using this:
intra_kind (kind a)
slice_edge S cs a

goal (1 subgoal):
 1. slice_edges S cs (a # as) = a # slice_edges S cs as
[PROOF STEP]
by(fastforce simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = a # slice_edges S cs as

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from True \<open>pred (kind a) s\<close> \<open>valid_edge a\<close> \<open>intra_kind (kind a)\<close>
        \<open>\<forall>mx \<in> set ms. return_node mx\<close> \<open>length ms = length cs\<close> \<open>m = sourcenode a\<close>
        \<open>length s = Suc (length cs)\<close> \<open>length (transfer (kind a) s) = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
(\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
intra_kind (kind a)
Ball (set ms) return_node
length ms = length cs
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length cs)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) -a\<rightarrow> (targetnode a#ms,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
(\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
intra_kind (kind a)
Ball (set ms) return_node
length ms = length cs
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length cs)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
by(fastforce intro!:observable_move_intra)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>length ms = length cs\<close> \<open>length s = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
length ms = length cs
length s = Suc (length cs)
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) =[]@[a]\<Rightarrow>
                      (targetnode a#ms,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
length ms = length cs
length s = Suc (length cs)
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
by(fastforce intro:observable_moves_snoc silent_moves_Nil)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>*
        (ms'',s'')\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s'')
S,kind \<turnstile> (sourcenode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) =last [a]#slice_edges S cs as\<Rightarrow>* (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s'')
S,kind \<turnstile> (sourcenode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) =last [a] # slice_edges S cs as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by(fastforce intro:tom_Cons)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =last [a] # slice_edges S cs as\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>slice_edges S cs (a#as) = a#slice_edges S cs as\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = a # slice_edges S cs as
S,kind \<turnstile> (sourcenode a # ms,s) =last [a] # slice_edges S cs as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) =slice_edges S cs (a#as)\<Rightarrow>* (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = a # slice_edges S cs as
S,kind \<turnstile> (sourcenode a # ms,s) =last [a] # slice_edges S cs as\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>slice_edges S cs as = slice_edges S cs as''\<close> \<open>slice_edge S cs a\<close>
        \<open>intra_kind (kind a)\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs as = slice_edges S cs as''
slice_edge S cs a
intra_kind (kind a)
[PROOF STEP]
have "slice_edges S cs (a#as) = slice_edges S cs (a#as'')"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs as = slice_edges S cs as''
slice_edge S cs a
intra_kind (kind a)

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
by(fastforce simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (2 subgoals):
 1. (\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using paths \<open>m = sourcenode a\<close> \<open>valid_edge a\<close> \<open>intra_kind (kind a)\<close>
        \<open>length ms = length cs\<close> \<open>slice_edges S cs (a#as) = a#slice_edges S cs as\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
slice_edges S cs as = slice_edges S cs as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux cs (as'' @ as')
m = sourcenode a
valid_edge a
intra_kind (kind a)
length ms = length cs
slice_edges S cs (a # as) = a # slice_edges S cs as

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; valid_edge a; intra_kind (kind a); length ms = length cs; slice_edges S cs (a # as) = a # slice_edges S cs as\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; valid_edge a; intra_kind (kind a); length ms = length cs; slice_edges S cs (a # as) = a # slice_edges S cs as\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; valid_edge a; intra_kind (kind a); length ms = length cs; slice_edges S cs (a # as) = a # slice_edges S cs as\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; valid_edge a; intra_kind (kind a); length ms = length cs; slice_edges S cs (a # as) = a # slice_edges S cs as\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; valid_edge a; intra_kind (kind a); length ms = length cs; slice_edges S cs (a # as) = a # slice_edges S cs as\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; valid_edge a; intra_kind (kind a); length ms = length cs; slice_edges S cs (a # as) = a # slice_edges S cs as\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs (a # as'') \<and> m -(a # as'') @ as'\<rightarrow>* m' \<and> valid_path_aux cs ((a # as'') @ as')
[PROOF STEP]
by(auto intro:Cons_path simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>\<forall>mx \<in> set ms. return_node mx\<close>
[PROOF STATE]
proof (chain)
picking this:
Ball (set ms) return_node
\<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
[PROOF STEP]
have disj:"(\<exists>m \<in> set ms. \<exists>m'. call_of_return_node m m' \<and>
        m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> m \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>"
[PROOF STATE]
proof (prove)
using this:
Ball (set ms) return_node
\<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. (\<exists>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> m \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
by(fastforce dest:return_node_call_of_return_node)
[PROOF STATE]
proof (state)
this:
(\<exists>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> m \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>m = sourcenode a\<close> \<open>length ms = length cs\<close> \<open>intra_kind (kind a)\<close>
        \<open>\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))\<close>
[PROOF STATE]
proof (chain)
picking this:
m = sourcenode a
length ms = length cs
intra_kind (kind a)
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
(\<exists>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> m \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "\<not> slice_edge S cs a"
[PROOF STATE]
proof (prove)
using this:
m = sourcenode a
length ms = length cs
intra_kind (kind a)
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
(\<exists>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> m \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<not> slice_edge S cs a
[PROOF STEP]
by(fastforce simp:slice_edge_def in_set_conv_nth intra_kind_def)
[PROOF STATE]
proof (state)
this:
\<not> slice_edge S cs a

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>intra_kind (kind a)\<close>
[PROOF STATE]
proof (chain)
picking this:
intra_kind (kind a)
\<not> slice_edge S cs a
[PROOF STEP]
have "slice_edges S cs (a#as) = slice_edges S cs as"
[PROOF STATE]
proof (prove)
using this:
intra_kind (kind a)
\<not> slice_edge S cs a

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs as
[PROOF STEP]
by(fastforce simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs as

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from disj \<open>pred (kind a) s\<close> \<open>valid_edge a\<close> \<open>intra_kind (kind a)\<close>
        \<open>\<forall>mx \<in> set ms. return_node mx\<close> \<open>length ms = length cs\<close> \<open>m = sourcenode a\<close>
        \<open>length s = Suc (length cs)\<close> \<open>length (transfer (kind a) s) = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
(\<exists>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> m \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
intra_kind (kind a)
Ball (set ms) return_node
length ms = length cs
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length cs)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a#ms,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
(\<exists>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> m \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
intra_kind (kind a)
Ball (set ms) return_node
length ms = length cs
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length cs)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
by(fastforce intro!:silent_move_intra)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> m \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>*
                      (ms'',s'')\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs as\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
proof(rule trans_observable_moves.cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
fix msx sx n\<^sub>c' f
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
assume "targetnode a # ms = msx"
          and "transfer (kind a) s = sx" and "slice_edges S cs as = []"
          and [simp]:"ms'' = msx" "s'' = sx" and "length msx = length sx"
[PROOF STATE]
proof (state)
this:
targetnode a # ms = msx
transfer (kind a) s = sx
slice_edges S cs as = []
ms'' = msx
s'' = sx
length msx = length sx

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>slice_edges S cs (a#as) = slice_edges S cs as\<close>
          \<open>slice_edges S cs as = []\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = slice_edges S cs as
slice_edges S cs as = []
[PROOF STEP]
have "slice_edges S cs (a#as) = []"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = slice_edges S cs as
slice_edges S cs as = []

goal (1 subgoal):
 1. slice_edges S cs (a # as) = []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = []

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>length ms = length cs\<close> \<open>length s = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
length ms = length cs
length s = Suc (length cs)
slice_edges S cs (a # as) = []
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) =slice_edges S cs (a#as)\<Rightarrow>*
                        (sourcenode a#ms,s)"
[PROOF STATE]
proof (prove)
using this:
length ms = length cs
length s = Suc (length cs)
slice_edges S cs (a # as) = []

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s)
[PROOF STEP]
by(fastforce intro:tom_Nil)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s)

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s)

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')\<close> \<open>targetnode a # ms = msx\<close>
          \<open>transfer (kind a) s = sx\<close> \<open>ms'' = msx\<close> \<open>s'' = sx\<close>
          \<open>S,kind \<turnstile> (sourcenode a#ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a#ms,transfer (kind a) s)\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
targetnode a # ms = msx
transfer (kind a) s = sx
ms'' = msx
s'' = sx
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) =a#as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
targetnode a # ms = msx
transfer (kind a) s = sx
ms'' = msx
s'' = sx
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
[PROOF STEP]
by(fastforce intro:silent_moves_Cons)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from this \<open>valid_edge a\<close> \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close>
          \<open>ms = targetnodes rs\<close> \<open>valid_return_list rs m\<close> \<open>length rs = length cs\<close>
          \<open>length s = Suc (length cs)\<close> \<open>m = sourcenode a\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
valid_edge a
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
ms = targetnodes rs
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)
m = sourcenode a
[PROOF STEP]
have "sourcenode a -a#as'\<rightarrow>* m'" and "valid_path_aux cs (a#as')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
valid_edge a
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
ms = targetnodes rs
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)
m = sourcenode a

goal (1 subgoal):
 1. sourcenode a -a # as'\<rightarrow>* m' &&& valid_path_aux cs (a # as')
[PROOF STEP]
by -(rule silent_moves_vpa_path,(fastforce simp:targetnodes_def)+)+
[PROOF STATE]
proof (state)
this:
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using \<open>m = sourcenode a\<close> \<open>length ms = length cs\<close>
          \<open>\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))\<close>
          \<open>slice_edges S cs (a#as) = []\<close> \<open>intra_kind (kind a)\<close>
          \<open>S,kind \<turnstile> (sourcenode a#ms,s) =a#as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')\<close>
          \<open>ms = targetnodes rs\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')
m = sourcenode a
length ms = length cs
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
slice_edges S cs (a # as) = []
intra_kind (kind a)
S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs (a # as) = []; intra_kind (kind a); S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="sourcenode a#ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs (a # as) = []; intra_kind (kind a); S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s'') \<and> S,kind \<turnstile> (sourcenode a # ms,s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs (a # as) = []; intra_kind (kind a); S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # ms,s) =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs (a # as) = []; intra_kind (kind a); S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ a # as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs (a # as) = []; intra_kind (kind a); S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ a # as')
[PROOF STEP]
apply(rule_tac x="[]" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs (a # as) = []; intra_kind (kind a); S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs [] \<and> m -[] @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs ([] @ a # as')
[PROOF STEP]
by(auto simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
fix S' f msx sx asx msx' sx' asx' msx'' sx''
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
assume [simp]:"S = S'" and "kind = f" and "targetnode a # ms = msx"
          and "transfer (kind a) s = sx" and "slice_edges S cs as = last asx # asx'"
          and "ms'' = msx''" and "s'' = sx''"
          and "S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')"
          and "S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')"
[PROOF STATE]
proof (state)
this:
S = S'
kind = f
targetnode a # ms = msx
transfer (kind a) s = sx
slice_edges S cs as = last asx # asx'
ms'' = msx''
s'' = sx''
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>kind = f\<close>
[PROOF STATE]
proof (chain)
picking this:
kind = f
[PROOF STEP]
have [simp]:"f = kind"
[PROOF STATE]
proof (prove)
using this:
kind = f

goal (1 subgoal):
 1. f = kind
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f = kind

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (sourcenode a#ms,s) -a\<rightarrow>\<^sub>\<tau>
          (targetnode a#ms,transfer (kind a) s)\<close> \<open>S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')\<close>
          \<open>transfer (kind a) s = sx\<close> \<open>targetnode a # ms = msx\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
transfer (kind a) s = sx
targetnode a # ms = msx
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) =a#asx\<Rightarrow> (msx',sx')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
transfer (kind a) s = sx
targetnode a # ms = msx

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) =a # asx\<Rightarrow> (msx',sx')
[PROOF STEP]
by(fastforce intro:silent_move_observable_moves)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =a # asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')\<close> \<open>ms'' = msx''\<close> \<open>s'' = sx''\<close>
[PROOF STATE]
proof (chain)
picking this:
S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')
ms'' = msx''
s'' = sx''
S,kind \<turnstile> (sourcenode a # ms,s) =a # asx\<Rightarrow> (msx',sx')
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#ms,s) =last (a#asx)#asx'\<Rightarrow>* (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')
ms'' = msx''
s'' = sx''
S,kind \<turnstile> (sourcenode a # ms,s) =a # asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by(fastforce intro:trans_observable_moves.tom_Cons)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')\<close>
[PROOF STATE]
proof (chain)
picking this:
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
[PROOF STEP]
have "asx \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. asx \<noteq> []
[PROOF STEP]
by(fastforce elim:observable_moves.cases)
[PROOF STATE]
proof (state)
this:
asx \<noteq> []

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>slice_edges S cs (a#as) = slice_edges S cs as\<close>
          \<open>slice_edges S cs as = last asx # asx'\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = slice_edges S cs as
slice_edges S cs as = last asx # asx'
asx \<noteq> []
[PROOF STEP]
have "slice_edges S cs (a#as) = last (a#asx)#asx'"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = slice_edges S cs as
slice_edges S cs as = last asx # asx'
asx \<noteq> []

goal (1 subgoal):
 1. slice_edges S cs (a # as) = last (a # asx) # asx'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = last (a # asx) # asx'

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = last (a # asx) # asx'

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<not> slice_edge S cs a\<close> \<open>slice_edges S cs as = slice_edges S cs as''\<close>
          \<open>intra_kind (kind a)\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> slice_edge S cs a
slice_edges S cs as = slice_edges S cs as''
intra_kind (kind a)
[PROOF STEP]
have "slice_edges S cs (a # as) = slice_edges S cs (a # as'')"
[PROOF STATE]
proof (prove)
using this:
\<not> slice_edge S cs a
slice_edges S cs as = slice_edges S cs as''
intra_kind (kind a)

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
by(fastforce simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using paths \<open>m = sourcenode a\<close> \<open>intra_kind (kind a)\<close>
          \<open>length ms = length cs\<close> \<open>ms = targetnodes rs\<close> \<open>valid_edge a\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs
\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))
slice_edges S cs as = slice_edges S cs as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux cs (as'' @ as')
m = sourcenode a
intra_kind (kind a)
length ms = length cs
ms = targetnodes rs
valid_edge a

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; intra_kind (kind a); length ms = length cs; ms = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; intra_kind (kind a); length ms = length cs; ms = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; intra_kind (kind a); length ms = length cs; ms = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; intra_kind (kind a); length ms = length cs; ms = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; intra_kind (kind a); length ms = length cs; ms = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs; \<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i)); slice_edges S cs as = slice_edges S cs as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs (as'' @ as'); m = sourcenode a; intra_kind (kind a); length ms = length cs; ms = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs (a # as'') \<and> m -(a # as'') @ as'\<rightarrow>* m' \<and> valid_path_aux cs ((a # as'') @ as')
[PROOF STEP]
by(auto intro:Cons_path simp:intra_kind_def)
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case (vpa_Call cs a as Q r p fs)
[PROOF STATE]
proof (state)
this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
valid_path_aux (a # cs) as
\<lbrakk>?m -as\<rightarrow>* m'; preds (kinds as) ?s; transfers (kinds as) ?s = s'; valid_call_list (a # cs) ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list ?rs ?m; length ?rs = length (a # cs); length ?s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (?m # ms,?s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes ?rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> ?m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as')
m -a # as\<rightarrow>* m'
preds (kinds (a # as)) s
transfers (kinds (a # as)) s = s'
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
note IH = \<open>\<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s';
      valid_call_list (a # cs) m;
      \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i);
      valid_return_list rs m; length rs = length (a # cs);
      length s = Suc (length (a # cs))\<rbrakk>
      \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''.
      S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and>
      S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and>
      length ms = length (a # cs) \<and>
      (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and>
      slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and>
      m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as')\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>?m -as\<rightarrow>* m'; preds (kinds as) ?s; transfers (kinds as) ?s = s'; valid_call_list (a # cs) ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list ?rs ?m; length ?rs = length (a # cs); length ?s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (?m # ms,?s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes ?rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> ?m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as')

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>m -a # as\<rightarrow>* m'\<close>
[PROOF STATE]
proof (chain)
picking this:
m -a # as\<rightarrow>* m'
[PROOF STEP]
have "m = sourcenode a" and "valid_edge a"
      and "targetnode a -as\<rightarrow>* m'"
[PROOF STATE]
proof (prove)
using this:
m -a # as\<rightarrow>* m'

goal (1 subgoal):
 1. m = sourcenode a &&& valid_edge a &&& targetnode a -as\<rightarrow>* m'
[PROOF STEP]
by(auto elim:path_split_Cons)
[PROOF STATE]
proof (state)
this:
m = sourcenode a
valid_edge a
targetnode a -as\<rightarrow>* m'

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>preds (kinds (a # as)) s\<close>
[PROOF STATE]
proof (chain)
picking this:
preds (kinds (a # as)) s
[PROOF STEP]
have "pred (kind a) s"
      and "preds (kinds as) (transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
preds (kinds (a # as)) s

goal (1 subgoal):
 1. pred (kind a) s &&& preds (kinds as) (transfer (kind a) s)
[PROOF STEP]
by(auto simp:kinds_def)
[PROOF STATE]
proof (state)
this:
pred (kind a) s
preds (kinds as) (transfer (kind a) s)

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>transfers (kinds (a # as)) s = s'\<close>
[PROOF STATE]
proof (chain)
picking this:
transfers (kinds (a # as)) s = s'
[PROOF STEP]
have "transfers (kinds as) (transfer (kind a) s) = s'"
[PROOF STATE]
proof (prove)
using this:
transfers (kinds (a # as)) s = s'

goal (1 subgoal):
 1. transfers (kinds as) (transfer (kind a) s) = s'
[PROOF STEP]
by(fastforce simp:kinds_def)
[PROOF STATE]
proof (state)
this:
transfers (kinds as) (transfer (kind a) s) = s'

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
[PROOF STEP]
have "get_proc (targetnode a) = p"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs

goal (1 subgoal):
 1. get_proc (targetnode a) = p
[PROOF STEP]
by(rule get_proc_call)
[PROOF STATE]
proof (state)
this:
get_proc (targetnode a) = p

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>valid_call_list cs m\<close> \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close> \<open>m = sourcenode a\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_call_list cs m
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
m = sourcenode a
get_proc (targetnode a) = p
[PROOF STEP]
have "valid_call_list (a # cs) (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_call_list cs m
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
m = sourcenode a
get_proc (targetnode a) = p

goal (1 subgoal):
 1. valid_call_list (a # cs) (targetnode a)
[PROOF STEP]
apply(clarsimp simp:valid_call_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs' c. (\<exists>cs''. cs = cs' @ c # cs'') \<longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs); valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>get_proc (targetnode a)\<^esub>fs; m = sourcenode a; p = get_proc (targetnode a); a # cs = cs' @ c # cs''\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs)
[PROOF STEP]
apply(case_tac cs')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs' c. (\<exists>cs''. cs = cs' @ c # cs'') \<longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs); valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>get_proc (targetnode a)\<^esub>fs; m = sourcenode a; p = get_proc (targetnode a); a # cs = cs' @ c # cs''; cs' = []\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs)
 2. \<And>cs' c cs'' aa list. \<lbrakk>\<forall>cs' c. (\<exists>cs''. cs = cs' @ c # cs'') \<longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs); valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>get_proc (targetnode a)\<^esub>fs; m = sourcenode a; p = get_proc (targetnode a); a # cs = cs' @ c # cs''; cs' = aa # list\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c cs'' list. \<lbrakk>\<forall>cs' ca. (\<exists>cs''a. list @ c # cs'' = cs' @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q r fs. kind ca = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs); valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>get_proc (targetnode a)\<^esub>fs; m = sourcenode a; p = get_proc (targetnode a); cs = list @ c # cs''\<rbrakk> \<Longrightarrow> \<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (last (sourcenodes (a # list)))\<^esub>fs
[PROOF STEP]
apply(erule_tac x="list" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c cs'' list. \<lbrakk>valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>get_proc (targetnode a)\<^esub>fs; m = sourcenode a; p = get_proc (targetnode a); cs = list @ c # cs''; \<forall>ca. (\<exists>cs''a. list @ c # cs'' = list @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q r fs. kind ca = Q:r\<hookrightarrow>\<^bsub>get_proc (case list of [] \<Rightarrow> sourcenode a | a # lista \<Rightarrow> last (sourcenodes list))\<^esub>fs)\<rbrakk> \<Longrightarrow> \<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (last (sourcenodes (a # list)))\<^esub>fs
[PROOF STEP]
by(case_tac list)(auto simp:sourcenodes_def)
[PROOF STATE]
proof (state)
this:
valid_call_list (a # cs) (targetnode a)

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
[PROOF STEP]
obtain a' where "a' \<in> get_return_edges a"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs

goal (1 subgoal):
 1. (\<And>a'. a' \<in> get_return_edges a \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(fastforce dest:get_return_edge_call)
[PROOF STATE]
proof (state)
this:
a' \<in> get_return_edges a

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
a' \<in> get_return_edges a
[PROOF STEP]
obtain Q' f' where "kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
a' \<in> get_return_edges a

goal (1 subgoal):
 1. (\<And>Q' f'. kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f' \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(fastforce dest!:call_return_edges)
[PROOF STATE]
proof (state)
this:
kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>a' \<in> get_return_edges a\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
a' \<in> get_return_edges a
[PROOF STEP]
have "valid_edge a'"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
a' \<in> get_return_edges a

goal (1 subgoal):
 1. valid_edge a'
[PROOF STEP]
by(rule get_return_edges_valid)
[PROOF STATE]
proof (state)
this:
valid_edge a'

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge a'\<close> \<open>kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a'
kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'
[PROOF STEP]
have "get_proc (sourcenode a') = p"
[PROOF STATE]
proof (prove)
using this:
valid_edge a'
kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'

goal (1 subgoal):
 1. get_proc (sourcenode a') = p
[PROOF STEP]
by(rule get_proc_return)
[PROOF STATE]
proof (state)
this:
get_proc (sourcenode a') = p

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close> \<open>a' \<in> get_return_edges a\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
a' \<in> get_return_edges a
[PROOF STEP]
have "\<forall>i<length (a'#rs). (a'#rs) ! i \<in> get_return_edges ((a#cs) ! i)"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
a' \<in> get_return_edges a

goal (1 subgoal):
 1. \<forall>i<length (a' # rs). (a' # rs) ! i \<in> get_return_edges ((a # cs) ! i)
[PROOF STEP]
by auto(case_tac i,auto)
[PROOF STATE]
proof (state)
this:
\<forall>i<length (a' # rs). (a' # rs) ! i \<in> get_return_edges ((a # cs) ! i)

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>a' \<in> get_return_edges a\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
a' \<in> get_return_edges a
[PROOF STEP]
have "get_proc (sourcenode a) = get_proc (targetnode a')"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
a' \<in> get_return_edges a

goal (1 subgoal):
 1. get_proc (sourcenode a) = get_proc (targetnode a')
[PROOF STEP]
by(rule get_proc_get_return_edge)
[PROOF STATE]
proof (state)
this:
get_proc (sourcenode a) = get_proc (targetnode a')

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>valid_return_list rs m\<close> \<open>valid_edge a'\<close> \<open>kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'\<close>
      \<open>get_proc (sourcenode a') = p\<close> \<open>get_proc (targetnode a) = p\<close> \<open>m = sourcenode a\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_return_list rs m
valid_edge a'
kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'
get_proc (sourcenode a') = p
get_proc (targetnode a) = p
m = sourcenode a
get_proc (sourcenode a) = get_proc (targetnode a')
[PROOF STEP]
have "valid_return_list (a'#rs) (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_return_list rs m
valid_edge a'
kind a' = Q'\<hookleftarrow>\<^bsub>p\<^esub>f'
get_proc (sourcenode a') = p
get_proc (targetnode a) = p
m = sourcenode a
get_proc (sourcenode a) = get_proc (targetnode a')

goal (1 subgoal):
 1. valid_return_list (a' # rs) (targetnode a)
[PROOF STEP]
apply(clarsimp simp:valid_return_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs' c. (\<exists>cs''. rs = cs' @ c # cs'') \<longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f); valid_edge a'; kind a' = Q'\<hookleftarrow>\<^bsub>get_proc (sourcenode a')\<^esub>f'; get_proc (targetnode a) = get_proc (sourcenode a'); m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a'); p = get_proc (sourcenode a'); a' # rs = cs' @ c # cs''\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f)
[PROOF STEP]
apply(case_tac cs')
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs' c. (\<exists>cs''. rs = cs' @ c # cs'') \<longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f); valid_edge a'; kind a' = Q'\<hookleftarrow>\<^bsub>get_proc (sourcenode a')\<^esub>f'; get_proc (targetnode a) = get_proc (sourcenode a'); m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a'); p = get_proc (sourcenode a'); a' # rs = cs' @ c # cs''; cs' = []\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f)
 2. \<And>cs' c cs'' aa list. \<lbrakk>\<forall>cs' c. (\<exists>cs''. rs = cs' @ c # cs'') \<longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f); valid_edge a'; kind a' = Q'\<hookleftarrow>\<^bsub>get_proc (sourcenode a')\<^esub>f'; get_proc (targetnode a) = get_proc (sourcenode a'); m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a'); p = get_proc (sourcenode a'); a' # rs = cs' @ c # cs''; cs' = aa # list\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f)
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c cs'' list. \<lbrakk>\<forall>cs' ca. (\<exists>cs''a. list @ c # cs'' = cs' @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q f. kind ca = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> sourcenode a | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f); valid_edge a'; kind a' = Q'\<hookleftarrow>\<^bsub>get_proc (sourcenode a')\<^esub>f'; get_proc (targetnode a) = get_proc (sourcenode a'); m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a'); p = get_proc (sourcenode a'); rs = list @ c # cs''\<rbrakk> \<Longrightarrow> \<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (last (targetnodes (a' # list)))\<^esub>f
[PROOF STEP]
apply(erule_tac x="list" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>c cs'' list. \<lbrakk>valid_edge a'; kind a' = Q'\<hookleftarrow>\<^bsub>get_proc (sourcenode a')\<^esub>f'; get_proc (targetnode a) = get_proc (sourcenode a'); m = sourcenode a; get_proc (sourcenode a) = get_proc (targetnode a'); p = get_proc (sourcenode a'); rs = list @ c # cs''; \<forall>ca. (\<exists>cs''a. list @ c # cs'' = list @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q f. kind ca = Q\<hookleftarrow>\<^bsub>get_proc (case list of [] \<Rightarrow> sourcenode a | a # lista \<Rightarrow> last (targetnodes list))\<^esub>f)\<rbrakk> \<Longrightarrow> \<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (last (targetnodes (a' # list)))\<^esub>f
[PROOF STEP]
by(case_tac list)(auto simp:targetnodes_def)
[PROOF STATE]
proof (state)
this:
valid_return_list (a' # rs) (targetnode a)

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>length rs = length cs\<close>
[PROOF STATE]
proof (chain)
picking this:
length rs = length cs
[PROOF STEP]
have "length (a'#rs) = length (a#cs)"
[PROOF STATE]
proof (prove)
using this:
length rs = length cs

goal (1 subgoal):
 1. length (a' # rs) = length (a # cs)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
length (a' # rs) = length (a # cs)

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>length s = Suc (length cs)\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
length s = Suc (length cs)
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
[PROOF STEP]
have "length (transfer (kind a) s) = Suc (length (a#cs))"
[PROOF STATE]
proof (prove)
using this:
length s = Suc (length cs)
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs

goal (1 subgoal):
 1. length (transfer (kind a) s) = Suc (length (a # cs))
[PROOF STEP]
by(cases s) auto
[PROOF STATE]
proof (state)
this:
length (transfer (kind a) s) = Suc (length (a # cs))

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from IH[OF \<open>targetnode a -as\<rightarrow>* m'\<close> \<open>preds (kinds as) (transfer (kind a) s)\<close>
      \<open>transfers (kinds as) (transfer (kind a) s) = s'\<close>
      \<open>valid_call_list (a # cs) (targetnode a)\<close>
      \<open>\<forall>i<length (a'#rs). (a'#rs) ! i \<in> get_return_edges ((a#cs) ! i)\<close>
      \<open>valid_return_list (a'#rs) (targetnode a)\<close> \<open>length (a'#rs) = length (a#cs)\<close>
      \<open>length (transfer (kind a) s) = Suc (length (a#cs))\<close>]
[PROOF STATE]
proof (chain)
picking this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes (a' # rs) \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> targetnode a -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as')
[PROOF STEP]
obtain ms ms'' s'' as' ms' as'' where "length ms = length (a#cs)"
      and "S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s)
                     =slice_edges S (a#cs) as\<Rightarrow>* (ms'',s'')"
      and paths:"S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')"
      "ms = targetnodes (a'#rs)"
      "\<forall>i<length (a#cs). call_of_return_node (ms ! i) (sourcenode ((a#cs) ! i))"
      "slice_edges S (a#cs) as = slice_edges S (a#cs) as''"
      "targetnode a -as'' @ as'\<rightarrow>* m'" "valid_path_aux (a#cs) (as'' @ as')"
[PROOF STATE]
proof (prove)
using this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes (a' # rs) \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> targetnode a -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as')

goal (1 subgoal):
 1. (\<And>ms ms'' s'' as' ms' as''. \<lbrakk>length ms = length (a # cs); S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length ms = length (a # cs)
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes (a' # rs)
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
slice_edges S (a # cs) as = slice_edges S (a # cs) as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux (a # cs) (as'' @ as')

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>ms = targetnodes (a'#rs)\<close>
[PROOF STATE]
proof (chain)
picking this:
ms = targetnodes (a' # rs)
[PROOF STEP]
obtain x xs where [simp]:"ms = x#xs"
      and "x = targetnode a'" and "xs = targetnodes rs"
[PROOF STATE]
proof (prove)
using this:
ms = targetnodes (a' # rs)

goal (1 subgoal):
 1. (\<And>x xs. \<lbrakk>ms = x # xs; x = targetnode a'; xs = targetnodes rs\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases ms)(auto simp:targetnodes_def)
[PROOF STATE]
proof (state)
this:
ms = x # xs
x = targetnode a'
xs = targetnodes rs

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<forall>i<length (a#cs). call_of_return_node (ms ! i) (sourcenode ((a#cs) ! i))\<close>
      \<open>length ms = length (a#cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
length ms = length (a # cs)
[PROOF STEP]
have "\<forall>mx \<in> set xs. return_node mx"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
length ms = length (a # cs)

goal (1 subgoal):
 1. Ball (set xs) return_node
[PROOF STEP]
apply(auto simp:in_set_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<forall>i<Suc (length cs). call_of_return_node ((x # xs) ! i) (sourcenode ((a # cs) ! i)); length xs = length cs; i < length cs\<rbrakk> \<Longrightarrow> return_node (xs ! i)
[PROOF STEP]
apply(case_tac i)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>\<forall>i<Suc (length cs). call_of_return_node ((x # xs) ! i) (sourcenode ((a # cs) ! i)); length xs = length cs; i < length cs; i = 0\<rbrakk> \<Longrightarrow> return_node (xs ! i)
 2. \<And>i nat. \<lbrakk>\<forall>i<Suc (length cs). call_of_return_node ((x # xs) ! i) (sourcenode ((a # cs) ! i)); length xs = length cs; i < length cs; i = Suc nat\<rbrakk> \<Longrightarrow> return_node (xs ! i)
[PROOF STEP]
apply(erule_tac x="Suc 0" in allE)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>i. \<lbrakk>length xs = length cs; i < length cs; i = 0; Suc 0 < Suc (length cs) \<longrightarrow> call_of_return_node ((x # xs) ! Suc 0) (sourcenode ((a # cs) ! Suc 0))\<rbrakk> \<Longrightarrow> return_node (xs ! i)
 2. \<And>i nat. \<lbrakk>\<forall>i<Suc (length cs). call_of_return_node ((x # xs) ! i) (sourcenode ((a # cs) ! i)); length xs = length cs; i < length cs; i = Suc nat\<rbrakk> \<Longrightarrow> return_node (xs ! i)
[PROOF STEP]
by(auto simp:call_of_return_node_def)
[PROOF STATE]
proof (state)
this:
Ball (set xs) return_node

goal (3 subgoals):
 1. \<And>cs a as Q r p fs m s rs. \<lbrakk>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_path_aux (a # cs) as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list (a # cs) m; \<forall>i<length rs. rs ! i \<in> get_return_edges ((a # cs) ! i); valid_return_list rs m; length rs = length (a # cs); length s = Suc (length (a # cs))\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length (a # cs) \<and> (\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))) \<and> slice_edges S (a # cs) as = slice_edges S (a # cs) as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux (a # cs) (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 3. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
proof(cases "(\<forall>m \<in> set xs. \<exists>m'. call_of_return_node m m' \<and>
        m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
(\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>\<forall>i<length (a#cs). call_of_return_node (ms ! i) (sourcenode ((a#cs) ! i))\<close>
        \<open>length ms = length (a#cs)\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
length ms = length (a # cs)
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
(\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "slice_edge S cs a"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
length ms = length (a # cs)
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
(\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. slice_edge S cs a
[PROOF STEP]
apply(auto simp:slice_edge_def in_set_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>\<forall>i<Suc (length cs). call_of_return_node ((x # xs) ! i) (sourcenode ((a # cs) ! i)); length xs = length cs; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; \<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; i < length cs\<rbrakk> \<Longrightarrow> sourcenode (cs ! i) \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
by(erule_tac x="Suc i" in allE) auto
[PROOF STATE]
proof (state)
this:
slice_edge S cs a

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
slice_edge S cs a
[PROOF STEP]
have "slice_edges S cs (a#as) = a#slice_edges S (a#cs) as"
[PROOF STATE]
proof (prove)
using this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
slice_edge S cs a

goal (1 subgoal):
 1. slice_edges S cs (a # as) = a # slice_edges S (a # cs) as
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = a # slice_edges S (a # cs) as

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from True \<open>pred (kind a) s\<close> \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
        \<open>valid_edge a'\<close> \<open>a' \<in> get_return_edges a\<close>
        \<open>\<forall>mx \<in> set xs. return_node mx\<close> \<open>length ms = length (a#cs)\<close> \<open>m = sourcenode a\<close>
        \<open>length s = Suc (length cs)\<close>
        \<open>length (transfer (kind a) s) = Suc (length (a#cs))\<close>
[PROOF STATE]
proof (chain)
picking this:
(\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
valid_edge a'
a' \<in> get_return_edges a
Ball (set xs) return_node
length ms = length (a # cs)
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length (a # cs))
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) -a\<rightarrow>
        (targetnode a#targetnode a'#xs,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
(\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
valid_edge a'
a' \<in> get_return_edges a
Ball (set xs) return_node
length ms = length (a # cs)
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length (a # cs))

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)
[PROOF STEP]
by -(rule_tac a'="a'" in observable_move_call,fastforce+)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>length ms = length (a#cs)\<close> \<open>length s = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
length ms = length (a # cs)
length s = Suc (length cs)
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) =[]@[a]\<Rightarrow>
        (targetnode a#targetnode a'#xs,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
length ms = length (a # cs)
length s = Suc (length cs)
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) =[] @ [a]\<Rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)
[PROOF STEP]
by(fastforce intro:observable_moves_snoc silent_moves_Nil)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =[] @ [a]\<Rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s)
        =slice_edges S (a#cs) as\<Rightarrow>* (ms'',s'')\<close> \<open>x = targetnode a'\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')
x = targetnode a'
S,kind \<turnstile> (sourcenode a # xs,s) =[] @ [a]\<Rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) =last [a]#slice_edges S (a#cs) as\<Rightarrow>*
        (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')
x = targetnode a'
S,kind \<turnstile> (sourcenode a # xs,s) =[] @ [a]\<Rightarrow> (targetnode a # targetnode a' # xs,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) =last [a] # slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by -(rule tom_Cons,auto)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =last [a] # slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>slice_edges S cs (a#as) = a#slice_edges S (a#cs) as\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = a # slice_edges S (a # cs) as
S,kind \<turnstile> (sourcenode a # xs,s) =last [a] # slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) =slice_edges S cs (a#as)\<Rightarrow>* (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = a # slice_edges S (a # cs) as
S,kind \<turnstile> (sourcenode a # xs,s) =last [a] # slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>slice_edges S (a#cs) as = slice_edges S (a#cs) as''\<close>
        \<open>slice_edge S cs a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S (a # cs) as = slice_edges S (a # cs) as''
slice_edge S cs a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
[PROOF STEP]
have "slice_edges S cs (a#as) = slice_edges S cs (a#as'')"
[PROOF STATE]
proof (prove)
using this:
slice_edges S (a # cs) as = slice_edges S (a # cs) as''
slice_edge S cs a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (2 subgoals):
 1. (\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using paths \<open>m = sourcenode a\<close> \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
          \<open>length ms = length (a#cs)\<close> \<open>xs = targetnodes rs\<close>
          \<open>slice_edges S cs (a#as) = a#slice_edges S (a#cs) as\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes (a' # rs)
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
slice_edges S (a # cs) as = slice_edges S (a # cs) as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux (a # cs) (as'' @ as')
m = sourcenode a
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
length ms = length (a # cs)
xs = targetnodes rs
slice_edges S cs (a # as) = a # slice_edges S (a # cs) as

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="xs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; slice_edges S cs (a # as) = a # slice_edges S (a # cs) as\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; slice_edges S cs (a # as) = a # slice_edges S (a # cs) as\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; slice_edges S cs (a # as) = a # slice_edges S (a # cs) as\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; slice_edges S cs (a # as) = a # slice_edges S (a # cs) as\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; slice_edges S cs (a # as) = a # slice_edges S (a # cs) as\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; slice_edges S cs (a # as) = a # slice_edges S (a # cs) as\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs (a # as'') \<and> m -(a # as'') @ as'\<rightarrow>* m' \<and> valid_path_aux cs ((a # as'') @ as')
[PROOF STEP]
by(auto intro:Cons_path simp:targetnodes_def)
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>\<forall>mx \<in> set xs. return_node mx\<close>
[PROOF STATE]
proof (chain)
picking this:
Ball (set xs) return_node
\<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
[PROOF STEP]
have disj:"(\<exists>m \<in> set xs. \<exists>m'. call_of_return_node m m' \<and>
        m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>"
[PROOF STATE]
proof (prove)
using this:
Ball (set xs) return_node
\<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. (\<exists>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
by(fastforce dest:return_node_call_of_return_node)
[PROOF STATE]
proof (state)
this:
(\<exists>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>\<forall>i<length (a#cs). call_of_return_node (ms ! i) (sourcenode ((a#cs) ! i))\<close>
        \<open>length ms = length (a#cs)\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
length ms = length (a # cs)
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
(\<exists>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "\<not> slice_edge S cs a"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
length ms = length (a # cs)
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
(\<exists>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<not> slice_edge S cs a
[PROOF STEP]
apply(auto simp:slice_edge_def in_set_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m' i. \<lbrakk>\<forall>i<Suc (length cs). call_of_return_node ((x # xs) ! i) (sourcenode ((a # cs) ! i)); length xs = length cs; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; \<forall>c\<in>set cs. sourcenode c \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; call_of_return_node (xs ! i) m'; m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; i < length cs\<rbrakk> \<Longrightarrow> False
[PROOF STEP]
by(erule_tac x="Suc i" in allE) auto
[PROOF STATE]
proof (state)
this:
\<not> slice_edge S cs a

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
[PROOF STATE]
proof (chain)
picking this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
\<not> slice_edge S cs a
[PROOF STEP]
have "slice_edges S cs (a#as) = slice_edges S (a#cs) as"
[PROOF STATE]
proof (prove)
using this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
\<not> slice_edge S cs a

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S (a # cs) as
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S (a # cs) as

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from disj \<open>pred (kind a) s\<close> \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
        \<open>valid_edge a'\<close> \<open>a' \<in> get_return_edges a\<close>
        \<open>\<forall>mx \<in> set xs. return_node mx\<close> \<open>length ms = length (a#cs)\<close> \<open>m = sourcenode a\<close>
        \<open>length s = Suc (length cs)\<close>
        \<open>length (transfer (kind a) s) = Suc (length (a#cs))\<close>
[PROOF STATE]
proof (chain)
picking this:
(\<exists>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
valid_edge a'
a' \<in> get_return_edges a
Ball (set xs) return_node
length ms = length (a # cs)
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length (a # cs))
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) -a\<rightarrow>\<^sub>\<tau>
        (targetnode a#targetnode a'#xs,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
(\<exists>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
valid_edge a'
a' \<in> get_return_edges a
Ball (set xs) return_node
length ms = length (a # cs)
m = sourcenode a
length s = Suc (length cs)
length (transfer (kind a) s) = Suc (length (a # cs))

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # targetnode a' # xs,transfer (kind a) s)
[PROOF STEP]
by -(rule_tac a'="a'" in silent_move_call,fastforce+)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # targetnode a' # xs,transfer (kind a) s)

goal (1 subgoal):
 1. \<not> ((\<forall>m\<in>set xs. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<and> sourcenode a \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s)
        =slice_edges S (a#cs) as\<Rightarrow>* (ms'',s'')\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S (a # cs) as\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
proof(rule trans_observable_moves.cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
fix msx sx S' f
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
assume "targetnode a # ms = msx"
          and "transfer (kind a) s = sx" and "slice_edges S (a#cs) as = []"
          and [simp]:"ms'' = msx" "s'' = sx" and "length msx = length sx"
[PROOF STATE]
proof (state)
this:
targetnode a # ms = msx
transfer (kind a) s = sx
slice_edges S (a # cs) as = []
ms'' = msx
s'' = sx
length msx = length sx

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>slice_edges S cs (a#as) = slice_edges S (a#cs) as\<close>
          \<open>slice_edges S (a#cs) as = []\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = slice_edges S (a # cs) as
slice_edges S (a # cs) as = []
[PROOF STEP]
have "slice_edges S cs (a#as) = []"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = slice_edges S (a # cs) as
slice_edges S (a # cs) as = []

goal (1 subgoal):
 1. slice_edges S cs (a # as) = []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = []

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>length ms = length (a#cs)\<close> \<open>length s = Suc (length cs)\<close>
[PROOF STATE]
proof (chain)
picking this:
length ms = length (a # cs)
length s = Suc (length cs)
slice_edges S cs (a # as) = []
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) =slice_edges S cs (a#as)\<Rightarrow>*
                        (sourcenode a#xs,s)"
[PROOF STATE]
proof (prove)
using this:
length ms = length (a # cs)
length s = Suc (length cs)
slice_edges S cs (a # as) = []

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s)
[PROOF STEP]
by(fastforce intro:tom_Nil)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s)

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s)

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')\<close> \<open>targetnode a # ms = msx\<close>
          \<open>transfer (kind a) s = sx\<close> \<open>ms'' = msx\<close> \<open>s'' = sx\<close> \<open>x = targetnode a'\<close>
          \<open>S,kind \<turnstile> (sourcenode a#xs,s) -a\<rightarrow>\<^sub>\<tau>
          (targetnode a#targetnode a'#xs,transfer (kind a) s)\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
targetnode a # ms = msx
transfer (kind a) s = sx
ms'' = msx
s'' = sx
x = targetnode a'
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # targetnode a' # xs,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) =a#as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
targetnode a # ms = msx
transfer (kind a) s = sx
ms'' = msx
s'' = sx
x = targetnode a'
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # targetnode a' # xs,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
[PROOF STEP]
by(auto intro:silent_moves_Cons)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from this \<open>valid_edge a\<close>
          \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close>
          \<open>xs = targetnodes rs\<close> \<open>valid_return_list rs m\<close> \<open>length rs = length cs\<close>
          \<open>length s = Suc (length cs)\<close> \<open>m = sourcenode a\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
valid_edge a
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
xs = targetnodes rs
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)
m = sourcenode a
[PROOF STEP]
have "sourcenode a -a#as'\<rightarrow>* m'" and "valid_path_aux cs (a#as')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
valid_edge a
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
xs = targetnodes rs
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)
m = sourcenode a

goal (1 subgoal):
 1. sourcenode a -a # as'\<rightarrow>* m' &&& valid_path_aux cs (a # as')
[PROOF STEP]
by -(rule silent_moves_vpa_path,(fastforce simp:targetnodes_def)+)+
[PROOF STATE]
proof (state)
this:
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using \<open>m = sourcenode a\<close> \<open>length ms = length (a#cs)\<close>
          \<open>\<forall>i<length (a#cs). call_of_return_node (ms ! i) (sourcenode ((a#cs) ! i))\<close>
          \<open>slice_edges S cs (a#as) = []\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
          \<open>S,kind \<turnstile> (sourcenode a#xs,s) =a#as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')\<close>
          \<open>xs = targetnodes rs\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')
m = sourcenode a
length ms = length (a # cs)
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
slice_edges S cs (a # as) = []
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
xs = targetnodes rs

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="xs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length (a # cs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S cs (a # as) = []; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); xs = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="sourcenode a#xs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length (a # cs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S cs (a # as) = []; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); xs = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s'') \<and> S,kind \<turnstile> (sourcenode a # xs,s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length (a # cs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S cs (a # as) = []; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); xs = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s) \<and> S,kind \<turnstile> (sourcenode a # xs,s) =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length (a # cs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S cs (a # as) = []; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); xs = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s) \<and> S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ a # as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length (a # cs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S cs (a # as) = []; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); xs = targetnodes rs\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s) \<and> S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ a # as')
[PROOF STEP]
apply(rule_tac x="[]" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length (a # cs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S cs (a # as) = []; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); xs = targetnodes rs\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # xs,s) \<and> S,kind \<turnstile> (sourcenode a # xs,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs [] \<and> m -[] @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs ([] @ a # as')
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
fix S' f msx sx asx msx' sx' asx' msx'' sx''
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
assume [simp]:"S = S'" and "kind = f" and "targetnode a # ms = msx"
          and "transfer (kind a) s = sx"
          and "slice_edges S (a#cs) as = last asx # asx'"
          and "ms'' = msx''" and "s'' = sx''"
          and "S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')"
          and "S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')"
[PROOF STATE]
proof (state)
this:
S = S'
kind = f
targetnode a # ms = msx
transfer (kind a) s = sx
slice_edges S (a # cs) as = last asx # asx'
ms'' = msx''
s'' = sx''
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>kind = f\<close>
[PROOF STATE]
proof (chain)
picking this:
kind = f
[PROOF STEP]
have [simp]:"f = kind"
[PROOF STATE]
proof (prove)
using this:
kind = f

goal (1 subgoal):
 1. f = kind
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f = kind

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (sourcenode a#xs,s) -a\<rightarrow>\<^sub>\<tau>
          (targetnode a#targetnode a'#xs,transfer (kind a) s)\<close>
          \<open>S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')\<close> \<open>x = targetnode a'\<close>
          \<open>transfer (kind a) s = sx\<close> \<open>targetnode a # ms = msx\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # targetnode a' # xs,transfer (kind a) s)
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
x = targetnode a'
transfer (kind a) s = sx
targetnode a # ms = msx
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) =a#asx\<Rightarrow> (msx',sx')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # targetnode a' # xs,transfer (kind a) s)
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
x = targetnode a'
transfer (kind a) s = sx
targetnode a # ms = msx

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) =a # asx\<Rightarrow> (msx',sx')
[PROOF STEP]
by(auto intro:silent_move_observable_moves)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =a # asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')\<close> \<open>ms'' = msx''\<close> \<open>s'' = sx''\<close>
[PROOF STATE]
proof (chain)
picking this:
S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')
ms'' = msx''
s'' = sx''
S,kind \<turnstile> (sourcenode a # xs,s) =a # asx\<Rightarrow> (msx',sx')
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#xs,s) =last (a#asx)#asx'\<Rightarrow>* (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
S',f \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')
ms'' = msx''
s'' = sx''
S,kind \<turnstile> (sourcenode a # xs,s) =a # asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by(fastforce intro:trans_observable_moves.tom_Cons)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')\<close>
[PROOF STATE]
proof (chain)
picking this:
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
[PROOF STEP]
have "asx \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
S',f \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. asx \<noteq> []
[PROOF STEP]
by(fastforce elim:observable_moves.cases)
[PROOF STATE]
proof (state)
this:
asx \<noteq> []

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>slice_edges S cs (a#as) = slice_edges S (a#cs) as\<close>
          \<open>slice_edges S (a#cs) as = last asx # asx'\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = slice_edges S (a # cs) as
slice_edges S (a # cs) as = last asx # asx'
asx \<noteq> []
[PROOF STEP]
have "slice_edges S cs (a#as) = last (a#asx)#asx'"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = slice_edges S (a # cs) as
slice_edges S (a # cs) as = last asx # asx'
asx \<noteq> []

goal (1 subgoal):
 1. slice_edges S cs (a # as) = last (a # asx) # asx'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = last (a # asx) # asx'

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = last (a # asx) # asx'

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<not> slice_edge S cs a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
          \<open>slice_edges S (a#cs) as = slice_edges S (a#cs) as''\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> slice_edge S cs a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
slice_edges S (a # cs) as = slice_edges S (a # cs) as''
[PROOF STEP]
have "slice_edges S cs (a # as) = slice_edges S cs (a # as'')"
[PROOF STATE]
proof (prove)
using this:
\<not> slice_edge S cs a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
slice_edges S (a # cs) as = slice_edges S (a # cs) as''

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S (a # cs) as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using paths \<open>m = sourcenode a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close>
          \<open>length ms = length (a#cs)\<close> \<open>xs = targetnodes rs\<close> \<open>valid_edge a\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes (a' # rs)
\<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i))
slice_edges S (a # cs) as = slice_edges S (a # cs) as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux (a # cs) (as'' @ as')
m = sourcenode a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
length ms = length (a # cs)
xs = targetnodes rs
valid_edge a

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="xs" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # xs,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes (a' # rs); \<forall>i<length (a # cs). call_of_return_node (ms ! i) (sourcenode ((a # cs) ! i)); slice_edges S (a # cs) as = slice_edges S (a # cs) as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux (a # cs) (as'' @ as'); m = sourcenode a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; length ms = length (a # cs); xs = targetnodes rs; valid_edge a\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # xs,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> xs = targetnodes rs \<and> length xs = length cs \<and> (\<forall>i<length cs. call_of_return_node (xs ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs (a # as'') \<and> m -(a # as'') @ as'\<rightarrow>* m' \<and> valid_path_aux cs ((a # as'') @ as')
[PROOF STEP]
by(auto intro:Cons_path simp:targetnodes_def)
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (2 subgoals):
 1. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case (vpa_ReturnEmpty cs a as Q p f)
[PROOF STATE]
proof (state)
this:
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = []
valid_path_aux [] as
\<lbrakk>?m -as\<rightarrow>* m'; preds (kinds as) ?s; transfers (kinds as) ?s = s'; valid_call_list [] ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges ([] ! i); valid_return_list ?rs ?m; length ?rs = length []; length ?s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (?m # ms,?s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes ?rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> ?m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as')
m -a # as\<rightarrow>* m'
preds (kinds (a # as)) s
transfers (kinds (a # as)) s = s'
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)

goal (2 subgoals):
 1. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>preds (kinds (a # as)) s\<close> \<open>length s = Suc (length cs)\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
      \<open>cs = []\<close>
[PROOF STATE]
proof (chain)
picking this:
preds (kinds (a # as)) s
length s = Suc (length cs)
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = []
[PROOF STEP]
have False
[PROOF STATE]
proof (prove)
using this:
preds (kinds (a # as)) s
length s = Suc (length cs)
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = []

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

goal (2 subgoals):
 1. \<And>cs a as Q p f m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = []; valid_path_aux [] as; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list [] m; \<forall>i<length rs. rs ! i \<in> get_return_edges ([] ! i); valid_return_list rs m; length rs = length []; length s = Suc (length [])\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S [] as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length [] \<and> (\<forall>i<length []. call_of_return_node (ms ! i) (sourcenode ([] ! i))) \<and> slice_edges S [] as = slice_edges S [] as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux [] (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
False

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case (vpa_ReturnCons cs a as Q p f c' cs')
[PROOF STATE]
proof (state)
this:
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = c' # cs'
valid_path_aux cs' as
a \<in> get_return_edges c'
\<lbrakk>?m -as\<rightarrow>* m'; preds (kinds as) ?s; transfers (kinds as) ?s = s'; valid_call_list cs' ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (cs' ! i); valid_return_list ?rs ?m; length ?rs = length cs'; length ?s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (?m # ms,?s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes ?rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> ?m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as')
m -a # as\<rightarrow>* m'
preds (kinds (a # as)) s
transfers (kinds (a # as)) s = s'
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
note IH = \<open>\<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s';
      valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i);
      valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk>
      \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''.
      S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and>
      S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and>
      length ms = length cs' \<and>
      (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and>
      slice_edges S cs' as = slice_edges S cs' as'' \<and>
      m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as')\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>?m -as\<rightarrow>* m'; preds (kinds as) ?s; transfers (kinds as) ?s = s'; valid_call_list cs' ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (cs' ! i); valid_return_list ?rs ?m; length ?rs = length cs'; length ?s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (?m # ms,?s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes ?rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> ?m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as')

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>m -a # as\<rightarrow>* m'\<close>
[PROOF STATE]
proof (chain)
picking this:
m -a # as\<rightarrow>* m'
[PROOF STEP]
have "m = sourcenode a" and "valid_edge a"
      and "targetnode a -as\<rightarrow>* m'"
[PROOF STATE]
proof (prove)
using this:
m -a # as\<rightarrow>* m'

goal (1 subgoal):
 1. m = sourcenode a &&& valid_edge a &&& targetnode a -as\<rightarrow>* m'
[PROOF STEP]
by(auto elim:path_split_Cons)
[PROOF STATE]
proof (state)
this:
m = sourcenode a
valid_edge a
targetnode a -as\<rightarrow>* m'

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>preds (kinds (a # as)) s\<close>
[PROOF STATE]
proof (chain)
picking this:
preds (kinds (a # as)) s
[PROOF STEP]
have "pred (kind a) s"
      and "preds (kinds as) (transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
preds (kinds (a # as)) s

goal (1 subgoal):
 1. pred (kind a) s &&& preds (kinds as) (transfer (kind a) s)
[PROOF STEP]
by(auto simp:kinds_def)
[PROOF STATE]
proof (state)
this:
pred (kind a) s
preds (kinds as) (transfer (kind a) s)

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>transfers (kinds (a # as)) s = s'\<close>
[PROOF STATE]
proof (chain)
picking this:
transfers (kinds (a # as)) s = s'
[PROOF STEP]
have "transfers (kinds as) (transfer (kind a) s) = s'"
[PROOF STATE]
proof (prove)
using this:
transfers (kinds (a # as)) s = s'

goal (1 subgoal):
 1. transfers (kinds as) (transfer (kind a) s) = s'
[PROOF STEP]
by(fastforce simp:kinds_def)
[PROOF STATE]
proof (state)
this:
transfers (kinds as) (transfer (kind a) s) = s'

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_call_list cs m\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_call_list cs m
cs = c' # cs'
[PROOF STEP]
have "valid_edge c'"
[PROOF STATE]
proof (prove)
using this:
valid_call_list cs m
cs = c' # cs'

goal (1 subgoal):
 1. valid_edge c'
[PROOF STEP]
by(fastforce simp:valid_call_list_def)
[PROOF STATE]
proof (state)
this:
valid_edge c'

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge c'\<close> \<open>a \<in> get_return_edges c'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge c'
a \<in> get_return_edges c'
[PROOF STEP]
have "get_proc (sourcenode c') = get_proc (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge c'
a \<in> get_return_edges c'

goal (1 subgoal):
 1. get_proc (sourcenode c') = get_proc (targetnode a)
[PROOF STEP]
by(rule get_proc_get_return_edge)
[PROOF STATE]
proof (state)
this:
get_proc (sourcenode c') = get_proc (targetnode a)

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_call_list cs m\<close> \<open>cs = c' # cs'\<close>
      \<open>get_proc (sourcenode c') = get_proc (targetnode a)\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_call_list cs m
cs = c' # cs'
get_proc (sourcenode c') = get_proc (targetnode a)
[PROOF STEP]
have "valid_call_list cs' (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_call_list cs m
cs = c' # cs'
get_proc (sourcenode c') = get_proc (targetnode a)

goal (1 subgoal):
 1. valid_call_list cs' (targetnode a)
[PROOF STEP]
apply(clarsimp simp:valid_call_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs'a c cs''. \<lbrakk>\<forall>cs'aa ca. (\<exists>cs''a. c' # cs'a @ c # cs'' = cs'aa @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q r fs. kind ca = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs'aa of [] \<Rightarrow> m | a # list \<Rightarrow> last (sourcenodes cs'aa))\<^esub>fs); cs = c' # cs'a @ c # cs''; get_proc (sourcenode c') = get_proc (targetnode a); cs' = cs'a @ c # cs''\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs'a of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'a))\<^esub>fs)
[PROOF STEP]
apply(hypsubst_thin)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs'a ca. (\<exists>cs''a. c' # cs' @ c # cs'' = cs'a @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q r fs. kind ca = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs'a of [] \<Rightarrow> m | a # list \<Rightarrow> last (sourcenodes cs'a))\<^esub>fs); get_proc (sourcenode c') = get_proc (targetnode a)\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs)
[PROOF STEP]
apply(erule_tac x="c' # cs'" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>get_proc (sourcenode c') = get_proc (targetnode a); \<forall>ca. (\<exists>cs''a. c' # cs' @ c # cs'' = (c' # cs') @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q r fs. kind ca = Q:r\<hookrightarrow>\<^bsub>get_proc (case c' # cs' of [] \<Rightarrow> m | a # list \<Rightarrow> last (sourcenodes (c' # cs')))\<^esub>fs)\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q r fs. kind c = Q:r\<hookrightarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode a | a # list \<Rightarrow> last (sourcenodes cs'))\<^esub>fs)
[PROOF STEP]
by(case_tac cs')(auto simp:sourcenodes_def)
[PROOF STATE]
proof (state)
this:
valid_call_list cs' (targetnode a)

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>length rs = length cs\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
length rs = length cs
cs = c' # cs'
[PROOF STEP]
obtain r' rs'
      where [simp]:"rs = r'#rs'" and "length rs' = length cs'"
[PROOF STATE]
proof (prove)
using this:
length rs = length cs
cs = c' # cs'

goal (1 subgoal):
 1. (\<And>r' rs'. \<lbrakk>rs = r' # rs'; length rs' = length cs'\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases rs) auto
[PROOF STATE]
proof (state)
this:
rs = r' # rs'
length rs' = length cs'

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
cs = c' # cs'
[PROOF STEP]
have "\<forall>i<length rs'. rs' ! i \<in> get_return_edges (cs' ! i)"
      and "r' \<in> get_return_edges c'"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
cs = c' # cs'

goal (1 subgoal):
 1. \<forall>i<length rs'. rs' ! i \<in> get_return_edges (cs' ! i) &&& r' \<in> get_return_edges c'
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<forall>i<length rs'. rs' ! i \<in> get_return_edges (cs' ! i)
r' \<in> get_return_edges c'

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>valid_edge c'\<close> \<open>a \<in> get_return_edges c'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge c'
a \<in> get_return_edges c'
\<forall>i<length rs'. rs' ! i \<in> get_return_edges (cs' ! i)
r' \<in> get_return_edges c'
[PROOF STEP]
have [simp]:"a = r'"
[PROOF STATE]
proof (prove)
using this:
valid_edge c'
a \<in> get_return_edges c'
\<forall>i<length rs'. rs' ! i \<in> get_return_edges (cs' ! i)
r' \<in> get_return_edges c'

goal (1 subgoal):
 1. a = r'
[PROOF STEP]
by -(rule get_return_edges_unique)
[PROOF STATE]
proof (state)
this:
a = r'

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>valid_return_list rs m\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_return_list rs m
a = r'
[PROOF STEP]
have "valid_return_list rs' (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_return_list rs m
a = r'

goal (1 subgoal):
 1. valid_return_list rs' (targetnode a)
[PROOF STEP]
apply(clarsimp simp:valid_return_list_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>\<forall>cs'a ca. (\<exists>cs''a. r' # cs' @ c # cs'' = cs'a @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q f. kind ca = Q\<hookleftarrow>\<^bsub>get_proc (case cs'a of [] \<Rightarrow> m | a # list \<Rightarrow> last (targetnodes cs'a))\<^esub>f); rs' = cs' @ c # cs''\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode r' | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f)
[PROOF STEP]
apply(erule_tac x="r' # cs'" in allE)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>cs' c cs''. \<lbrakk>rs' = cs' @ c # cs''; \<forall>ca. (\<exists>cs''a. r' # cs' @ c # cs'' = (r' # cs') @ ca # cs''a) \<longrightarrow> valid_edge ca \<and> (\<exists>Q f. kind ca = Q\<hookleftarrow>\<^bsub>get_proc (case r' # cs' of [] \<Rightarrow> m | a # list \<Rightarrow> last (targetnodes (r' # cs')))\<^esub>f)\<rbrakk> \<Longrightarrow> valid_edge c \<and> (\<exists>Q f. kind c = Q\<hookleftarrow>\<^bsub>get_proc (case cs' of [] \<Rightarrow> targetnode r' | a # list \<Rightarrow> last (targetnodes cs'))\<^esub>f)
[PROOF STEP]
by(case_tac cs')(auto simp:targetnodes_def)
[PROOF STATE]
proof (state)
this:
valid_return_list rs' (targetnode a)

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>length s = Suc (length cs)\<close> \<open>cs = c' # cs'\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
[PROOF STATE]
proof (chain)
picking this:
length s = Suc (length cs)
cs = c' # cs'
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
[PROOF STEP]
have "length (transfer (kind a) s) = Suc (length cs')"
[PROOF STATE]
proof (prove)
using this:
length s = Suc (length cs)
cs = c' # cs'
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f

goal (1 subgoal):
 1. length (transfer (kind a) s) = Suc (length cs')
[PROOF STEP]
by(cases s)(auto,case_tac list,auto)
[PROOF STATE]
proof (state)
this:
length (transfer (kind a) s) = Suc (length cs')

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from IH[OF \<open>targetnode a -as\<rightarrow>* m'\<close> \<open>preds (kinds as) (transfer (kind a) s)\<close>
      \<open>transfers (kinds as) (transfer (kind a) s) = s'\<close>
      \<open>valid_call_list cs' (targetnode a)\<close>
      \<open>\<forall>i<length rs'. rs' ! i \<in> get_return_edges (cs' ! i)\<close>
      \<open>valid_return_list rs' (targetnode a)\<close> \<open>length rs' = length cs'\<close> this]
[PROOF STATE]
proof (chain)
picking this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs' \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> targetnode a -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as')
[PROOF STEP]
obtain ms ms'' s'' as' ms' as'' where "length ms = length cs'"
      and "S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s)
                     =slice_edges S cs' as\<Rightarrow>* (ms'',s'')"
      and paths:"S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')"
      "ms = targetnodes rs'"
      "\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))"
      "slice_edges S cs' as = slice_edges S cs' as''"
      "targetnode a -as'' @ as'\<rightarrow>* m'" "valid_path_aux cs' (as'' @ as')"
[PROOF STATE]
proof (prove)
using this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs' \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> targetnode a -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as')

goal (1 subgoal):
 1. (\<And>ms ms'' s'' as' ms' as''. \<lbrakk>length ms = length cs'; S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as')\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by blast
[PROOF STATE]
proof (state)
this:
length ms = length cs'
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs'
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
slice_edges S cs' as = slice_edges S cs' as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux cs' (as'' @ as')

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))\<close>
      \<open>length ms = length cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
length ms = length cs'
[PROOF STEP]
have "\<forall>mx \<in> set ms. return_node mx"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
length ms = length cs'

goal (1 subgoal):
 1. Ball (set ms) return_node
[PROOF STEP]
by(auto simp:in_set_conv_nth call_of_return_node_def)
[PROOF STATE]
proof (state)
this:
Ball (set ms) return_node

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>valid_edge c'\<close> \<open>a \<in> get_return_edges c'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
valid_edge c'
a \<in> get_return_edges c'
[PROOF STEP]
have "return_node (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
valid_edge c'
a \<in> get_return_edges c'

goal (1 subgoal):
 1. return_node (targetnode a)
[PROOF STEP]
by(fastforce simp:return_node_def)
[PROOF STATE]
proof (state)
this:
return_node (targetnode a)

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>valid_edge c'\<close> \<open>valid_edge a\<close> \<open>a \<in> get_return_edges c'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge c'
valid_edge a
a \<in> get_return_edges c'
return_node (targetnode a)
[PROOF STEP]
have "call_of_return_node (targetnode a) (sourcenode c')"
[PROOF STATE]
proof (prove)
using this:
valid_edge c'
valid_edge a
a \<in> get_return_edges c'
return_node (targetnode a)

goal (1 subgoal):
 1. call_of_return_node (targetnode a) (sourcenode c')
[PROOF STEP]
by(simp add:call_of_return_node_def) blast
[PROOF STATE]
proof (state)
this:
call_of_return_node (targetnode a) (sourcenode c')

goal (1 subgoal):
 1. \<And>cs a as Q p f c' cs' m s rs. \<lbrakk>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; cs = c' # cs'; valid_path_aux cs' as; a \<in> get_return_edges c'; \<And>m s rs. \<lbrakk>m -as\<rightarrow>* m'; preds (kinds as) s; transfers (kinds as) s = s'; valid_call_list cs' m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs' ! i); valid_return_list rs m; length rs = length cs'; length s = Suc (length cs')\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs' \<and> (\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))) \<and> slice_edges S cs' as = slice_edges S cs' as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs' (as'' @ as'); m -a # as\<rightarrow>* m'; preds (kinds (a # as)) s; transfers (kinds (a # as)) s = s'; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; length s = Suc (length cs)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
proof(cases "(\<forall>m \<in> set (targetnode a#ms). \<exists>m'. call_of_return_node m m' \<and>
        m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
then
[PROOF STATE]
proof (chain)
picking this:
\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
obtain x where "call_of_return_node (targetnode a) x"
        and "x \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. (\<And>x. \<lbrakk>call_of_return_node (targetnode a) x; x \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
call_of_return_node (targetnode a) x
x \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>call_of_return_node (targetnode a) (sourcenode c')\<close>
[PROOF STATE]
proof (chain)
picking this:
call_of_return_node (targetnode a) (sourcenode c')
call_of_return_node (targetnode a) x
x \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "sourcenode c' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>"
[PROOF STATE]
proof (prove)
using this:
call_of_return_node (targetnode a) (sourcenode c')
call_of_return_node (targetnode a) x
x \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. sourcenode c' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
sourcenode c' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with True \<open>\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))\<close>
        \<open>length ms = length cs'\<close> \<open>cs = c' # cs'\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
length ms = length cs'
cs = c' # cs'
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
sourcenode c' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "slice_edge S cs a"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
length ms = length cs'
cs = c' # cs'
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
sourcenode c' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. slice_edge S cs a
[PROOF STEP]
apply(auto simp:slice_edge_def in_set_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m' i. \<lbrakk>\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); length ms = length cs'; cs = c' # cs'; kind r' = Q\<hookleftarrow>\<^bsub>p\<^esub>f; sourcenode c' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; \<forall>m\<in>set ms. \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; call_of_return_node (targetnode r') m'; m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; i < length cs'\<rbrakk> \<Longrightarrow> sourcenode (cs' ! i) \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
by(erule_tac x="i" in allE) auto
[PROOF STATE]
proof (state)
this:
slice_edge S cs a

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = c' # cs'
slice_edge S cs a
[PROOF STEP]
have "slice_edges S cs (a#as) = a#slice_edges S cs' as"
[PROOF STATE]
proof (prove)
using this:
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = c' # cs'
slice_edge S cs a

goal (1 subgoal):
 1. slice_edges S cs (a # as) = a # slice_edges S cs' as
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = a # slice_edges S cs' as

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from True \<open>pred (kind a) s\<close> \<open>valid_edge a\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
        \<open>\<forall>mx \<in> set ms. return_node mx\<close> \<open>length ms = length cs'\<close>
        \<open>length s = Suc (length cs)\<close> \<open>m = sourcenode a\<close>
        \<open>length (transfer (kind a) s) = Suc (length cs')\<close>
        \<open>return_node (targetnode a)\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
Ball (set ms) return_node
length ms = length cs'
length s = Suc (length cs)
m = sourcenode a
length (transfer (kind a) s) = Suc (length cs')
return_node (targetnode a)
cs = c' # cs'
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) -a\<rightarrow>
        (targetnode a#ms,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
pred (kind a) s
valid_edge a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
Ball (set ms) return_node
length ms = length cs'
length s = Suc (length cs)
m = sourcenode a
length (transfer (kind a) s) = Suc (length cs')
return_node (targetnode a)
cs = c' # cs'

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
by(auto intro!:observable_move_return)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>length ms = length cs'\<close> \<open>length s = Suc (length cs)\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
length ms = length cs'
length s = Suc (length cs)
cs = c' # cs'
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) =[]@[a]\<Rightarrow>
        (targetnode a#ms,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
length ms = length cs'
length s = Suc (length cs)
cs = c' # cs'
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
by(fastforce intro:observable_moves_snoc silent_moves_Nil)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s)
                     =slice_edges S cs' as\<Rightarrow>* (ms'',s'')\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'')
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s)
        =last [a]#slice_edges S cs' as\<Rightarrow>* (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'')
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =[] @ [a]\<Rightarrow> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last [a] # slice_edges S cs' as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by -(rule tom_Cons,auto)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last [a] # slice_edges S cs' as\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>slice_edges S cs (a#as) = a#slice_edges S cs' as\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = a # slice_edges S cs' as
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last [a] # slice_edges S cs' as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) =slice_edges S cs (a#as)\<Rightarrow>*
        (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = a # slice_edges S cs' as
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last [a] # slice_edges S cs' as\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>slice_edges S cs' as = slice_edges S cs' as''\<close>
        \<open>slice_edge S cs a\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs' as = slice_edges S cs' as''
slice_edge S cs a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = c' # cs'
[PROOF STEP]
have "slice_edges S cs (a#as) = slice_edges S cs (a#as'')"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs' as = slice_edges S cs' as''
slice_edge S cs a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = c' # cs'

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (2 subgoals):
 1. \<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using paths \<open>m = sourcenode a\<close> \<open>valid_edge a\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
          \<open>length ms = length cs'\<close> \<open>ms = targetnodes rs'\<close> \<open>cs = c' # cs'\<close>
          \<open>slice_edges S cs (a#as) = a#slice_edges S cs' as\<close>
          \<open>a \<in> get_return_edges c'\<close>
          \<open>call_of_return_node (targetnode a) (sourcenode c')\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs'
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
slice_edges S cs' as = slice_edges S cs' as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux cs' (as'' @ as')
m = sourcenode a
valid_edge a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
length ms = length cs'
ms = targetnodes rs'
cs = c' # cs'
slice_edges S cs (a # as) = a # slice_edges S cs' as
a \<in> get_return_edges c'
call_of_return_node (targetnode a) (sourcenode c')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="targetnode a#ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; cs = c' # cs'; slice_edges S cs (a # as) = a # slice_edges S cs' as; a \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; cs = c' # cs'; slice_edges S cs (a # as) = a # slice_edges S cs' as; a \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; cs = c' # cs'; slice_edges S cs (a # as) = a # slice_edges S cs' as; a \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; cs = c' # cs'; slice_edges S cs (a # as) = a # slice_edges S cs' as; a \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; cs = c' # cs'; slice_edges S cs (a # as) = a # slice_edges S cs' as; a \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; cs = c' # cs'; slice_edges S cs (a # as) = a # slice_edges S cs' as; a \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs (a # as'') \<and> m -(a # as'') @ as'\<rightarrow>* m' \<and> valid_path_aux cs ((a # as'') @ as')
[PROOF STEP]
apply(auto intro:Cons_path simp:targetnodes_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>S,kind \<turnstile> (sourcenode r' # targetnode r' # map targetnode rs',s) =r' # slice_edges S cs' as''\<Rightarrow>* (ms'',s''); slice_edges S (c' # cs') (r' # as) = r' # slice_edges S cs' as''; S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); \<forall>i<length cs'. call_of_return_node (targetnode (rs' ! i)) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode r' -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode r'; valid_edge r'; kind r' = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length rs' = length cs'; ms = map targetnode rs'; cs = c' # cs'; slice_edges S (c' # cs') (r' # as'') = r' # slice_edges S cs' as''; r' \<in> get_return_edges c'; call_of_return_node (targetnode r') (sourcenode c'); i < Suc (length cs')\<rbrakk> \<Longrightarrow> call_of_return_node ((targetnode r' # map targetnode rs') ! i) (sourcenode ((c' # cs') ! i))
[PROOF STEP]
by(case_tac i) auto
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
\<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>\<forall>mx \<in> set ms. return_node mx\<close> \<open>return_node (targetnode a)\<close>
[PROOF STATE]
proof (chain)
picking this:
Ball (set ms) return_node
return_node (targetnode a)
\<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
[PROOF STEP]
have "\<exists>m \<in> set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and>
        m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>"
[PROOF STATE]
proof (prove)
using this:
Ball (set ms) return_node
return_node (targetnode a)
\<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. \<exists>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
by(fastforce dest:return_node_call_of_return_node)
[PROOF STATE]
proof (state)
this:
\<exists>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))\<close>
        \<open>length ms = length cs'\<close> \<open>cs = c' # cs'\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
        \<open>call_of_return_node (targetnode a) (sourcenode c')\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
length ms = length cs'
cs = c' # cs'
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
call_of_return_node (targetnode a) (sourcenode c')
\<exists>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "\<not> slice_edge S cs a"
[PROOF STATE]
proof (prove)
using this:
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
length ms = length cs'
cs = c' # cs'
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
call_of_return_node (targetnode a) (sourcenode c')
\<exists>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<not> slice_edge S cs a
[PROOF STEP]
apply(auto simp:slice_edge_def in_set_conv_nth)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m' i. \<lbrakk>\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); length ms = length cs'; cs = c' # cs'; kind r' = Q\<hookleftarrow>\<^bsub>p\<^esub>f; call_of_return_node (targetnode r') (sourcenode c'); sourcenode c' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; call_of_return_node (ms ! i) m'; m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; i < length cs'\<rbrakk> \<Longrightarrow> \<exists>c\<in>set cs'. sourcenode c \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
by(erule_tac x="i" in allE) auto
[PROOF STATE]
proof (state)
this:
\<not> slice_edge S cs a

goal (1 subgoal):
 1. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = c' # cs'
\<not> slice_edge S cs a
[PROOF STEP]
have "slice_edges S cs (a#as) = slice_edges S cs' as"
[PROOF STATE]
proof (prove)
using this:
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
cs = c' # cs'
\<not> slice_edge S cs a

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs' as
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs' as

goal (1 subgoal):
 1. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>pred (kind a) s\<close> \<open>valid_edge a\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
        \<open>\<forall>mx \<in> set ms. return_node mx\<close> \<open>length ms = length cs'\<close>
        \<open>length s = Suc (length cs)\<close> \<open>m = sourcenode a\<close>
        \<open>length (transfer (kind a) s) = Suc (length cs')\<close>
        \<open>return_node (targetnode a)\<close> \<open>cs = c' # cs'\<close>
        \<open>\<exists>m \<in> set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and>
        m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close>
[PROOF STATE]
proof (chain)
picking this:
pred (kind a) s
valid_edge a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
Ball (set ms) return_node
length ms = length cs'
length s = Suc (length cs)
m = sourcenode a
length (transfer (kind a) s) = Suc (length cs')
return_node (targetnode a)
cs = c' # cs'
\<exists>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) -a\<rightarrow>\<^sub>\<tau>
        (targetnode a#ms,transfer (kind a) s)"
[PROOF STATE]
proof (prove)
using this:
pred (kind a) s
valid_edge a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
Ball (set ms) return_node
length ms = length cs'
length s = Suc (length cs)
m = sourcenode a
length (transfer (kind a) s) = Suc (length cs')
return_node (targetnode a)
cs = c' # cs'
\<exists>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
by(auto intro!:silent_move_return)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. \<not> (\<forall>m\<in>set (targetnode a # ms). \<exists>m'. call_of_return_node m m' \<and> m' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s)
                     =slice_edges S cs' as\<Rightarrow>* (ms'',s'')\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (targetnode a # ms,transfer (kind a) s) =slice_edges S cs' as\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
proof(rule trans_observable_moves.cases)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
fix msx sx S' f'
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
assume "targetnode a # ms = msx"
          and "transfer (kind a) s = sx" and "slice_edges S cs' as = []"
          and [simp]:"ms'' = msx" "s'' = sx" and "length msx = length sx"
[PROOF STATE]
proof (state)
this:
targetnode a # ms = msx
transfer (kind a) s = sx
slice_edges S cs' as = []
ms'' = msx
s'' = sx
length msx = length sx

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>slice_edges S cs (a#as) = slice_edges S cs' as\<close>
          \<open>slice_edges S cs' as = []\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = slice_edges S cs' as
slice_edges S cs' as = []
[PROOF STEP]
have "slice_edges S cs (a#as) = []"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = slice_edges S cs' as
slice_edges S cs' as = []

goal (1 subgoal):
 1. slice_edges S cs (a # as) = []
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = []

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>length ms = length cs'\<close> \<open>length s = Suc (length cs)\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
length ms = length cs'
length s = Suc (length cs)
cs = c' # cs'
slice_edges S cs (a # as) = []
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) =slice_edges S cs (a#as)\<Rightarrow>*
                        (sourcenode a#targetnode a#ms,s)"
[PROOF STATE]
proof (prove)
using this:
length ms = length cs'
length s = Suc (length cs)
cs = c' # cs'
slice_edges S cs (a # as) = []

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s)
[PROOF STEP]
by(fastforce intro:tom_Nil)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s)

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s)

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')\<close> \<open>targetnode a # ms = msx\<close>
          \<open>transfer (kind a) s = sx\<close> \<open>ms'' = msx\<close> \<open>s'' = sx\<close>
          \<open>S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) -a\<rightarrow>\<^sub>\<tau>
          (targetnode a#ms,transfer (kind a) s)\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
targetnode a # ms = msx
transfer (kind a) s = sx
ms'' = msx
s'' = sx
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) =a#as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
targetnode a # ms = msx
transfer (kind a) s = sx
ms'' = msx
s'' = sx
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
[PROOF STEP]
by(auto intro:silent_moves_Cons)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from this \<open>valid_edge a\<close>
          \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close>
          \<open>valid_return_list rs m\<close> \<open>length rs = length cs\<close>
          \<open>length s = Suc (length cs)\<close> \<open>m = sourcenode a\<close>
          \<open>ms = targetnodes rs'\<close> \<open>rs = r'#rs'\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
valid_edge a
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)
m = sourcenode a
ms = targetnodes rs'
rs = r' # rs'
cs = c' # cs'
[PROOF STEP]
have "sourcenode a -a#as'\<rightarrow>* m'" and "valid_path_aux cs (a#as')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
valid_edge a
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
length s = Suc (length cs)
m = sourcenode a
ms = targetnodes rs'
rs = r' # rs'
cs = c' # cs'

goal (1 subgoal):
 1. sourcenode a -a # as'\<rightarrow>* m' &&& valid_path_aux cs (a # as')
[PROOF STEP]
by -(rule silent_moves_vpa_path,(fastforce simp:targetnodes_def)+)+
[PROOF STATE]
proof (state)
this:
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')

goal (2 subgoals):
 1. \<And>msa s Sa f. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = []; ms'' = msa; s'' = s; length msa = length s\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
 2. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using \<open>m = sourcenode a\<close> \<open>length ms = length cs'\<close>
          \<open>\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))\<close>
          \<open>slice_edges S cs (a#as) = []\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
          \<open>S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) =a#as'\<Rightarrow>\<^sub>\<tau> (m'#ms',s')\<close>
          \<open>ms = targetnodes rs'\<close> \<open>rs = r'#rs'\<close> \<open>cs = c' # cs'\<close>
          \<open>call_of_return_node (targetnode a) (sourcenode c')\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s)
sourcenode a -a # as'\<rightarrow>* m'
valid_path_aux cs (a # as')
m = sourcenode a
length ms = length cs'
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
slice_edges S cs (a # as) = []
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs'
rs = r' # rs'
cs = c' # cs'
call_of_return_node (targetnode a) (sourcenode c')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="targetnode a#ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs (a # as) = []; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; rs = r' # rs'; cs = c' # cs'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="sourcenode a#targetnode a#ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs (a # as) = []; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; rs = r' # rs'; cs = c' # cs'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s'') \<and> S,kind \<turnstile> (sourcenode a # targetnode a # ms,s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs (a # as) = []; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; rs = r' # rs'; cs = c' # cs'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs (a # as) = []; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; rs = r' # rs'; cs = c' # cs'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ a # as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs (a # as) = []; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; rs = r' # rs'; cs = c' # cs'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ a # as')
[PROOF STEP]
apply(rule_tac x="[]" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s); sourcenode a -a # as'\<rightarrow>* m'; valid_path_aux cs (a # as'); m = sourcenode a; length ms = length cs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs (a # as) = []; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; rs = r' # rs'; cs = c' # cs'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (sourcenode a # targetnode a # ms,s) \<and> S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs [] \<and> m -[] @ a # as'\<rightarrow>* m' \<and> valid_path_aux cs ([] @ a # as')
[PROOF STEP]
apply(auto simp:targetnodes_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>S,kind \<turnstile> (sourcenode r' # targetnode r' # map targetnode rs',s) =[]\<Rightarrow>* (sourcenode r' # targetnode r' # map targetnode rs',s); sourcenode r' -r' # as'\<rightarrow>* m'; m = sourcenode r'; length rs' = length cs'; \<forall>i<length cs'. call_of_return_node (targetnode (rs' ! i)) (sourcenode (cs' ! i)); slice_edges S (c' # cs') (r' # as) = []; kind r' = Q\<hookleftarrow>\<^bsub>p\<^esub>f; S,kind \<turnstile> (sourcenode r' # targetnode r' # map targetnode rs',s) =r' # as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = map targetnode rs'; cs = c' # cs'; call_of_return_node (targetnode r') (sourcenode c'); r' \<in> get_return_edges c'; valid_path_aux cs' as'; i < Suc (length cs')\<rbrakk> \<Longrightarrow> call_of_return_node ((targetnode r' # map targetnode rs') ! i) (sourcenode ((c' # cs') ! i))
[PROOF STEP]
by(case_tac i) auto
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
fix S' f' msx sx asx msx' sx' asx' msx'' sx''
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
assume [simp]:"S = S'" and "kind = f'" and "targetnode a # ms = msx"
          and "transfer (kind a) s = sx"
          and "slice_edges S cs' as = last asx # asx'"
          and "ms'' = msx''" and "s'' = sx''"
          and "S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')"
          and "S',f' \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')"
[PROOF STATE]
proof (state)
this:
S = S'
kind = f'
targetnode a # ms = msx
transfer (kind a) s = sx
slice_edges S cs' as = last asx # asx'
ms'' = msx''
s'' = sx''
S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
S',f' \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>kind = f'\<close>
[PROOF STATE]
proof (chain)
picking this:
kind = f'
[PROOF STEP]
have [simp]:"f' = kind"
[PROOF STATE]
proof (prove)
using this:
kind = f'

goal (1 subgoal):
 1. f' = kind
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
f' = kind

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) -a\<rightarrow>\<^sub>\<tau>
          (targetnode a#ms,transfer (kind a) s)\<close>
          \<open>S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')\<close>
          \<open>transfer (kind a) s = sx\<close> \<open>targetnode a # ms = msx\<close>
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
transfer (kind a) s = sx
targetnode a # ms = msx
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) =a#asx\<Rightarrow> (msx',sx')"
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) -a\<rightarrow>\<^sub>\<tau> (targetnode a # ms,transfer (kind a) s)
S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
transfer (kind a) s = sx
targetnode a # ms = msx

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # asx\<Rightarrow> (msx',sx')
[PROOF STEP]
by(auto intro:silent_move_observable_moves)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>S',f' \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')\<close> \<open>ms'' = msx''\<close> \<open>s'' = sx''\<close>
[PROOF STATE]
proof (chain)
picking this:
S',f' \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')
ms'' = msx''
s'' = sx''
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # asx\<Rightarrow> (msx',sx')
[PROOF STEP]
have "S,kind \<turnstile> (sourcenode a#targetnode a#ms,s) =last (a#asx)#asx'\<Rightarrow>*
          (ms'',s'')"
[PROOF STATE]
proof (prove)
using this:
S',f' \<turnstile> (msx',sx') =asx'\<Rightarrow>* (msx'',sx'')
ms'' = msx''
s'' = sx''
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =a # asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
[PROOF STEP]
by(fastforce intro:trans_observable_moves.tom_Cons)
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')\<close>
[PROOF STATE]
proof (chain)
picking this:
S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')
[PROOF STEP]
have "asx \<noteq> []"
[PROOF STATE]
proof (prove)
using this:
S',f' \<turnstile> (msx,sx) =asx\<Rightarrow> (msx',sx')

goal (1 subgoal):
 1. asx \<noteq> []
[PROOF STEP]
by(fastforce elim:observable_moves.cases)
[PROOF STATE]
proof (state)
this:
asx \<noteq> []

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
with \<open>slice_edges S cs (a#as) = slice_edges S cs' as\<close>
          \<open>slice_edges S cs' as = last asx # asx'\<close>
[PROOF STATE]
proof (chain)
picking this:
slice_edges S cs (a # as) = slice_edges S cs' as
slice_edges S cs' as = last asx # asx'
asx \<noteq> []
[PROOF STEP]
have "slice_edges S cs (a#as) = last (a#asx)#asx'"
[PROOF STATE]
proof (prove)
using this:
slice_edges S cs (a # as) = slice_edges S cs' as
slice_edges S cs' as = last asx # asx'
asx \<noteq> []

goal (1 subgoal):
 1. slice_edges S cs (a # as) = last (a # asx) # asx'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = last (a # asx) # asx'

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = last (a # asx) # asx'

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
from \<open>\<not> slice_edge S cs a\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
          \<open>slice_edges S cs' as = slice_edges S cs' as''\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
\<not> slice_edge S cs a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
slice_edges S cs' as = slice_edges S cs' as''
cs = c' # cs'
[PROOF STEP]
have "slice_edges S cs (a # as) = slice_edges S cs (a # as'')"
[PROOF STATE]
proof (prove)
using this:
\<not> slice_edge S cs a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
slice_edges S cs' as = slice_edges S cs' as''
cs = c' # cs'

goal (1 subgoal):
 1. slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<And>Sa f msa s as ms' s'a as' ms''a s''a. \<lbrakk>S = Sa; kind = f; targetnode a # ms = msa; transfer (kind a) s = s; slice_edges S cs' as = last as # as'; ms'' = ms''a; s'' = s''a; Sa,f \<turnstile> (msa,s) =as\<Rightarrow> (ms',s'a); Sa,f \<turnstile> (ms',s'a) =as'\<Rightarrow>* (ms''a,s''a)\<rbrakk> \<Longrightarrow> \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
using paths \<open>m = sourcenode a\<close> \<open>kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f\<close>
          \<open>length ms = length cs'\<close> \<open>ms = targetnodes rs'\<close> \<open>valid_edge a\<close>
          \<open>rs = r'#rs'\<close> \<open>cs = c' # cs'\<close> \<open>r' \<in> get_return_edges c'\<close>
          \<open>call_of_return_node (targetnode a) (sourcenode c')\<close>
[PROOF STATE]
proof (prove)
using this:
S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s'')
slice_edges S cs (a # as) = last (a # asx) # asx'
slice_edges S cs (a # as) = slice_edges S cs (a # as'')
S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s')
ms = targetnodes rs'
\<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i))
slice_edges S cs' as = slice_edges S cs' as''
targetnode a -as'' @ as'\<rightarrow>* m'
valid_path_aux cs' (as'' @ as')
m = sourcenode a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f
length ms = length cs'
ms = targetnodes rs'
valid_edge a
rs = r' # rs'
cs = c' # cs'
r' \<in> get_return_edges c'
call_of_return_node (targetnode a) (sourcenode c')

goal (1 subgoal):
 1. \<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="targetnode a#ms" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; valid_edge a; rs = r' # rs'; cs = c' # cs'; r' \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>ms'' s'' as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; valid_edge a; rs = r' # rs'; cs = c' # cs'; r' \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>s'' as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="s''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; valid_edge a; rs = r' # rs'; cs = c' # cs'; r' \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>as' ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="as'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; valid_edge a; rs = r' # rs'; cs = c' # cs'; r' \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>ms' as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="ms'" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; valid_edge a; rs = r' # rs'; cs = c' # cs'; r' \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> \<exists>as''. S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')
[PROOF STEP]
apply(rule_tac x="a#as''" in exI)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,kind \<turnstile> (sourcenode a # targetnode a # ms,s) =last (a # asx) # asx'\<Rightarrow>* (ms'',s''); slice_edges S cs (a # as) = last (a # asx) # asx'; slice_edges S cs (a # as) = slice_edges S cs (a # as''); S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); ms = targetnodes rs'; \<forall>i<length cs'. call_of_return_node (ms ! i) (sourcenode (cs' ! i)); slice_edges S cs' as = slice_edges S cs' as''; targetnode a -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length ms = length cs'; ms = targetnodes rs'; valid_edge a; rs = r' # rs'; cs = c' # cs'; r' \<in> get_return_edges c'; call_of_return_node (targetnode a) (sourcenode c')\<rbrakk> \<Longrightarrow> S,kind \<turnstile> (m # targetnode a # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> targetnode a # ms = targetnodes rs \<and> length (targetnode a # ms) = length cs \<and> (\<forall>i<length cs. call_of_return_node ((targetnode a # ms) ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs (a # as'') \<and> m -(a # as'') @ as'\<rightarrow>* m' \<and> valid_path_aux cs ((a # as'') @ as')
[PROOF STEP]
apply(auto intro:Cons_path simp:targetnodes_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>i. \<lbrakk>S',kind \<turnstile> (sourcenode r' # targetnode r' # map targetnode rs',s) =slice_edges S' (c' # cs') (r' # as'')\<Rightarrow>* (ms'',s''); slice_edges S' (c' # cs') (r' # as) = slice_edges S' (c' # cs') (r' # as''); (if asx = [] then r' else last asx) # asx' = slice_edges S' (c' # cs') (r' # as''); S',kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); \<forall>i<length cs'. call_of_return_node (targetnode (rs' ! i)) (sourcenode (cs' ! i)); slice_edges S' cs' as = slice_edges S' cs' as''; targetnode r' -as'' @ as'\<rightarrow>* m'; valid_path_aux cs' (as'' @ as'); m = sourcenode r'; kind r' = Q\<hookleftarrow>\<^bsub>p\<^esub>f; length rs' = length cs'; ms = map targetnode rs'; valid_edge r'; cs = c' # cs'; r' \<in> get_return_edges c'; call_of_return_node (targetnode r') (sourcenode c'); i < Suc (length cs')\<rbrakk> \<Longrightarrow> call_of_return_node ((targetnode r' # map targetnode rs') ! i) (sourcenode ((c' # cs') ! i))
[PROOF STEP]
by(case_tac i) auto
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs (a # as)\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs (a # as) = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>ms ms'' s'' as' ms' as''. S,kind \<turnstile> (m # ms,s) =slice_edges S cs as\<Rightarrow>* (ms'',s'') \<and> S,kind \<turnstile> (ms'',s'') =as'\<Rightarrow>\<^sub>\<tau> (m' # ms',s') \<and> ms = targetnodes rs \<and> length ms = length cs \<and> (\<forall>i<length cs. call_of_return_node (ms ! i) (sourcenode (cs ! i))) \<and> slice_edges S cs as = slice_edges S cs as'' \<and> m -as'' @ as'\<rightarrow>* m' \<and> valid_path_aux cs (as'' @ as')

goal:
No subgoals!
[PROOF STEP]
qed