[STATEMENT]
lemma silent_moves_slpa_path:
  "\<lbrakk>S,f \<turnstile> (m#ms''@ms,s) =as\<Rightarrow>\<^sub>\<tau> (m'#ms',s'); valid_node m; valid_call_list cs m;
  \<forall>i < length rs. rs!i \<in> get_return_edges (cs!i); valid_return_list rs m;
  length rs = length cs; ms'' = targetnodes rs;
  \<forall>mx \<in> set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>;
  ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>);
  \<forall>mx \<in> set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk>
  \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<lbrakk>S,f \<turnstile> (m # ms'' @ ms,s) =as\<Rightarrow>\<^sub>\<tau> (m' # ms',s'); valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
proof(induct S f "m#ms''@ms" s as "m'#ms'" s' arbitrary:m ms'' ms cs rs
    rule:silent_moves.induct)
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>s S f ms'' ms cs rs. \<lbrakk>length (m' # ms'' @ ms) = length s; ms'' @ ms = ms'; valid_node m'; valid_call_list cs m'; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m'; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs [] \<and> upd_cs cs [] = [] \<and> m' -[]\<rightarrow>* m' \<and> ms = ms'
 2. \<And>S f s a ms'a s' as s'' m ms'' ms cs rs. \<lbrakk>S,f \<turnstile> (m # ms'' @ ms,s) -a\<rightarrow>\<^sub>\<tau> (ms'a,s'); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',s''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
case (silent_moves_Nil sx S f)
[PROOF STATE]
proof (state)
this:
length (m' # ms'' @ ms) = length sx
ms'' @ ms = ms'
valid_node m'
valid_call_list cs m'
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m'
length rs = length cs
ms'' = targetnodes rs
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<And>s S f ms'' ms cs rs. \<lbrakk>length (m' # ms'' @ ms) = length s; ms'' @ ms = ms'; valid_node m'; valid_call_list cs m'; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m'; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs [] \<and> upd_cs cs [] = [] \<and> m' -[]\<rightarrow>* m' \<and> ms = ms'
 2. \<And>S f s a ms'a s' as s'' m ms'' ms cs rs. \<lbrakk>S,f \<turnstile> (m # ms'' @ ms,s) -a\<rightarrow>\<^sub>\<tau> (ms'a,s'); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',s''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
length (m' # ms'' @ ms) = length sx
ms'' @ ms = ms'
valid_node m'
valid_call_list cs m'
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m'
length rs = length cs
ms'' = targetnodes rs
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. same_level_path_aux cs [] \<and> upd_cs cs [] = [] \<and> m' -[]\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
apply(cases ms'' rule:rev_cases)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<lbrakk>length (m' # ms'' @ ms) = length sx; ms'' @ ms = ms'; valid_node m'; valid_call_list cs m'; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m'; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' = []\<rbrakk> \<Longrightarrow> same_level_path_aux cs [] \<and> upd_cs cs [] = [] \<and> m' -[]\<rightarrow>* m' \<and> ms = ms'
 2. \<And>ys y. \<lbrakk>length (m' # ms'' @ ms) = length sx; ms'' @ ms = ms'; valid_node m'; valid_call_list cs m'; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m'; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' = ys @ [y]\<rbrakk> \<Longrightarrow> same_level_path_aux cs [] \<and> upd_cs cs [] = [] \<and> m' -[]\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
apply(auto intro:empty_path simp:targetnodes_def)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ys y mx'. \<lbrakk>Suc (length cs + length ms) = length sx; valid_node m'; valid_call_list cs m'; \<forall>i<length cs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m'; length rs = length cs; ys @ [y] = map targetnode rs; \<forall>mx\<in>targetnode ` set rs \<union> set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' = map targetnode rs; ms' = map targetnode rs @ ms; call_of_return_node (last (map targetnode rs)) mx'; mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> cs = []
 2. \<And>ys y mx'. \<lbrakk>Suc (length cs + length ms) = length sx; valid_node m'; valid_call_list cs m'; \<forall>i<length cs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m'; length rs = length cs; ys @ [y] = map targetnode rs; \<forall>mx\<in>targetnode ` set rs \<union> set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' = map targetnode rs; ms' = map targetnode rs @ ms; call_of_return_node (last (map targetnode rs)) mx'; mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> rs = []
[PROOF STEP]
by(cases rs rule:rev_cases,auto)+
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs [] \<and> upd_cs cs [] = [] \<and> m' -[]\<rightarrow>* m' \<and> ms = ms'

goal (1 subgoal):
 1. \<And>S f s a ms'a s' as s'' m ms'' ms cs rs. \<lbrakk>S,f \<turnstile> (m # ms'' @ ms,s) -a\<rightarrow>\<^sub>\<tau> (ms'a,s'); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',s''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>S f s a ms'a s' as s'' m ms'' ms cs rs. \<lbrakk>S,f \<turnstile> (m # ms'' @ ms,s) -a\<rightarrow>\<^sub>\<tau> (ms'a,s'); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',s''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
case (silent_moves_Cons S f sx a msx' sx' as sx'')
[PROOF STATE]
proof (state)
this:
S,f \<turnstile> (m # ms'' @ ms,sx) -a\<rightarrow>\<^sub>\<tau> (msx',sx')
S,f \<turnstile> (msx',sx') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx'')
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'
valid_node m
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
ms'' = targetnodes rs
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<And>S f s a ms'a s' as s'' m ms'' ms cs rs. \<lbrakk>S,f \<turnstile> (m # ms'' @ ms,s) -a\<rightarrow>\<^sub>\<tau> (ms'a,s'); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',s''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
thus ?case
[PROOF STATE]
proof (prove)
using this:
S,f \<turnstile> (m # ms'' @ ms,sx) -a\<rightarrow>\<^sub>\<tau> (msx',sx')
S,f \<turnstile> (msx',sx') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx'')
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'
valid_node m
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
ms'' = targetnodes rs
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
proof(induct _ _ "m#ms''@ms" _ _ _ _ rule:silent_move.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
case (silent_move_intra f a s s' S msx')
[PROOF STATE]
proof (state)
this:
pred (f a) s
transfer (f a) s = s'
valid_edge a
intra_kind (kind a)
(\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
Ball (set (tl (m # ms'' @ ms))) return_node
length s' = length s
length (m # ms'' @ ms) = length s
hd (m # ms'' @ ms) = sourcenode a
msx' = targetnode a # tl (m # ms'' @ ms)
S,f \<turnstile> (msx',s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx'')
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'
valid_node m
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
ms'' = targetnodes rs
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note IH = \<open>\<And>m ms'' ms cs rs. \<lbrakk>msx' = m # ms'' @ ms; valid_node m;
      valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i);
      valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs;
      \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>;
      ms'' \<noteq> [] \<longrightarrow>
        (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>);
      \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk>
      \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack = \<open>\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and>
      mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close>
[PROOF STATE]
proof (state)
this:
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack'' = \<open>ms'' \<noteq> [] \<longrightarrow>
      (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)\<close>
[PROOF STATE]
proof (state)
this:
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack' = \<open>\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and>
      mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close>
[PROOF STATE]
proof (state)
this:
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge a\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
[PROOF STEP]
have "valid_node (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge a

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

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>hd (m # ms'' @ ms) = sourcenode a\<close>
[PROOF STATE]
proof (chain)
picking this:
hd (m # ms'' @ ms) = sourcenode a
[PROOF STEP]
have "m = sourcenode a"
[PROOF STATE]
proof (prove)
using this:
hd (m # ms'' @ ms) = sourcenode a

goal (1 subgoal):
 1. m = sourcenode a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m = sourcenode a

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>msx' = targetnode a # tl (m # ms'' @ ms)\<close>
[PROOF STATE]
proof (chain)
picking this:
msx' = targetnode a # tl (m # ms'' @ ms)
[PROOF STEP]
have "msx' = targetnode a # ms'' @ ms"
[PROOF STATE]
proof (prove)
using this:
msx' = targetnode a # tl (m # ms'' @ ms)

goal (1 subgoal):
 1. msx' = targetnode a # ms'' @ ms
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
msx' = targetnode a # ms'' @ ms

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from IH[OF this \<open>valid_node (targetnode a)\<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>
      \<open>ms'' = targetnodes rs\<close> callstack callstack'' callstack']
[PROOF STATE]
proof (chain)
picking this:
same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> targetnode a -as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
have "same_level_path_aux cs as" and "upd_cs cs as = []"
      and "targetnode a -as\<rightarrow>* m'" and "ms = ms'"
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> targetnode a -as\<rightarrow>* m' \<and> ms = ms'

goal (1 subgoal):
 1. (same_level_path_aux cs as &&& upd_cs cs as = []) &&& targetnode a -as\<rightarrow>* m' &&& ms = ms'
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs as
upd_cs cs as = []
targetnode a -as\<rightarrow>* m'
ms = ms'

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>intra_kind (kind a)\<close> \<open>same_level_path_aux cs as\<close>
[PROOF STATE]
proof (chain)
picking this:
intra_kind (kind a)
same_level_path_aux cs as
[PROOF STEP]
have "same_level_path_aux cs (a # as)"
[PROOF STATE]
proof (prove)
using this:
intra_kind (kind a)
same_level_path_aux cs as

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

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs (a # as)

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>intra_kind (kind a)\<close> \<open>upd_cs cs as = []\<close>
[PROOF STATE]
proof (chain)
picking this:
intra_kind (kind a)
upd_cs cs as = []
[PROOF STEP]
have "upd_cs cs (a # as) = []"
[PROOF STATE]
proof (prove)
using this:
intra_kind (kind a)
upd_cs cs as = []

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

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
upd_cs cs (a # as) = []

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>m = sourcenode a\<close> \<open>targetnode a -as\<rightarrow>* m'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
m = sourcenode a
targetnode a -as\<rightarrow>* m'
[PROOF STEP]
have "m -a # as\<rightarrow>* m'"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
m = sourcenode a
targetnode a -as\<rightarrow>* m'

goal (1 subgoal):
 1. m -a # as\<rightarrow>* m'
[PROOF STEP]
by(fastforce intro:Cons_path)
[PROOF STATE]
proof (state)
this:
m -a # as\<rightarrow>* m'

goal (3 subgoals):
 1. \<And>f a s s' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; intra_kind (kind a); (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length s' = length s; length (m # ms'' @ ms) = length s; hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 3. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'

goal (1 subgoal):
 1. same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
using \<open>ms = ms'\<close>
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'
ms = ms'

goal (1 subgoal):
 1. same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
case (silent_move_call f a s s' Q r p fs a' S msx')
[PROOF STATE]
proof (state)
this:
pred (f a) s
transfer (f a) s = s'
valid_edge a
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
valid_edge a'
a' \<in> get_return_edges a
(\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
Ball (set (tl (m # ms'' @ ms))) return_node
length (m # ms'' @ ms) = length s
length s' = Suc (length s)
hd (m # ms'' @ ms) = sourcenode a
msx' = targetnode a # targetnode a' # tl (m # ms'' @ ms)
S,f \<turnstile> (msx',s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx'')
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'
valid_node m
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
ms'' = targetnodes rs
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note IH = \<open>\<And>m ms'' ms cs rs. \<lbrakk>msx' = m # ms'' @ ms; valid_node m; valid_call_list cs m;
      \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m;
      length rs = length cs; ms'' = targetnodes rs;
      \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>;
      ms'' \<noteq> [] \<longrightarrow>
        (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>);
      \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk>
      \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack = \<open>\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and>
      mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close>
[PROOF STATE]
proof (state)
this:
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack'' = \<open>ms'' \<noteq> [] \<longrightarrow>
      (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)\<close>
[PROOF STATE]
proof (state)
this:
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack' = \<open>\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and>
      mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close>
[PROOF STATE]
proof (state)
this:
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge a\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
[PROOF STEP]
have "valid_node (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge a

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

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>hd (m # ms'' @ ms) = sourcenode a\<close>
[PROOF STATE]
proof (chain)
picking this:
hd (m # ms'' @ ms) = sourcenode a
[PROOF STEP]
have "m = sourcenode a"
[PROOF STATE]
proof (prove)
using this:
hd (m # ms'' @ ms) = sourcenode a

goal (1 subgoal):
 1. m = sourcenode a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m = sourcenode a

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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'' a 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' = a # 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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close> \<open>a' \<in> get_return_edges a\<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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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'' a 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' = a # 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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>ms'' = targetnodes rs\<close>
[PROOF STATE]
proof (chain)
picking this:
ms'' = targetnodes rs
[PROOF STEP]
have "targetnode a' # ms'' = targetnodes (a'#rs)"
[PROOF STATE]
proof (prove)
using this:
ms'' = targetnodes rs

goal (1 subgoal):
 1. targetnode a' # ms'' = targetnodes (a' # rs)
[PROOF STEP]
by(simp add:targetnodes_def)
[PROOF STATE]
proof (state)
this:
targetnode a' # ms'' = targetnodes (a' # rs)

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>msx' = targetnode a # targetnode a' # tl (m # ms'' @ ms)\<close>
[PROOF STATE]
proof (chain)
picking this:
msx' = targetnode a # targetnode a' # tl (m # ms'' @ ms)
[PROOF STEP]
have "msx' = targetnode a # targetnode a' # ms'' @ ms"
[PROOF STATE]
proof (prove)
using this:
msx' = targetnode a # targetnode a' # tl (m # ms'' @ ms)

goal (1 subgoal):
 1. msx' = targetnode a # targetnode a' # ms'' @ ms
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
msx' = targetnode a # targetnode a' # ms'' @ ms

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
have "\<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and>
      mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
proof(cases "ms'' = []")
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. ms'' = [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
 2. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
case True
[PROOF STATE]
proof (state)
this:
ms'' = []

goal (2 subgoals):
 1. ms'' = [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
 2. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
with \<open>(\<exists>m\<in>set (tl (m # ms'' @ ms)).
        \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or>
        hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close> \<open>m = sourcenode a\<close> callstack
[PROOF STATE]
proof (chain)
picking this:
(\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
m = sourcenode a
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' = []
[PROOF STEP]
have "sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>"
[PROOF STATE]
proof (prove)
using this:
(\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
m = sourcenode a
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' = []

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

goal (2 subgoals):
 1. ms'' = [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
 2. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[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 (2 subgoals):
 1. ms'' = [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
 2. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
with \<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
valid_edge a'
[PROOF STEP]
have "call_of_return_node (targetnode a') (sourcenode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
a' \<in> get_return_edges a
valid_edge a'

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

goal (2 subgoals):
 1. ms'' = [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
 2. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
with \<open>sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close> True
[PROOF STATE]
proof (chain)
picking this:
sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' = []
call_of_return_node (targetnode a') (sourcenode a)
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
sourcenode a \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' = []
call_of_return_node (targetnode a') (sourcenode a)

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

goal (1 subgoal):
 1. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
case False
[PROOF STATE]
proof (state)
this:
ms'' \<noteq> []

goal (1 subgoal):
 1. ms'' \<noteq> [] \<Longrightarrow> \<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
[PROOF STEP]
with callstack''
[PROOF STATE]
proof (chain)
picking this:
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
ms'' \<noteq> []
[PROOF STEP]
show ?thesis
[PROOF STATE]
proof (prove)
using this:
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
ms'' \<noteq> []

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
\<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
hence "targetnode a' # ms'' \<noteq> [] \<longrightarrow>
      (\<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and>
      mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
\<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. targetnode a' # ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
targetnode a' # ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last (targetnode a' # ms'')) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from IH[OF _ \<open>valid_node (targetnode a)\<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>targetnode a' # ms'' = targetnodes (a'#rs)\<close> callstack this callstack']
      \<open>msx' = targetnode a # targetnode a' # ms'' @ ms\<close>
[PROOF STATE]
proof (chain)
picking this:
msx' = targetnode a # (targetnode a' # ms'') @ ms \<Longrightarrow> same_level_path_aux (a # cs) as \<and> upd_cs (a # cs) as = [] \<and> targetnode a -as\<rightarrow>* m' \<and> ms = ms'
msx' = targetnode a # targetnode a' # ms'' @ ms
[PROOF STEP]
have "same_level_path_aux (a # cs) as" and "upd_cs (a # cs) as = []"
      and "targetnode a -as\<rightarrow>* m'" and "ms = ms'"
[PROOF STATE]
proof (prove)
using this:
msx' = targetnode a # (targetnode a' # ms'') @ ms \<Longrightarrow> same_level_path_aux (a # cs) as \<and> upd_cs (a # cs) as = [] \<and> targetnode a -as\<rightarrow>* m' \<and> ms = ms'
msx' = targetnode a # targetnode a' # ms'' @ ms

goal (1 subgoal):
 1. (same_level_path_aux (a # cs) as &&& upd_cs (a # cs) as = []) &&& targetnode a -as\<rightarrow>* m' &&& ms = ms'
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
same_level_path_aux (a # cs) as
upd_cs (a # cs) as = []
targetnode a -as\<rightarrow>* m'
ms = ms'

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close> \<open>same_level_path_aux (a # cs) as\<close>
[PROOF STATE]
proof (chain)
picking this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
same_level_path_aux (a # cs) as
[PROOF STEP]
have "same_level_path_aux cs (a # as)"
[PROOF STATE]
proof (prove)
using this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
same_level_path_aux (a # cs) as

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

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs (a # as)

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs\<close> \<open>upd_cs (a # cs) as = []\<close>
[PROOF STATE]
proof (chain)
picking this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
upd_cs (a # cs) as = []
[PROOF STEP]
have "upd_cs cs (a # as) = []"
[PROOF STATE]
proof (prove)
using this:
kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs
upd_cs (a # cs) as = []

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

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
upd_cs cs (a # as) = []

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>m = sourcenode a\<close> \<open>targetnode a -as\<rightarrow>* m'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
m = sourcenode a
targetnode a -as\<rightarrow>* m'
[PROOF STEP]
have "m -a # as\<rightarrow>* m'"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
m = sourcenode a
targetnode a -as\<rightarrow>* m'

goal (1 subgoal):
 1. m -a # as\<rightarrow>* m'
[PROOF STEP]
by(fastforce intro:Cons_path)
[PROOF STATE]
proof (state)
this:
m -a # as\<rightarrow>* m'

goal (2 subgoals):
 1. \<And>f a s s' Q r p fs a' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q:r\<hookrightarrow>\<^bsub>p\<^esub>fs; valid_edge a'; a' \<in> get_return_edges a; (\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>) \<or> hd (m # ms'' @ ms) \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s' = Suc (length s); hd (m # ms'' @ ms) = sourcenode a; ms'a = targetnode a # targetnode a' # tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
 2. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'

goal (1 subgoal):
 1. same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
using \<open>ms = ms'\<close>
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'
ms = ms'

goal (1 subgoal):
 1. same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
case (silent_move_return f a s s' Q p f' S msx')
[PROOF STATE]
proof (state)
this:
pred (f a) s
transfer (f a) s = s'
valid_edge a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'
\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
Ball (set (tl (m # ms'' @ ms))) return_node
length (m # ms'' @ ms) = length s
length s = Suc (length s')
s' \<noteq> []
hd (m # ms'' @ ms) = sourcenode a
hd (tl (m # ms'' @ ms)) = targetnode a
msx' = tl (m # ms'' @ ms)
S,f \<turnstile> (msx',s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx'')
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'
valid_node m
valid_call_list cs m
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
valid_return_list rs m
length rs = length cs
ms'' = targetnodes rs
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note IH = \<open>\<And>m ms'' ms cs rs. \<lbrakk>msx' = m # ms'' @ ms; valid_node m;
      valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i);
      valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs;
      \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>;
      ms'' \<noteq> [] \<longrightarrow>
        (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>);
      \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk>
      \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'\<close>
[PROOF STATE]
proof (state)
this:
\<lbrakk>msx' = ?m # ?ms'' @ ?ms; valid_node ?m; valid_call_list ?cs ?m; \<forall>i<length ?rs. ?rs ! i \<in> get_return_edges (?cs ! i); valid_return_list ?rs ?m; length ?rs = length ?cs; ?ms'' = targetnodes ?rs; \<forall>mx\<in>set ?ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ?ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ?ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux ?cs as \<and> upd_cs ?cs as = [] \<and> ?m -as\<rightarrow>* m' \<and> ?ms = ms'

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack = \<open>\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and>
      mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close>
[PROOF STATE]
proof (state)
this:
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack'' = \<open>ms'' \<noteq> [] \<longrightarrow>
      (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)\<close>
[PROOF STATE]
proof (state)
this:
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
note callstack' = \<open>\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and>
      mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<close>
[PROOF STATE]
proof (state)
this:
\<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
have "ms'' \<noteq> []"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. ms'' \<noteq> []
[PROOF STEP]
proof
[PROOF STATE]
proof (state)
goal (1 subgoal):
 1. ms'' = [] \<Longrightarrow> False
[PROOF STEP]
assume "ms'' = []"
[PROOF STATE]
proof (state)
this:
ms'' = []

goal (1 subgoal):
 1. ms'' = [] \<Longrightarrow> False
[PROOF STEP]
with callstack
        \<open>\<exists>m\<in>set (tl (m # ms'' @ 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:
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' = []
[PROOF STEP]
show False
[PROOF STATE]
proof (prove)
using this:
\<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
\<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>
ms'' = []

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

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
ms'' \<noteq> []

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
with \<open>hd (tl (m # ms'' @ ms)) = targetnode a\<close>
[PROOF STATE]
proof (chain)
picking this:
hd (tl (m # ms'' @ ms)) = targetnode a
ms'' \<noteq> []
[PROOF STEP]
obtain xs where "ms'' = targetnode a # xs"
[PROOF STATE]
proof (prove)
using this:
hd (tl (m # ms'' @ ms)) = targetnode a
ms'' \<noteq> []

goal (1 subgoal):
 1. (\<And>xs. ms'' = targetnode a # xs \<Longrightarrow> thesis) \<Longrightarrow> thesis
[PROOF STEP]
by(cases ms'') auto
[PROOF STATE]
proof (state)
this:
ms'' = targetnode a # xs

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
with \<open>ms'' = targetnodes rs\<close>
[PROOF STATE]
proof (chain)
picking this:
ms'' = targetnodes rs
ms'' = targetnode a # xs
[PROOF STEP]
obtain r' rs' where "rs = r' # rs'"
      and "targetnode a = targetnode r'" and "xs = targetnodes rs'"
[PROOF STATE]
proof (prove)
using this:
ms'' = targetnodes rs
ms'' = targetnode a # xs

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>rs = r' # rs'\<close> \<open>length rs = length cs\<close>
[PROOF STATE]
proof (chain)
picking this:
rs = r' # rs'
length rs = length cs
[PROOF STEP]
obtain c' cs' where "cs = c' # cs'"
      and "length rs' = length cs'"
[PROOF STATE]
proof (prove)
using this:
rs = r' # rs'
length rs = length cs

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)\<close>
      \<open>rs = r' # rs'\<close> \<open>cs = c' # cs'\<close>
[PROOF STATE]
proof (chain)
picking this:
\<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i)
rs = r' # rs'
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)
rs = r' # rs'
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>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge a\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
[PROOF STEP]
have "valid_node (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge a

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>hd (m # ms'' @ ms) = sourcenode a\<close>
[PROOF STATE]
proof (chain)
picking this:
hd (m # ms'' @ ms) = sourcenode a
[PROOF STEP]
have "m = sourcenode a"
[PROOF STATE]
proof (prove)
using this:
hd (m # ms'' @ ms) = sourcenode a

goal (1 subgoal):
 1. m = sourcenode a
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
m = sourcenode a

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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]
obtain p' Q' r fs' where "valid_edge c'" and "kind c' = Q':r\<hookrightarrow>\<^bsub>p'\<^esub>fs'"
      and "p' = get_proc m"
[PROOF STATE]
proof (prove)
using this:
valid_call_list cs m
cs = c' # cs'

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
with \<open>m = sourcenode a\<close> \<open>p' = get_proc m\<close>
[PROOF STATE]
proof (chain)
picking this:
m = sourcenode a
p' = get_proc m
get_proc (sourcenode a) = p
[PROOF STEP]
have [simp]:"p' = p"
[PROOF STATE]
proof (prove)
using this:
m = sourcenode a
p' = get_proc m
get_proc (sourcenode a) = p

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge c'\<close> \<open>kind c' = Q':r\<hookrightarrow>\<^bsub>p'\<^esub>fs'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge c'
kind c' = Q':r\<hookrightarrow>\<^bsub>p'\<^esub>fs'
[PROOF STEP]
have "get_proc (targetnode c') = p"
[PROOF STATE]
proof (prove)
using this:
valid_edge c'
kind c' = Q':r\<hookrightarrow>\<^bsub>p'\<^esub>fs'

goal (1 subgoal):
 1. get_proc (targetnode c') = p
[PROOF STEP]
by(fastforce intro:get_proc_call)
[PROOF STATE]
proof (state)
this:
get_proc (targetnode c') = p

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

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge c'\<close> \<open>kind c' = Q':r\<hookrightarrow>\<^bsub>p'\<^esub>fs'\<close> \<open>r' \<in> get_return_edges c'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge c'
kind c' = Q':r\<hookrightarrow>\<^bsub>p'\<^esub>fs'
r' \<in> get_return_edges c'
[PROOF STEP]
obtain Q'' f'' where "kind r' = Q''\<hookleftarrow>\<^bsub>p\<^esub>f''"
[PROOF STATE]
proof (prove)
using this:
valid_edge c'
kind c' = Q':r\<hookrightarrow>\<^bsub>p'\<^esub>fs'
r' \<in> get_return_edges c'

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
with \<open>valid_edge r'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge r'
kind r' = Q''\<hookleftarrow>\<^bsub>p\<^esub>f''
[PROOF STEP]
have "get_proc (sourcenode r') = p"
[PROOF STATE]
proof (prove)
using this:
valid_edge r'
kind r' = Q''\<hookleftarrow>\<^bsub>p\<^esub>f''

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge r'\<close> \<open>kind r' = Q''\<hookleftarrow>\<^bsub>p\<^esub>f''\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge r'
kind r' = Q''\<hookleftarrow>\<^bsub>p\<^esub>f''
[PROOF STEP]
have "method_exit (sourcenode r')"
[PROOF STATE]
proof (prove)
using this:
valid_edge r'
kind r' = Q''\<hookleftarrow>\<^bsub>p\<^esub>f''

goal (1 subgoal):
 1. method_exit (sourcenode r')
[PROOF STEP]
by(fastforce simp:method_exit_def)
[PROOF STATE]
proof (state)
this:
method_exit (sourcenode r')

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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 "method_exit (sourcenode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'

goal (1 subgoal):
 1. method_exit (sourcenode a)
[PROOF STEP]
by(fastforce simp:method_exit_def)
[PROOF STATE]
proof (state)
this:
method_exit (sourcenode a)

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
with \<open>method_exit (sourcenode r')\<close> \<open>get_proc (sourcenode r') = p\<close>
      \<open>get_proc (sourcenode a) = p\<close>
[PROOF STATE]
proof (chain)
picking this:
method_exit (sourcenode r')
get_proc (sourcenode r') = p
get_proc (sourcenode a) = p
method_exit (sourcenode a)
[PROOF STEP]
have "sourcenode a = sourcenode r'"
[PROOF STATE]
proof (prove)
using this:
method_exit (sourcenode r')
get_proc (sourcenode r') = p
get_proc (sourcenode a) = p
method_exit (sourcenode a)

goal (1 subgoal):
 1. sourcenode a = sourcenode r'
[PROOF STEP]
by(fastforce intro:method_exit_unique)
[PROOF STATE]
proof (state)
this:
sourcenode a = sourcenode r'

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
with \<open>valid_edge a\<close> \<open>valid_edge r'\<close> \<open>targetnode a = targetnode r'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
valid_edge r'
targetnode a = targetnode r'
sourcenode a = sourcenode r'
[PROOF STEP]
have "a = r'"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
valid_edge r'
targetnode a = targetnode r'
sourcenode a = sourcenode r'

goal (1 subgoal):
 1. a = r'
[PROOF STEP]
by(fastforce intro:edge_det)
[PROOF STATE]
proof (state)
this:
a = r'

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge c'\<close> \<open>r' \<in> get_return_edges c'\<close> \<open>targetnode a = targetnode r'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge c'
r' \<in> get_return_edges c'
targetnode a = targetnode r'
[PROOF STEP]
have "get_proc (sourcenode c') = get_proc (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_edge c'
r' \<in> get_return_edges c'
targetnode a = targetnode r'

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[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>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_return_list rs m\<close> \<open>rs = r' # rs'\<close> \<open>targetnode a = targetnode r'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_return_list rs m
rs = r' # rs'
targetnode a = targetnode r'
[PROOF STEP]
have "valid_return_list rs' (targetnode a)"
[PROOF STATE]
proof (prove)
using this:
valid_return_list rs m
rs = r' # rs'
targetnode a = targetnode 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 = r' # cs' @ c # cs''; targetnode a = targetnode r'; 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 = r' # cs' @ c # cs''; targetnode a = targetnode r'; 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>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>msx' = tl (m # ms'' @ ms)\<close> \<open>ms'' = targetnode a # xs\<close>
[PROOF STATE]
proof (chain)
picking this:
msx' = tl (m # ms'' @ ms)
ms'' = targetnode a # xs
[PROOF STEP]
have "msx' = targetnode a # xs @ ms"
[PROOF STATE]
proof (prove)
using this:
msx' = tl (m # ms'' @ ms)
ms'' = targetnode a # xs

goal (1 subgoal):
 1. msx' = targetnode a # xs @ ms
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
msx' = targetnode a # xs @ ms

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from callstack'' \<open>ms'' = targetnode a # xs\<close>
[PROOF STATE]
proof (chain)
picking this:
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
ms'' = targetnode a # xs
[PROOF STEP]
have "xs \<noteq> [] \<longrightarrow>
      (\<exists>mx'. call_of_return_node (last xs) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)"
[PROOF STATE]
proof (prove)
using this:
ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
ms'' = targetnode a # xs

goal (1 subgoal):
 1. xs \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last xs) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)
[PROOF STEP]
by fastforce
[PROOF STATE]
proof (state)
this:
xs \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last xs) mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>)

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from IH[OF \<open>msx' = targetnode a # xs @ ms\<close> \<open>valid_node (targetnode a)\<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>
      \<open>xs = targetnodes rs'\<close> callstack this callstack']
[PROOF STATE]
proof (chain)
picking this:
same_level_path_aux cs' as \<and> upd_cs cs' as = [] \<and> targetnode a -as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
have "same_level_path_aux cs' as" and "upd_cs cs' as = []"
      and "targetnode a -as\<rightarrow>* m'" and "ms = ms'"
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs' as \<and> upd_cs cs' as = [] \<and> targetnode a -as\<rightarrow>* m' \<and> ms = ms'

goal (1 subgoal):
 1. (same_level_path_aux cs' as &&& upd_cs cs' as = []) &&& targetnode a -as\<rightarrow>* m' &&& ms = ms'
[PROOF STEP]
by simp_all
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs' as
upd_cs cs' as = []
targetnode a -as\<rightarrow>* m'
ms = ms'

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

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs (a # as)

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

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

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
upd_cs cs (a # as) = []

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
from \<open>valid_edge a\<close> \<open>m = sourcenode a\<close> \<open>targetnode a -as\<rightarrow>* m'\<close>
[PROOF STATE]
proof (chain)
picking this:
valid_edge a
m = sourcenode a
targetnode a -as\<rightarrow>* m'
[PROOF STEP]
have "m -a # as\<rightarrow>* m'"
[PROOF STATE]
proof (prove)
using this:
valid_edge a
m = sourcenode a
targetnode a -as\<rightarrow>* m'

goal (1 subgoal):
 1. m -a # as\<rightarrow>* m'
[PROOF STEP]
by(fastforce intro:Cons_path)
[PROOF STATE]
proof (state)
this:
m -a # as\<rightarrow>* m'

goal (1 subgoal):
 1. \<And>f a s s' Q p f' S ms'a. \<lbrakk>pred (f a) s; transfer (f a) s = s'; valid_edge a; kind a = Q\<hookleftarrow>\<^bsub>p\<^esub>f'; \<exists>m\<in>set (tl (m # ms'' @ ms)). \<exists>m'. call_of_return_node m m' \<and> m' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; Ball (set (tl (m # ms'' @ ms))) return_node; length (m # ms'' @ ms) = length s; length s = Suc (length s'); s' \<noteq> []; hd (m # ms'' @ ms) = sourcenode a; hd (tl (m # ms'' @ ms)) = targetnode a; ms'a = tl (m # ms'' @ ms); S,f \<turnstile> (ms'a,s') =as\<Rightarrow>\<^sub>\<tau> (m' # ms',sx''); \<And>m ms'' ms cs rs. \<lbrakk>ms'a = m # ms'' @ ms; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs as \<and> upd_cs cs as = [] \<and> m -as\<rightarrow>* m' \<and> ms = ms'; valid_node m; valid_call_list cs m; \<forall>i<length rs. rs ! i \<in> get_return_edges (cs ! i); valid_return_list rs m; length rs = length cs; ms'' = targetnodes rs; \<forall>mx\<in>set ms. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>; ms'' \<noteq> [] \<longrightarrow> (\<exists>mx'. call_of_return_node (last ms'') mx' \<and> mx' \<notin> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>); \<forall>mx\<in>set ms'. \<exists>mx'. call_of_return_node mx mx' \<and> mx' \<in> \<lfloor>HRB_slice S\<rfloor>\<^bsub>CFG\<^esub>\<rbrakk> \<Longrightarrow> same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'

goal (1 subgoal):
 1. same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
using \<open>ms = ms'\<close>
[PROOF STATE]
proof (prove)
using this:
same_level_path_aux cs (a # as)
upd_cs cs (a # as) = []
m -a # as\<rightarrow>* m'
ms = ms'

goal (1 subgoal):
 1. same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'
[PROOF STEP]
by simp
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'

goal:
No subgoals!
[PROOF STEP]
qed
[PROOF STATE]
proof (state)
this:
same_level_path_aux cs (a # as) \<and> upd_cs cs (a # as) = [] \<and> m -a # as\<rightarrow>* m' \<and> ms = ms'

goal:
No subgoals!
[PROOF STEP]
qed