[STATEMENT]
lemma snd_readVariableRecursive:
    assumes "v \<in> vars g" "n \<in> set (\<alpha>n g)" "finite (Mapping.keys phis)"
    "\<And>n. (n,v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1" "Mapping.lookup phis (Entry g,v) \<in> {None, Some []}"
    shows
      "phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)"
      "set ms \<subseteq> set (\<alpha>n g) \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis) &&& (set ms \<subseteq> set (\<alpha>n g) \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms)
[PROOF STEP]
using assms
[PROOF STATE]
proof (prove)
using this:
v \<in> vars g
n \<in> set (\<alpha>n g)
finite (Mapping.keys phis)
(?n2, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g ?n2) \<noteq> 1
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (1 subgoal):
 1. phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis) &&& (set ms \<subseteq> set (\<alpha>n g) \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms)
[PROOF STEP]
proof (induction g v n phis and g v n phis ms rule: readVariableRecursive_readArgs.induct)
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
case (1 g v n phis)
[PROOF STATE]
proof (state)
this:
\<lbrakk>v \<notin> defs g n; predecessors g n = ?x21.2 # ?x22.2; ?x22.2 = []; v \<in> vars g; ?x21.2 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {?x21.2} phis = snd (readVariableRecursive g v ?x21.2 phis)
\<lbrakk>v \<notin> defs g n; predecessors g n = ?x21.2 # ?x22.2; ?x22.2 = ?x21a2 # ?x22a2; Mapping.lookup phis (n, v) = None; ?x2 = Mapping.update (n, v) [] phis; set (?x21.2 # ?x21a2 # ?x22a2) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys ?x2); \<And>n. (n, v) \<in> Mapping.keys ?x2 \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup ?x2 (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (?x21.2 # ?x21a2 # ?x22a2)) ?x2, map (\<lambda>m. lookupDef g m v) (?x21.2 # ?x21a2 # ?x22a2)) = readArgs g v n ?x2 (?x21.2 # ?x21a2 # ?x22a2)
v \<in> vars g
n \<in> set (\<alpha>n g)
finite (Mapping.keys phis)
(?n2, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g ?n2) \<noteq> 1
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
note "1.prems"(1-3)[simp]
[PROOF STATE]
proof (state)
this:
v \<in> vars g
n \<in> set (\<alpha>n g)
finite (Mapping.keys phis)

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
note phis_wf = "1.prems"(4)[rule_format]
[PROOF STATE]
proof (state)
this:
(?n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g ?n) \<noteq> 1

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
from "1.prems"(5)
[PROOF STATE]
proof (chain)
picking this:
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
have a: "(Entry g,v) \<in> Mapping.keys phis \<Longrightarrow> Mapping.lookup phis (Entry g, v) = Some []"
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (1 subgoal):
 1. (Entry g, v) \<in> Mapping.keys phis \<Longrightarrow> Mapping.lookup phis (Entry g, v) = Some []
[PROOF STEP]
by (auto simp: keys_dom_lookup)
[PROOF STATE]
proof (state)
this:
(Entry g, v) \<in> Mapping.keys phis \<Longrightarrow> Mapping.lookup phis (Entry g, v) = Some []

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
have IH1: "\<And>m. v \<notin> defs g n \<Longrightarrow> predecessors g n = [m] \<Longrightarrow> phis'_aux g v {m} phis = snd (readVariableRecursive g v m phis)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> phis'_aux g v {m} phis = snd (readVariableRecursive g v m phis)
[PROOF STEP]
apply (rule "1.IH"[rule_format])
[PROOF STATE]
proof (prove)
goal (8 subgoals):
 1. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> v \<notin> defs g n
 2. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> predecessors g n = m # ?x22.0 m
 3. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> ?x22.0 m = []
 4. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> v \<in> vars g
 5. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> m \<in> set (\<alpha>n g)
 6. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> finite (Mapping.keys phis)
 7. \<And>m n. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]; (n, v) \<in> Mapping.keys phis\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
 8. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> Mapping.lookup phis (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
apply auto[4]
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> m \<in> set (\<alpha>n g)
 2. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> finite (Mapping.keys phis)
 3. \<And>m n. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]; (n, v) \<in> Mapping.keys phis\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
 4. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> Mapping.lookup phis (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
apply (rule_tac n'=n in predecessor_is_node; auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> finite (Mapping.keys phis)
 2. \<And>m n. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]; (n, v) \<in> Mapping.keys phis\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
 3. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> Mapping.lookup phis (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
using "1.prems"(5)
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (3 subgoals):
 1. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> finite (Mapping.keys phis)
 2. \<And>m n. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]; (n, v) \<in> Mapping.keys phis\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
 3. \<And>m. \<lbrakk>v \<notin> defs g n; predecessors g n = [m]\<rbrakk> \<Longrightarrow> Mapping.lookup phis (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
apply (auto dest: phis_wf)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
\<lbrakk>v \<notin> defs g n; predecessors g n = [?m2]\<rbrakk> \<Longrightarrow> phis'_aux g v {?m2} phis = snd (readVariableRecursive g v ?m2 phis)

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
\<lbrakk>v \<notin> defs g n; predecessors g n = [?m2]\<rbrakk> \<Longrightarrow> phis'_aux g v {?m2} phis = snd (readVariableRecursive g v ?m2 phis)

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
fix m\<^sub>1 m\<^sub>2 :: 'node
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
fix ms' :: "'node list"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
let ?ms = "m\<^sub>1#m\<^sub>2#ms'"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
let ?phis' = "Mapping.update (n,v) [] phis"
[PROOF STATE]
proof (state)
goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
assume asm: "v \<notin> defs g n" "predecessors g n = ?ms" "Mapping.lookup phis (n, v) = None"
[PROOF STATE]
proof (state)
this:
v \<notin> defs g n
predecessors g n = m\<^sub>1 # m\<^sub>2 # ms'
Mapping.lookup phis (n, v) = None

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
moreover
[PROOF STATE]
proof (state)
this:
v \<notin> defs g n
predecessors g n = m\<^sub>1 # m\<^sub>2 # ms'
Mapping.lookup phis (n, v) = None

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
have "set ?ms \<subseteq> set (\<alpha>n g)"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (m\<^sub>1 # m\<^sub>2 # ms') \<subseteq> set (\<alpha>n g)
[PROOF STEP]
by (rule subsetI, rule predecessor_is_node[of _ g n]; auto simp: asm(2))
[PROOF STATE]
proof (state)
this:
set (m\<^sub>1 # m\<^sub>2 # ms') \<subseteq> set (\<alpha>n g)

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
ultimately
[PROOF STATE]
proof (chain)
picking this:
v \<notin> defs g n
predecessors g n = m\<^sub>1 # m\<^sub>2 # ms'
Mapping.lookup phis (n, v) = None
set (m\<^sub>1 # m\<^sub>2 # ms') \<subseteq> set (\<alpha>n g)
[PROOF STEP]
have "readArgs g v n ?phis' ?ms = (phis'_aux g v (set ?ms) ?phis', map (\<lambda>m. lookupDef g m v) ?ms)"
[PROOF STATE]
proof (prove)
using this:
v \<notin> defs g n
predecessors g n = m\<^sub>1 # m\<^sub>2 # ms'
Mapping.lookup phis (n, v) = None
set (m\<^sub>1 # m\<^sub>2 # ms') \<subseteq> set (\<alpha>n g)

goal (1 subgoal):
 1. readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # m\<^sub>2 # ms') = (phis'_aux g v (set (m\<^sub>1 # m\<^sub>2 # ms')) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # m\<^sub>2 # ms'))
[PROOF STEP]
using "1.prems"(5)
[PROOF STATE]
proof (prove)
using this:
v \<notin> defs g n
predecessors g n = m\<^sub>1 # m\<^sub>2 # ms'
Mapping.lookup phis (n, v) = None
set (m\<^sub>1 # m\<^sub>2 # ms') \<subseteq> set (\<alpha>n g)
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (1 subgoal):
 1. readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # m\<^sub>2 # ms') = (phis'_aux g v (set (m\<^sub>1 # m\<^sub>2 # ms')) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # m\<^sub>2 # ms'))
[PROOF STEP]
by - (rule "1.IH"(2)[symmetric, rule_format]; auto dest: phis_wf simp: lookup_update_cases)
[PROOF STATE]
proof (state)
this:
readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # m\<^sub>2 # ms') = (phis'_aux g v (set (m\<^sub>1 # m\<^sub>2 # ms')) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # m\<^sub>2 # ms'))

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>v \<notin> defs g n; predecessors g n = ?m\<^sub>14 # ?m\<^sub>24 # ?ms'4; Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> readArgs g v n (Mapping.update (n, v) [] phis) (?m\<^sub>14 # ?m\<^sub>24 # ?ms'4) = (phis'_aux g v (set (?m\<^sub>14 # ?m\<^sub>24 # ?ms'4)) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (?m\<^sub>14 # ?m\<^sub>24 # ?ms'4))

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
note IH2 = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>v \<notin> defs g n; predecessors g n = ?m\<^sub>14 # ?m\<^sub>24 # ?ms'4; Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> readArgs g v n (Mapping.update (n, v) [] phis) (?m\<^sub>14 # ?m\<^sub>24 # ?ms'4) = (phis'_aux g v (set (?m\<^sub>14 # ?m\<^sub>24 # ?ms'4)) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (?m\<^sub>14 # ?m\<^sub>24 # ?ms'4))

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
note foldr_Cons[simp del] fold_Cons[simp del] list.map(2)[simp del] set_simps(2)[simp del]
[PROOF STATE]
proof (state)
this:
foldr (#) ?xs [] = ?xs
fold ?f (?x # ?xs) = (fold ?f ?xs \<circ>\<circ> ?f) ?x
map ?f (?x21.0 # ?x22.0) = ?f ?x21.0 # map ?f ?x22.0
(?A - ?B = ?A) = (?A \<inter> ?B = {})

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
have c: "\<And>f x. \<Union>(f ` {x}) = f x"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>f x. \<Union> (f ` {x}) = f x
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
\<Union> (?f2 ` {?x2}) = ?f2 ?x2

goal (3 subgoals):
 1. \<And>g v n phis. \<lbrakk>\<And>x21 x22. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = []; v \<in> vars g; x21 \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {x21} phis = snd (readVariableRecursive g v x21 phis); \<And>x21 x22 x21a x22a x. \<lbrakk>v \<notin> defs g n; predecessors g n = x21 # x22; x22 = x21a # x22a; Mapping.lookup phis (n, v) = None; x = Mapping.update (n, v) [] phis; set (x21 # x21a # x22a) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys x); \<And>n. (n, v) \<in> Mapping.keys x \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup x (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (x21 # x21a # x22a)) x, map (\<lambda>m. lookupDef g m v) (x21 # x21a # x22a)) = readArgs g v n x (x21 # x21a # x22a); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
 2. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 3. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)
[PROOF STEP]
unfolding phis'_aux_def c
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) n \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (readVariableRecursive g v n phis)
[PROOF STEP]
apply (subst readVariableRecursive.simps)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) n \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (subst phiDefNodes_aux.simps[abs_def])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (cases "predecessors g n")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. predecessors g n = [] \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
 2. \<And>a list. predecessors g n = a # list \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (auto simp: a Mapping_eq_lookup lookup_update_cases Entry_iff_unreachable[OF invar] split: list.split intro!: ext)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>a list. predecessors g n = a # list \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (rename_tac m\<^sub>1 ms)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 ms. predecessors g n = m\<^sub>1 # ms \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (case_tac ms)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 ms. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = []\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
 2. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (subst Mapping_eq_lookup)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 ms. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = []\<rbrakk> \<Longrightarrow> Mapping.lookup (Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2))) = Mapping.lookup (snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis)))
 2. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (intro ext)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 ms x. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = []\<rbrakk> \<Longrightarrow> Mapping.lookup (Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2))) x = Mapping.lookup (snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) x
 2. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (auto simp: fold_Cons list.map(2))[1]
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<in> Mapping.keys phis; v \<notin> defs g n\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 2. \<And>m\<^sub>1 a. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g a)) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, v)
 3. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 4. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 5. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (auto dest: phis_wf)[1]
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g a)) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, v)
 2. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 3. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 4. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (subst IH1[symmetric], assumption, assumption)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g a)) = Mapping.lookup (phis'_aux g v {m\<^sub>1} phis) (a, v)
 2. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 3. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 4. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (auto simp: phis'_aux_def)[1]
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1; a \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g a)) = Mapping.lookup phis (a, v)
 2. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 3. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 4. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (drule rev_subsetD, rule phiDefNodes_aux_unvisited_monotonic[where un'="[n\<leftarrow>\<alpha>n g . (n, v) \<notin> Mapping.keys phis]"]; auto)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 2. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 3. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (subst IH1[symmetric], assumption, assumption)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (phis'_aux g v {m\<^sub>1} phis) (a, b)
 2. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 3. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (auto simp: phis'_aux_def)[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (snd (readVariableRecursive g v m\<^sub>1 phis)) (a, b)
 2. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (subst IH1[symmetric], assumption, assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a b. \<lbrakk>predecessors g n = [m\<^sub>1]; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; a \<notin> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (a, b) = Mapping.lookup (phis'_aux g v {m\<^sub>1} phis) (a, b)
 2. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (auto simp: phis'_aux_def phiDefNodes_aux_single_pred)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 ms a list. \<lbrakk>predecessors g n = m\<^sub>1 # ms; ms = a # list\<rbrakk> \<Longrightarrow> Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> (if n \<notin> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) \<or> v \<in> defs g n then {} else fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (predecessors g n)) (if length (predecessors g n) \<noteq> 1 then {n} else {})) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2)) = snd (if v \<in> defs g n then ((v, n, SimpleDef), phis) else case predecessors g n of [] \<Rightarrow> ((v, n, PhiDef), Mapping.update (n, v) [] phis) | [m] \<Rightarrow> readVariableRecursive g v m phis | m # ab # lista \<Rightarrow> case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m # ab # lista) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))
[PROOF STEP]
apply (auto simp: Mapping_eq_lookup lookup_update_cases intro!: ext)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<in> Mapping.keys phis; v \<notin> defs g n\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (auto simp: keys_dom_lookup)[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, v)
 2. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (auto split: option.split prod.split)[1]
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa x1 x2. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup (Mapping.update (n, v) x2 x1) (aa, v)
 2. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (subst(asm) IH2, assumption, assumption, assumption)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa x1 x2. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; (phis'_aux g v (set (m\<^sub>1 # a # list)) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # a # list)) = (x1, x2); Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup (Mapping.update (n, v) x2 x1) (aa, v)
 2. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (erule fold_union_elem)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa x1 x2 ys. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; (phis'_aux g v (set (m\<^sub>1 # a # list)) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # a # list)) = (x1, x2); Mapping.lookup phis (n, v) = None; aa \<in> ys; ys \<in> set (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) \<union> {{n}}\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup (Mapping.update (n, v) x2 x1) (aa, v)
 2. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (auto simp: lookup_update_cases phis'_aux_def[abs_def])[1]
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m\<^sub>1; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; \<forall>x\<in>set list. aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) a; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; \<forall>x\<in>set list. aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa x. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) x; x \<in> set list; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; \<forall>x\<in>set list. aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 4. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 5. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 6. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (drule rev_subsetD, rule phiDefNodes_aux_unvisited_monotonic[where un'="[n'\<leftarrow>\<alpha>n g . n' \<noteq> n \<and> (n', v) \<notin> Mapping.keys phis]"]; auto)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) a; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; \<forall>x\<in>set list. aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 2. \<And>m\<^sub>1 a list aa x. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) x; x \<in> set list; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; \<forall>x\<in>set list. aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 5. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (drule rev_subsetD, rule phiDefNodes_aux_unvisited_monotonic[where un'="[n'\<leftarrow>\<alpha>n g . n' \<noteq> n \<and> (n', v) \<notin> Mapping.keys phis]"]; auto)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa x. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) x; x \<in> set list; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; \<forall>x\<in>set list. aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 2. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (rename_tac m)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa m. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m; m \<in> set list; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; \<forall>x\<in>set list. aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 2. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (erule_tac x=m in ballE)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>m\<^sub>1 a list aa m. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m; m \<in> set list; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 2. \<And>m\<^sub>1 a list aa m. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m; m \<in> set list; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; m \<notin> set list\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 5. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (drule rev_subsetD, rule phiDefNodes_aux_unvisited_monotonic[where un'="[n'\<leftarrow>\<alpha>n g . n' \<noteq> n \<and> (n', v) \<notin> Mapping.keys phis]"]; auto)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa m. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; Mapping.lookup phis (n, v) = None; aa \<in> phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))) m; m \<in> set list; n \<noteq> aa; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; aa \<notin> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; m \<notin> set list\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 2. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 2. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (subst(asm) IH2, assumption, assumption)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>Mapping.lookup phis (n, v) = Some x2a; predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (n, v) = None
 2. \<And>m\<^sub>1 a list aa x1 x2 x2a. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<in> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; (phis'_aux g v (set (m\<^sub>1 # a # list)) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # a # list)) = (x1, x2); Mapping.lookup phis (n, v) = Some x2a\<rbrakk> \<Longrightarrow> Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa)) = Mapping.lookup phis (aa, v)
 3. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 4. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (auto simp: keys_dom_lookup)[2]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
 2. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (auto split: option.split prod.split)[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa b x1 x2. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup x1 (aa, b)
 2. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (subst(asm) IH2, assumption, assumption, assumption)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa b x1 x2. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; b \<noteq> v; (phis'_aux g v (set (m\<^sub>1 # a # list)) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # a # list)) = (x1, x2); Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup x1 (aa, b)
 2. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (auto simp: lookup_update_neq phis'_aux_def)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 a list aa b. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (snd (case Mapping.lookup phis (n, v) of None \<Rightarrow> let phis = Mapping.update (n, v) [] phis; (phis, args) = readArgs g v n phis (m\<^sub>1 # a # list) in ((v, n, PhiDef), Mapping.update (n, v) args phis) | Some x \<Rightarrow> ((v, n, PhiDef), phis))) (aa, b)
[PROOF STEP]
apply (auto split: option.splits prod.splits)[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 a list aa b x1 x2. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; readArgs g v n (Mapping.update (n, v) [] phis) (m\<^sub>1 # a # list) = (x1, x2); Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (Mapping.update (n, v) x2 x1) (aa, b)
[PROOF STEP]
apply (subst(asm) IH2, assumption, assumption, assumption)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 a list aa b x1 x2. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (removeAll n (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)))) (m\<^sub>1 # a # list)) {n}; (phis'_aux g v (set (m\<^sub>1 # a # list)) (Mapping.update (n, v) [] phis), map (\<lambda>m. lookupDef g m v) (m\<^sub>1 # a # list)) = (x1, x2); Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, b) = Mapping.lookup (Mapping.update (n, v) x2 x1) (aa, b)
[PROOF STEP]
apply (auto simp: lookup_update_cases phis'_aux_def removeAll_filter_not_eq image_def split: if_split_asm)[1]
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; n \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> False
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 3. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 4. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (cut_tac fold_union_elemI)
[PROOF STATE]
proof (prove)
goal (6 subgoals):
 1. \<And>m\<^sub>1 a list. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; n \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; ?x385 m\<^sub>1 a list \<in> fold (\<union>) (?xss385 m\<^sub>1 a list) (?xs385 m\<^sub>1 a list)\<rbrakk> \<Longrightarrow> False
 2. \<And>m\<^sub>1 a list. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; n \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> ?x385 m\<^sub>1 a list \<in> ?ys385 m\<^sub>1 a list
 3. \<And>m\<^sub>1 a list. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; n \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None\<rbrakk> \<Longrightarrow> ?ys385 m\<^sub>1 a list \<in> set (?xss385 m\<^sub>1 a list) \<union> {?xs385 m\<^sub>1 a list}
 4. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 5. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 6. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply auto[3]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 3. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (cut_tac fold_union_elemI)
[PROOF STATE]
proof (prove)
goal (5 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; ?x401 m\<^sub>1 a list aa \<in> fold (\<union>) (?xss401 m\<^sub>1 a list aa) (?xs401 m\<^sub>1 a list aa)\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> ?x401 m\<^sub>1 a list aa \<in> ?ys401 m\<^sub>1 a list aa
 3. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> ?ys401 m\<^sub>1 a list aa \<in> set (?xss401 m\<^sub>1 a list aa) \<union> {?xs401 m\<^sub>1 a list aa}
 4. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 5. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> aa \<in> ?ys401 m\<^sub>1 a list aa
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> ?ys401 m\<^sub>1 a list aa \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
 3. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 4. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1 \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 3. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (subgoal_tac "[x\<leftarrow>\<alpha>n g . x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis] = [x\<leftarrow>\<alpha>n g . (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x]")
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1; filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)\<rbrakk> \<Longrightarrow> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1 \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)
 3. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 4. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 3. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (rule arg_cong2[where f=filter])
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) = (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x)
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m\<^sub>1\<rbrakk> \<Longrightarrow> \<alpha>n g = \<alpha>n g
 3. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 4. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply auto[2]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 2. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (cut_tac fold_union_elemI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; ?x479 m\<^sub>1 a list aa \<in> fold (\<union>) (?xss479 m\<^sub>1 a list aa) (?xs479 m\<^sub>1 a list aa)\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> ?x479 m\<^sub>1 a list aa \<in> ?ys479 m\<^sub>1 a list aa
 3. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> ?ys479 m\<^sub>1 a list aa \<in> set (?xss479 m\<^sub>1 a list aa) \<union> {?xs479 m\<^sub>1 a list aa}
 4. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> aa \<in> ?ys479 m\<^sub>1 a list aa
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> ?ys479 m\<^sub>1 a list aa \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
 3. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
 2. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (subgoal_tac "[x\<leftarrow>\<alpha>n g . x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis] = [x\<leftarrow>\<alpha>n g . (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x]")
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a; filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)\<rbrakk> \<Longrightarrow> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)
 3. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)
 2. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (rule arg_cong2[where f=filter])
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) = (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x)
 2. \<And>m\<^sub>1 a list aa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) a\<rbrakk> \<Longrightarrow> \<alpha>n g = \<alpha>n g
 3. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply auto[2]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
[PROOF STEP]
apply (cut_tac fold_union_elemI)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list; ?x557 m\<^sub>1 a list aa xa \<in> fold (\<union>) (?xss557 m\<^sub>1 a list aa xa) (?xs557 m\<^sub>1 a list aa xa)\<rbrakk> \<Longrightarrow> Mapping.lookup phis (aa, v) = Some (map (\<lambda>m. lookupDef g m v) (predecessors g aa))
 2. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> ?x557 m\<^sub>1 a list aa xa \<in> ?ys557 m\<^sub>1 a list aa xa
 3. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> ?ys557 m\<^sub>1 a list aa xa \<in> set (?xss557 m\<^sub>1 a list aa xa) \<union> {?xs557 m\<^sub>1 a list aa xa}
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> aa \<in> ?ys557 m\<^sub>1 a list aa xa
 2. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> ?ys557 m\<^sub>1 a list aa xa \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
[PROOF STEP]
apply assumption
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
[PROOF STEP]
apply (subgoal_tac "[x\<leftarrow>\<alpha>n g . x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis] = [x\<leftarrow>\<alpha>n g . (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x]")
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list; filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)\<rbrakk> \<Longrightarrow> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa \<in> set (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) \<union> {{n}}
 2. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)
[PROOF STEP]
apply auto[1]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> filter (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) (\<alpha>n g) = filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g)
[PROOF STEP]
apply (rule arg_cong2[where f=filter])
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> (\<lambda>x. x \<noteq> n \<and> (x, v) \<notin> Mapping.keys phis) = (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x)
 2. \<And>m\<^sub>1 a list aa xa. \<lbrakk>predecessors g n = m\<^sub>1 # a # list; (n, v) \<notin> Mapping.keys phis; v \<notin> defs g n; aa \<notin> fold (\<union>) (map (phiDefNodes_aux g v (filter (\<lambda>x. (x, v) \<notin> Mapping.keys phis \<and> n \<noteq> x) (\<alpha>n g))) (m\<^sub>1 # a # list)) {n}; Mapping.lookup phis (n, v) = None; n \<noteq> aa; aa \<in> phiDefNodes_aux g v (filter (\<lambda>n. n \<noteq> n \<and> (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) xa; xa \<in> set list\<rbrakk> \<Longrightarrow> \<alpha>n g = \<alpha>n g
[PROOF STEP]
apply auto[2]
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
phis'_aux g v {n} phis = snd (readVariableRecursive g v n phis)

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
next
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
case (3 g v n phis m ms)
[PROOF STATE]
proof (state)
this:
\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms
\<lbrakk>?x2 = readArgs g v n phis ms; (?xa2, ?y2) = ?x2; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys ?xa2); \<And>n. (n, v) \<in> Mapping.keys ?xa2 \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup ?xa2 (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} ?xa2 = snd (readVariableRecursive g v m ?xa2)
set (m # ms) \<subseteq> set (\<alpha>n g)
v \<in> vars g
n \<in> set (\<alpha>n g)
finite (Mapping.keys phis)
(?n2, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g ?n2) \<noteq> 1
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
note "3.prems"(2-4)[simp]
[PROOF STATE]
proof (state)
this:
v \<in> vars g
n \<in> set (\<alpha>n g)
finite (Mapping.keys phis)

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
from "3.prems"(1)
[PROOF STATE]
proof (chain)
picking this:
set (m # ms) \<subseteq> set (\<alpha>n g)
[PROOF STEP]
have[simp]: "m \<in> set (\<alpha>n g)"
[PROOF STATE]
proof (prove)
using this:
set (m # ms) \<subseteq> set (\<alpha>n g)

goal (1 subgoal):
 1. m \<in> set (\<alpha>n g)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
m \<in> set (\<alpha>n g)

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
from 3
[PROOF STATE]
proof (chain)
picking this:
\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms
\<lbrakk>?x2 = readArgs g v n phis ms; (?xa2, ?y2) = ?x2; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys ?xa2); \<And>n. (n, v) \<in> Mapping.keys ?xa2 \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup ?xa2 (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} ?xa2 = snd (readVariableRecursive g v m ?xa2)
set (m # ms) \<subseteq> set (\<alpha>n g)
v \<in> vars g
n \<in> set (\<alpha>n g)
finite (Mapping.keys phis)
(?n2, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g ?n2) \<noteq> 1
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
have IH1: "readArgs g v n phis ms = (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms)"
[PROOF STATE]
proof (prove)
using this:
\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms
\<lbrakk>?x2 = readArgs g v n phis ms; (?xa2, ?y2) = ?x2; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys ?xa2); \<And>n. (n, v) \<in> Mapping.keys ?xa2 \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup ?xa2 (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} ?xa2 = snd (readVariableRecursive g v m ?xa2)
set (m # ms) \<subseteq> set (\<alpha>n g)
v \<in> vars g
n \<in> set (\<alpha>n g)
finite (Mapping.keys phis)
(?n2, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g ?n2) \<noteq> 1
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (1 subgoal):
 1. readArgs g v n phis ms = (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms)
[PROOF STEP]
by auto
[PROOF STATE]
proof (state)
this:
readArgs g v n phis ms = (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms)

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
have IH2: "phis'_aux g v {m} (phis'_aux g v (set ms) phis) = snd (readVariableRecursive g v m (phis'_aux g v (set ms) phis))"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phis'_aux g v {m} (phis'_aux g v (set ms) phis) = snd (readVariableRecursive g v m (phis'_aux g v (set ms) phis))
[PROOF STEP]
apply (rule "3.IH"(2))
[PROOF STATE]
proof (prove)
goal (7 subgoals):
 1. ?x2 = readArgs g v n phis ms
 2. (phis'_aux g v (set ms) phis, ?y2) = ?x2
 3. v \<in> vars g
 4. m \<in> set (\<alpha>n g)
 5. finite (Mapping.keys (phis'_aux g v (set ms) phis))
 6. \<And>n. (n, v) \<in> Mapping.keys (phis'_aux g v (set ms) phis) \<Longrightarrow> length (predecessors g n) \<noteq> 1
 7. Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
apply (auto simp: IH1 intro: phis'_aux_finite)[5]
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>n. (n, v) \<in> Mapping.keys (phis'_aux g v (set ms) phis) \<Longrightarrow> length (predecessors g n) \<noteq> 1
 2. Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
apply (simp add: phis'_aux_def keys_dom_lookup dom_def split: if_split_asm)
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n. \<exists>x\<in>set ms. n \<in> phiDefNodes_aux g v (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) x \<Longrightarrow> length (predecessors g n) \<noteq> Suc 0
 2. \<And>n. \<lbrakk>\<forall>x\<in>set ms. n \<notin> phiDefNodes_aux g v (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) x; \<exists>y. Mapping.lookup phis (n, v) = Some y\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> Suc 0
 3. Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<in> {None, Some []}
[PROOF STEP]
apply safe
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>n x. \<lbrakk>x \<in> set ms; n \<in> phiDefNodes_aux g v (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) x; length (predecessors g n) = Suc 0\<rbrakk> \<Longrightarrow> False
 2. \<And>n y. \<lbrakk>\<forall>x\<in>set ms. n \<notin> phiDefNodes_aux g v (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) x; Mapping.lookup phis (n, v) = Some y; length (predecessors g n) = Suc 0\<rbrakk> \<Longrightarrow> False
 3. \<And>y. \<lbrakk>Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<notin> {}; Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some y\<rbrakk> \<Longrightarrow> Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some []
[PROOF STEP]
apply (erule phiDefNodes_auxE)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>n x. \<lbrakk>x \<in> set ms; length (predecessors g n) = Suc 0\<rbrakk> \<Longrightarrow> x \<in> set (\<alpha>n g)
 2. \<And>n x ns. \<lbrakk>x \<in> set ms; length (predecessors g n) = Suc 0; g \<turnstile> n-ns\<rightarrow>x; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> False
 3. \<And>n y. \<lbrakk>\<forall>x\<in>set ms. n \<notin> phiDefNodes_aux g v (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) x; Mapping.lookup phis (n, v) = Some y; length (predecessors g n) = Suc 0\<rbrakk> \<Longrightarrow> False
 4. \<And>y. \<lbrakk>Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<notin> {}; Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some y\<rbrakk> \<Longrightarrow> Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some []
[PROOF STEP]
using "3.prems"(1,5)
[PROOF STATE]
proof (prove)
using this:
set (m # ms) \<subseteq> set (\<alpha>n g)
(?n2, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g ?n2) \<noteq> 1

goal (4 subgoals):
 1. \<And>n x. \<lbrakk>x \<in> set ms; length (predecessors g n) = Suc 0\<rbrakk> \<Longrightarrow> x \<in> set (\<alpha>n g)
 2. \<And>n x ns. \<lbrakk>x \<in> set ms; length (predecessors g n) = Suc 0; g \<turnstile> n-ns\<rightarrow>x; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> False
 3. \<And>n y. \<lbrakk>\<forall>x\<in>set ms. n \<notin> phiDefNodes_aux g v (filter (\<lambda>n. Mapping.lookup phis (n, v) = None) (\<alpha>n g)) x; Mapping.lookup phis (n, v) = Some y; length (predecessors g n) = Suc 0\<rbrakk> \<Longrightarrow> False
 4. \<And>y. \<lbrakk>Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<notin> {}; Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some y\<rbrakk> \<Longrightarrow> Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some []
[PROOF STEP]
apply (auto simp: keys_dom_lookup)[3]
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>y. \<lbrakk>Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<notin> {}; Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some y\<rbrakk> \<Longrightarrow> Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some []
[PROOF STEP]
using "3.prems"(6)
[PROOF STATE]
proof (prove)
using this:
Mapping.lookup phis (Entry g, v) \<in> {None, Some []}

goal (1 subgoal):
 1. \<And>y. \<lbrakk>Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) \<notin> {}; Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some y\<rbrakk> \<Longrightarrow> Mapping.lookup (phis'_aux g v (set ms) phis) (Entry g, v) = Some []
[PROOF STEP]
apply (auto simp: phis'_aux_def split: if_split_asm)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
phis'_aux g v {m} (phis'_aux g v (set ms) phis) = snd (readVariableRecursive g v m (phis'_aux g v (set ms) phis))

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
have a: "phiDefNodes_aux g v [n\<leftarrow>\<alpha>n g . (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)] m \<subseteq> phiDefNodes_aux g v [n\<leftarrow>\<alpha>n g . (n, v) \<notin> Mapping.keys phis] m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m \<subseteq> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m
[PROOF STEP]
apply (rule phiDefNodes_aux_unvisited_monotonic)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) \<subseteq> set (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g))
[PROOF STEP]
by (auto dest: phis'_aux_keys_super[THEN subsetD])
[PROOF STATE]
proof (state)
this:
phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m \<subseteq> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
{
[PROOF STATE]
proof (state)
this:
phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m \<subseteq> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
fix n
[PROOF STATE]
proof (state)
goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
assume m:  "n \<in> phiDefNodes_aux g v [n\<leftarrow>\<alpha>n g . (n, v) \<notin> Mapping.keys phis] m" and
             ms: "\<forall>x\<in>set ms. n \<notin> phiDefNodes_aux g v [n\<leftarrow>\<alpha>n g . (n, v) \<notin> Mapping.keys phis] x"
[PROOF STATE]
proof (state)
this:
n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m
\<forall>x\<in>set ms. n \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
have "n \<in> phiDefNodes_aux g v [n\<leftarrow>\<alpha>n g . (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)] m"
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m
[PROOF STEP]
using m
[PROOF STATE]
proof (prove)
using this:
n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m

goal (1 subgoal):
 1. n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m
[PROOF STEP]
apply-
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m \<Longrightarrow> n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m
[PROOF STEP]
apply (erule phiDefNodes_auxE, simp)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m
[PROOF STEP]
apply (rule phiDefNodes_auxI)
[PROOF STATE]
proof (prove)
goal (4 subgoals):
 1. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> g \<turnstile> n-?ns4 ns\<rightarrow>m
 2. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) (?ns4 ns)
 3. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> \<forall>n\<in>set (?ns4 ns). v \<notin> defs g n
 4. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
[PROOF STEP]
apply (auto simp: phis'_aux_def keys_dom_lookup split: if_split_asm)[3]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ns x xa. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> False
 2. \<And>ns x y. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; \<forall>xa\<in>set ms. x \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; Mapping.lookup phis (x, v) = Some y\<rbrakk> \<Longrightarrow> False
 3. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
[PROOF STEP]
apply (drule phiDefNodes_aux_redirect)
[PROOF STATE]
proof (prove)
goal (9 subgoals):
 1. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> \<forall>n\<in>set ns. ?v62 ns x xa \<notin> defs g n
 2. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
 3. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> unvisitedPath (?un62 ns x xa) ns
 4. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> ?n'62 ns x xa \<in> set ns
 5. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> ?n'62 ns x xa \<in> phiDefNodes_aux g (?v62 ns x xa) (?un62 ns x xa) (?m'62 ns x xa)
 6. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> ?m'62 ns x xa \<in> set (\<alpha>n g)
 7. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; n \<in> phiDefNodes_aux g (?v62 ns x xa) (?un62 ns x xa) (?m'62 ns x xa)\<rbrakk> \<Longrightarrow> False
 8. \<And>ns x y. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; \<forall>xa\<in>set ms. x \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; Mapping.lookup phis (x, v) = Some y\<rbrakk> \<Longrightarrow> False
 9. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
[PROOF STEP]
using "3.prems"(1)
[PROOF STATE]
proof (prove)
using this:
set (m # ms) \<subseteq> set (\<alpha>n g)

goal (9 subgoals):
 1. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> \<forall>n\<in>set ns. ?v62 ns x xa \<notin> defs g n
 2. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
 3. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> unvisitedPath (?un62 ns x xa) ns
 4. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> ?n'62 ns x xa \<in> set ns
 5. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> ?n'62 ns x xa \<in> phiDefNodes_aux g (?v62 ns x xa) (?un62 ns x xa) (?m'62 ns x xa)
 6. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> ?m'62 ns x xa \<in> set (\<alpha>n g)
 7. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; n \<in> phiDefNodes_aux g (?v62 ns x xa) (?un62 ns x xa) (?m'62 ns x xa)\<rbrakk> \<Longrightarrow> False
 8. \<And>ns x y. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; \<forall>xa\<in>set ms. x \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; Mapping.lookup phis (x, v) = Some y\<rbrakk> \<Longrightarrow> False
 9. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
[PROOF STEP]
apply auto[6]
[PROOF STATE]
proof (prove)
goal (3 subgoals):
 1. \<And>ns x xa. \<lbrakk>\<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; xa \<in> set ms; x \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa\<rbrakk> \<Longrightarrow> False
 2. \<And>ns x y. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; \<forall>xa\<in>set ms. x \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; Mapping.lookup phis (x, v) = Some y\<rbrakk> \<Longrightarrow> False
 3. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
[PROOF STEP]
apply (rule ms[THEN ballE]; auto simp: keys_dom_lookup)
[PROOF STATE]
proof (prove)
goal (2 subgoals):
 1. \<And>ns x y. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> Suc 0; x \<in> set ns; distinct ns; set ns \<subseteq> {x \<in> set (\<alpha>n g). (x, v) \<notin> dom (Mapping.lookup phis)}; \<forall>xa\<in>set ms. x \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> dom (Mapping.lookup phis)) (\<alpha>n g)) xa; Mapping.lookup phis (x, v) = Some y\<rbrakk> \<Longrightarrow> False
 2. \<And>ns. \<lbrakk>g \<turnstile> n-ns\<rightarrow>m; \<forall>n\<in>set ns. v \<notin> defs g n; length (predecessors g n) \<noteq> 1; unvisitedPath (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ns\<rbrakk> \<Longrightarrow> length (predecessors g n) \<noteq> 1
[PROOF STEP]
apply auto
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
n \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
}
[PROOF STATE]
proof (state)
this:
\<lbrakk>?nb4 \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m; \<forall>x\<in>set ms. ?nb4 \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> ?nb4 \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
note b = this
[PROOF STATE]
proof (state)
this:
\<lbrakk>?nb4 \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m; \<forall>x\<in>set ms. ?nb4 \<notin> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x\<rbrakk> \<Longrightarrow> ?nb4 \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) m

goal (2 subgoals):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
 2. \<And>g v n phis m ms. \<lbrakk>\<lbrakk>set ms \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms) = readArgs g v n phis ms; \<And>x xa y. \<lbrakk>x = readArgs g v n phis ms; (xa, y) = x; v \<in> vars g; m \<in> set (\<alpha>n g); finite (Mapping.keys xa); \<And>n. (n, v) \<in> Mapping.keys xa \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup xa (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> phis'_aux g v {m} xa = snd (readVariableRecursive g v m xa); set (m # ms) \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
show ?case
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)
[PROOF STEP]
unfolding readArgs.simps phis'_aux_def
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Mapping (\<lambda>(ma, v\<^sub>2). if v\<^sub>2 = v \<and> ma \<in> \<Union> (phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ` set (m # ms)) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g ma)) else Mapping.lookup phis (ma, v\<^sub>2)), map (\<lambda>m. lookupDef g m v) (m # ms)) = (let (phis, args) = readArgs g v n phis ms; (v, phis) = readVariableRecursive g v m phis in (phis, v # args))
[PROOF STEP]
unfolding IH1
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. (Mapping (\<lambda>(ma, v\<^sub>2). if v\<^sub>2 = v \<and> ma \<in> \<Union> (phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ` set (m # ms)) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g ma)) else Mapping.lookup phis (ma, v\<^sub>2)), map (\<lambda>m. lookupDef g m v) (m # ms)) = (let (phis, args) = (phis'_aux g v (set ms) phis, map (\<lambda>m. lookupDef g m v) ms); (v, phis) = readVariableRecursive g v m phis in (phis, v # args))
[PROOF STEP]
apply (simp add: split_def Let_def IH2[symmetric])
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping (\<lambda>p. if snd p = v \<and> (fst p \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m \<or> (\<exists>x\<in>set ms. fst p \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x)) then Some (map (\<lambda>m. lookupDef g m v) (predecessors g (fst p))) else Mapping.lookup phis (fst p, snd p)) = phis'_aux g v {m} (phis'_aux g v (set ms) phis) \<and> lookupDef g m v = fst (readVariableRecursive g v m (phis'_aux g v (set ms) phis))
[PROOF STEP]
apply (subst phis'_aux_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping (\<lambda>p. if snd p = v \<and> (fst p \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m \<or> (\<exists>x\<in>set ms. fst p \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x)) then Some (map (\<lambda>m. lookupDef g m v) (predecessors g (fst p))) else Mapping.lookup phis (fst p, snd p)) = Mapping (\<lambda>(ma, v\<^sub>2). if v\<^sub>2 = v \<and> ma \<in> \<Union> (phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) ` {m}) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g ma)) else Mapping.lookup (phis'_aux g v (set ms) phis) (ma, v\<^sub>2)) \<and> lookupDef g m v = fst (readVariableRecursive g v m (phis'_aux g v (set ms) phis))
[PROOF STEP]
apply (subst(2) phis'_aux_def)
[PROOF STATE]
proof (prove)
goal (1 subgoal):
 1. Mapping (\<lambda>p. if snd p = v \<and> (fst p \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) m \<or> (\<exists>x\<in>set ms. fst p \<in> phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) x)) then Some (map (\<lambda>m. lookupDef g m v) (predecessors g (fst p))) else Mapping.lookup phis (fst p, snd p)) = Mapping (\<lambda>(ma, v\<^sub>2). if v\<^sub>2 = v \<and> ma \<in> \<Union> (phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys (phis'_aux g v (set ms) phis)) (\<alpha>n g)) ` {m}) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g ma)) else Mapping.lookup (Mapping (\<lambda>(m, v\<^sub>2). if v\<^sub>2 = v \<and> m \<in> \<Union> (phiDefNodes_aux g v (filter (\<lambda>n. (n, v) \<notin> Mapping.keys phis) (\<alpha>n g)) ` set ms) \<and> v \<in> vars g then Some (map (\<lambda>m. lookupDef g m v) (predecessors g m)) else Mapping.lookup phis (m, v\<^sub>2))) (ma, v\<^sub>2)) \<and> lookupDef g m v = fst (readVariableRecursive g v m (phis'_aux g v (set ms) phis))
[PROOF STEP]
apply (auto simp: Mapping_eq_lookup fst_readVariableRecursive split: prod.splits intro!: ext dest!: a[THEN subsetD] b)
[PROOF STATE]
proof (prove)
goal:
No subgoals!
[PROOF STEP]
done
[PROOF STATE]
proof (state)
this:
(phis'_aux g v (set (m # ms)) phis, map (\<lambda>m. lookupDef g m v) (m # ms)) = readArgs g v n phis (m # ms)

goal (1 subgoal):
 1. \<And>g v n phis. \<lbrakk>set [] \<subseteq> set (\<alpha>n g); v \<in> vars g; n \<in> set (\<alpha>n g); finite (Mapping.keys phis); \<And>n. (n, v) \<in> Mapping.keys phis \<Longrightarrow> length (predecessors g n) \<noteq> 1; Mapping.lookup phis (Entry g, v) \<in> {None, Some []}\<rbrakk> \<Longrightarrow> (phis'_aux g v (set []) phis, map (\<lambda>m. lookupDef g m v) []) = readArgs g v n phis []
[PROOF STEP]
qed (auto simp: readArgs.simps phis'_aux_def)