from nm ‹s = SubnetS s1 s2› have"netgmap sr (SubnetS s1 s2) = netmask (net_tree_ips (n1 ∥ n2)) (σ, ζ)"by simp hence"netgmap sr s1 = netmask (net_tree_ips n1) (σ, snd (netgmap sr s1))" using‹net_tree_ips n1 ∩ net_tree_ips n2 = {}›‹net_ips s1 = net_tree_ips n1› and‹net_ips s2 = net_tree_ips n2›by (rule netgmap_subnet_split1) with‹(s1, disconnect(i, i'), s1') ∈ trans (pnet np n1)› and‹s1 ∈ reachable (pnet np n1) TT› have"((σ, snd (netgmap sr s1)), disconnect(i, i'), (σ, snd (netgmap sr s1'))) ∈ trans (opnet onp n1)" and"netgmap sr s1' = netmask (net_tree_ips n1) (σ, snd (netgmap sr s1'))" using‹wf_net_tree n1›unfolding atomize_conj by (rule IH1)
from‹netgmap sr (SubnetS s1 s2) = netmask (net_tree_ips (n1 ∥ n2)) (σ, ζ)› ‹net_ips s1 = net_tree_ips n1›and‹net_ips s2 = net_tree_ips n2› have"netgmap sr s2 = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2))" by (rule netgmap_subnet_split2) with‹(s2, disconnect(i, i'), s2') ∈ trans (pnet np n2)› and‹s2 ∈ reachable (pnet np n2) TT› have"((σ, snd (netgmap sr s2)), disconnect(i, i'), (σ, snd (netgmap sr s2'))) ∈ trans (opnet onp n2)" and"netgmap sr s2' = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2'))" using‹wf_net_tree n2›unfolding atomize_conj by (rule IH2)
have"((σ, snd (netgmap sr s)), disconnect(i, i'), (σ, snd (netgmap sr s'))) ∈ trans (opnet onp (n1 ∥ n2))" proof - from‹((σ, snd (netgmap sr s1)), disconnect(i, i'), (σ, snd (netgmap sr s1'))) ∈ trans (opnet onp n1)› and‹((σ, snd (netgmap sr s2)), disconnect(i, i'), (σ, snd (netgmap sr s2'))) ∈ trans (opnet onp n2)› have"((σ, SubnetS (snd (netgmap sr s1)) (snd (netgmap sr s2))), disconnect(i, i'), (σ, SubnetS (snd (netgmap sr s1')) (snd (netgmap sr s2')))) ∈ opnet_sos (trans (opnet onp n1)) (trans (opnet onp n2))" by (rule opnet_disconnect) with‹s = SubnetS s1 s2›‹s' = SubnetS s1' s2'›show ?thesis by simp qed
moreoverfrom‹netgmap sr s1' = netmask (net_tree_ips n1) (σ, snd (netgmap sr s1'))› ‹netgmap sr s2' = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2'))› ‹s' = SubnetS s1' s2'› have"netgmap sr s' = netmask (net_tree_ips (n1 ∥ n2)) (σ, snd (netgmap sr s'))" ..
ultimatelyshow"((σ, snd (netgmap sr s)), disconnect(i, i'), (σ, snd (netgmap sr s'))) ∈ trans (opnet onp (n1 ∥ n2)) ∧ netgmap sr s' = netmask (net_tree_ips (n1 ∥ n2)) (σ, snd (netgmap sr s'))" .. qed moreoverfrom‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)›have"ζ = snd (netgmap sr s)"by simp ultimatelyshow"∃σ' ζ'. ((σ, ζ), disconnect(i, i'), (σ', ζ')) ∈ trans (opnet onp n) ∧ (∀j. j ∉ net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')"by auto qed
lemma transfer_tau: assumes"(s, τ, s') ∈ trans (pnet np n)" and"s ∈ reachable (pnet np n) TT" and"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"wf_net_tree n" obtains σ' ζ' where"((σ, ζ), τ, (σ', ζ')) ∈ trans (opnet onp n)" and"∀j. j∉net_ips ζ ⟶ σ' j = σ j" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" proof atomize_elim from assms(4,2,1) obtain i where"i∈net_ips s" and"∀j. j≠i ⟶ netmap s' j = netmap s j" and"net_ip_action np τ i n s s'" by (metis pnet_tau_single_node) from this(2) have"∀j. j≠i ⟶ fst (netgmap sr s') j = fst (netgmap sr s) j" by (clarsimp intro!: netmap_is_fst_netgmap') from‹(s, τ, s') ∈ trans (pnet np n)›have"net_ips s' = net_ips s" by (rule pnet_maintains_dom [THEN sym])
define σ' where"σ' j = (if j = i then the (fst (netgmap sr s') i) else σ j)"for j from‹∀j. j≠i ⟶ fst (netgmap sr s') j = fst (netgmap sr s) j› and‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"∀j. j≠i ⟶ σ' j = σ j" unfolding σ'_defby clarsimp
from assms(2) have"net_ips s = net_tree_ips n" by (rule pnet_net_ips_net_tree_ips)
from‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"ζ = snd (netgmap sr s)"by simp
from‹∀j. j≠i ⟶ fst (netgmap sr s') j = fst (netgmap sr s) j›‹i ∈ net_ips s› ‹net_ips s = net_tree_ips n›‹net_ips s' = net_ips s› ‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"fst (netgmap sr s') = fst (netmask (net_tree_ips n) (σ', snd (netgmap sr s')))" unfolding σ'_def [abs_def] by - (rule ext, clarsimp)
hence"netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))" by (rule prod_eqI, simp)
with assms(1, 3) have"((σ, snd (netgmap sr s)), τ, (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" using assms(2,4) ‹i∈net_ips s›and‹net_ip_action np τ i n s s'› proof (induction n arbitrary: s s' ζ) fix ii Ri ns ns' ζ assume"(ns, τ, ns') ∈ trans (pnet np ⟨ii; Ri⟩)" and nsr: "ns ∈ reachable (pnet np ⟨ii; Ri⟩) TT" and"netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)" and"netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))" and"i∈net_ips ns" from this(1) have"(ns, τ, ns') ∈ node_sos (trans (np ii))" by (simp add: node_comps) moreoverwith nsr obtain s s' R R' where"ns = NodeS ii s R" and"ns' = NodeS ii s' R'" by (metis net_node_reachable_is_node node_tauTE') moreoverfrom‹i ∈ net_ips ns›and‹ns = NodeS ii s R›have"ii = i"by simp ultimatelyhave ntr: "(NodeS i s R, τ, NodeS i s' R') ∈ node_sos (trans (np i))" by simp hence"R' = R"by (metis net_state.inject(1) node_tauTE')
from ntr obtain a where"(s, a, s') ∈ trans (np i)" and"(∃d. a = ¬unicast d ∧ d∉R) ∨ (a = τ)" by (rule node_tauTE') auto
from‹netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)›‹ns = NodeS ii s R›and‹ii = i› have"σ i = fst (sr s)"by simp (metis map_upd_Some_unfold)
moreoverfrom‹netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))› ‹ns' = NodeS ii s' R'›and‹ii = i› have"σ' i = fst (sr s')" unfolding σ'_def [abs_def] by clarsimp (hypsubst_thin,
metis (full_types, lifting) fun_upd_same option.sel) ultimatelyhave"((σ, snd (sr s)), a, (σ', snd (sr s'))) ∈ trans (onp i)" using‹(s, a, s') ∈ trans (np i)›by (rule trans)
from‹(∃d. a = ¬unicast d ∧ d∉R) ∨ (a = τ)›‹∀j. j≠i ⟶ σ' j = σ j›‹R'=R› and‹((σ, snd (sr s)), a, (σ', snd (sr s'))) ∈ trans (onp i)› have"((σ, NodeS i (snd (sr s)) R), τ, (σ', NodeS i (snd (sr s')) R')) ∈ onode_sos (trans (onp i))" by (metis onode_sos.onode_notucast onode_sos.onode_tau)
with‹ns = NodeS ii s R›‹ns' = NodeS ii s' R'›‹ii = i› show"((σ, snd (netgmap sr ns)), τ, (σ', snd (netgmap sr ns'))) ∈ trans (opnet onp ⟨ii; Ri⟩)" by (simp add: onode_comps) next fix n1 n2 s s' ζ assume IH1: "∧s s' ζ. (s, τ, s') ∈ trans (pnet np n1) ==> netgmap sr s = netmask (net_tree_ips n1) (σ, ζ) ==> netgmap sr s' = netmask (net_tree_ips n1) (σ', snd (netgmap sr s')) ==> s ∈ reachable (pnet np n1) TT ==> wf_net_tree n1 ==> i∈net_ips s ==> net_ip_action np τ i n1 s s' ==> ((σ, snd (netgmap sr s)), τ, (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n1)" and IH2: "∧s s' ζ. (s, τ, s') ∈ trans (pnet np n2) ==> netgmap sr s = netmask (net_tree_ips n2) (σ, ζ) ==> netgmap sr s' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s')) ==> s ∈ reachable (pnet np n2) TT ==> wf_net_tree n2 ==> i∈net_ips s ==> net_ip_action np τ i n2 s s' ==> ((σ, snd (netgmap sr s)), τ, (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n2)" and tr: "(s, τ, s') ∈ trans (pnet np (n1 ∥ n2))" and sr: "s ∈ reachable (pnet np (n1 ∥ n2)) TT" and nm: "netgmap sr s = netmask (net_tree_ips (n1 ∥ n2)) (σ, ζ)" and nm': "netgmap sr s' = netmask (net_tree_ips (n1 ∥ n2)) (σ', snd (netgmap sr s'))" and"wf_net_tree (n1 ∥ n2)" and"i∈net_ips s" and"net_ip_action np τ i (n1 ∥ n2) s s'" from tr have"(s, τ, s') ∈ pnet_sos (trans (pnet np n1)) (trans (pnet np n2))"by simp thenobtain s1 s1' s2 s2' where"s = SubnetS s1 s2" and"s' = SubnetS s1' s2'" by (rule partial_tauTE) auto from this(1) and nm have"netgmap sr (SubnetS s1 s2) = netmask (net_tree_ips (n1 ∥ n2)) (σ, ζ)" by simp from‹s' = SubnetS s1' s2'›and nm' have"netgmap sr (SubnetS s1' s2') = netmask (net_tree_ips (n1 ∥ n2)) (σ', snd (netgmap sr s'))" by simp
from nm' [simplified ‹s' = SubnetS s1' s2'›‹s1' = s1›] ‹net_ips s1 = net_tree_ips n1› ‹net_ips s2' = net_tree_ips n2› have"netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))" by (rule netgmap_subnet_split2)
from‹(s2, τ, s2') ∈ trans (pnet np n2)› ‹netgmap sr s2 = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2))› ‹netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))› ‹s2 ∈ reachable (pnet np n2) TT› ‹wf_net_tree n2› ‹i∈net_ips s2› ‹net_ip_action np τ i n2 s2 s2'› have"((σ, snd (netgmap sr s2)), τ, (σ', snd (netgmap sr s2'))) ∈ trans (opnet onp n2)" by (rule IH2)
with‹s = SubnetS s1 s2›‹s' = SubnetS s1' s2'›‹s1' = s1›show ?thesis by (simp del: step_node_tau) (erule opnet_tau2) qed qed with‹ζ = snd (netgmap sr s)›have"((σ, ζ), τ, (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" by simp moreoverfrom‹∀j. j≠i ⟶ σ' j = σ j›‹i ∈ net_ips s›‹ζ = snd (netgmap sr s)› have"∀j. j∉net_ips ζ ⟶ σ' j = σ j"by (metis net_ips_netgmap) ultimatelyhave"((σ, ζ), τ, (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n) ∧ (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))" using‹netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))›by simp thus"∃σ' ζ'. ((σ, ζ), τ, (σ', ζ')) ∈ trans (opnet onp n) ∧ (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')"by auto qed
lemma transfer_deliver: assumes"(s, i:deliver(d), s') ∈ trans (pnet np n)" and"s ∈ reachable (pnet np n) TT" and"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"wf_net_tree n" obtains σ' ζ' where"((σ, ζ), i:deliver(d), (σ', ζ')) ∈ trans (opnet onp n)" and"∀j. j∉net_ips ζ ⟶ σ' j = σ j" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" proof atomize_elim from assms(4,2,1) obtain"i∈net_ips s" and"∀j. j≠i ⟶ netmap s' j = netmap s j" and"net_ip_action np (i:deliver(d)) i n s s'" by (metis delivered_to_net_ips pnet_deliver_single_node) from this(2) have"∀j. j≠i ⟶ fst (netgmap sr s') j = fst (netgmap sr s) j" by (clarsimp intro!: netmap_is_fst_netgmap') from‹(s, i:deliver(d), s') ∈ trans (pnet np n)›have"net_ips s' = net_ips s" by (rule pnet_maintains_dom [THEN sym])
define σ' where"σ' j = (if j = i then the (fst (netgmap sr s') i) else σ j)"for j from‹∀j. j≠i ⟶ fst (netgmap sr s') j = fst (netgmap sr s) j› and‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"∀j. j≠i ⟶ σ' j = σ j" unfolding σ'_defby clarsimp
from assms(2) have"net_ips s = net_tree_ips n" by (rule pnet_net_ips_net_tree_ips)
from‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"ζ = snd (netgmap sr s)"by simp
from‹∀j. j≠i ⟶ fst (netgmap sr s') j = fst (netgmap sr s) j›‹i ∈ net_ips s› ‹net_ips s = net_tree_ips n›‹net_ips s' = net_ips s› ‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"fst (netgmap sr s') = fst (netmask (net_tree_ips n) (σ', snd (netgmap sr s')))" unfolding σ'_def [abs_def] by - (rule ext, clarsimp)
hence"netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))" by (rule prod_eqI, simp)
with assms(1, 3) have"((σ, snd (netgmap sr s)), i:deliver(d), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" using assms(2,4) ‹i∈net_ips s›and‹net_ip_action np (i:deliver(d)) i n s s'› proof (induction n arbitrary: s s' ζ) fix ii Ri ns ns' ζ assume"(ns, i:deliver(d), ns') ∈ trans (pnet np ⟨ii; Ri⟩)" and nsr: "ns ∈ reachable (pnet np ⟨ii; Ri⟩) TT" and"netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)" and"netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))" and"i∈net_ips ns" from this(1) have"(ns, i:deliver(d), ns') ∈ node_sos (trans (np ii))" by (simp add: node_comps) moreoverwith nsr obtain s s' R R' where"ns = NodeS ii s R" and"ns' = NodeS ii s' R'" by (metis net_node_reachable_is_node node_sos_dest) moreoverfrom‹i ∈ net_ips ns›and‹ns = NodeS ii s R›have"ii = i"by simp ultimatelyhave ntr: "(NodeS i s R, i:deliver(d), NodeS i s' R') ∈ node_sos (trans (np i))" by simp hence"R' = R"by (metis net_state.inject(1) node_deliverTE')
from ntr have"(s, deliver d, s') ∈ trans (np i)" by (rule node_deliverTE') simp
from‹netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)›‹ns = NodeS ii s R›and‹ii = i› have"σ i = fst (sr s)"by simp (metis map_upd_Some_unfold)
moreoverfrom‹netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))› ‹ns' = NodeS ii s' R'›and‹ii = i› have"σ' i = fst (sr s')" unfolding σ'_def [abs_def] by clarsimp (hypsubst_thin,
metis (lifting, full_types) fun_upd_same option.sel) ultimatelyhave"((σ, snd (sr s)), deliver d, (σ', snd (sr s'))) ∈ trans (onp i)" using‹(s, deliver d, s') ∈ trans (np i)›by (rule trans)
from nm' [simplified ‹s' = SubnetS s1' s2'›‹s1' = s1›] ‹net_ips s1 = net_tree_ips n1› ‹net_ips s2' = net_tree_ips n2› have"netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))" by (rule netgmap_subnet_split2)
from‹(s2, i:deliver(d), s2') ∈ trans (pnet np n2)› ‹netgmap sr s2 = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2))› ‹netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))› ‹s2 ∈ reachable (pnet np n2) TT› ‹wf_net_tree n2› ‹i∈net_ips s2› ‹net_ip_action np (i:deliver(d)) i n2 s2 s2'› have"((σ, snd (netgmap sr s2)), i:deliver(d), (σ', snd (netgmap sr s2'))) ∈ trans (opnet onp n2)" by (rule IH2)
with‹s = SubnetS s1 s2›‹s' = SubnetS s1' s2'›‹s1' = s1›show ?thesis by simp (erule opnet_deliver2) qed qed with‹ζ = snd (netgmap sr s)›have"((σ, ζ), i:deliver(d), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" by simp moreoverfrom‹∀j. j≠i ⟶ σ' j = σ j›‹i ∈ net_ips s›‹ζ = snd (netgmap sr s)› have"∀j. j∉net_ips ζ ⟶ σ' j = σ j"by (metis net_ips_netgmap) ultimatelyhave"((σ, ζ), i:deliver(d), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n) ∧ (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))" using‹netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))›by simp thus"∃σ' ζ'. ((σ, ζ), i:deliver(d), (σ', ζ')) ∈ trans (opnet onp n) ∧ (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')"by auto qed
lemma transfer_arrive': assumes"(s, H¬K:arrive(m), s') ∈ trans (pnet np n)" and"s ∈ reachable (pnet np n) TT" and"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" and"wf_net_tree n" shows"((σ, ζ), H¬K:arrive(m), (σ', ζ')) ∈ trans (opnet onp n)" proof -
from assms(2) have"net_ips s = net_tree_ips n" .. with assms(1) have"net_ips s' = net_tree_ips n" by (metis pnet_maintains_dom)
from‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"ζ = snd (netgmap sr s)"by simp
from‹netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')› have"ζ' = snd (netgmap sr s')" and"netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))" by simp_all
from assms(1-3) ‹netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))› assms(5) have"((σ, snd (netgmap sr s)), H¬K:arrive(m), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" proof (induction n arbitrary: s s' ζ H K) fix ii Ri ns ns' ζ H K assume"(ns, H¬K:arrive(m), ns') ∈ trans (pnet np ⟨ii; Ri⟩)" and nsr: "ns ∈ reachable (pnet np ⟨ii; Ri⟩) TT" and"netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)" and"netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))" from this(1) have"(ns, H¬K:arrive(m), ns') ∈ node_sos (trans (np ii))" by (simp add: node_comps) moreoverwith nsr obtain s s' R where"ns = NodeS ii s R" and"ns' = NodeS ii s' R" by (metis net_node_reachable_is_node node_arriveTE') ultimatelyhave"(NodeS ii s R, H¬K:arrive(m), NodeS ii s' R) ∈ node_sos (trans (np ii))" by simp from this(1) have"((σ, NodeS ii (snd (sr s)) R), H¬K:arrive(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" proof (rule node_arriveTE) assume"(s, receive m, s') ∈ trans (np ii)" and"H = {ii}" and"K = {}" from‹netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)›and‹ns = NodeS ii s R› have"σ ii = fst (sr s)" by simp (metis map_upd_Some_unfold) moreoverfrom‹netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))› and‹ns' = NodeS ii s' R› have"σ' ii = fst (sr s')"by simp (metis map_upd_Some_unfold) ultimatelyhave"((σ, snd (sr s)), receive m, (σ', snd (sr s'))) ∈ trans (onp ii)" using‹(s, receive m, s') ∈ trans (np ii)›by (rule trans) hence"((σ, NodeS ii (snd (sr s)) R), {ii}¬{}:arrive(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by (rule onode_receive) with‹H={ii}›and‹K={}› show"((σ, NodeS ii (snd (sr s)) R), H¬K:arrive(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by simp next assume"H = {}" and"s' = s" and"K = {ii}" from‹s' = s›‹netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))› ‹netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)› ‹ns = NodeS ii s R›and‹ns' = NodeS ii s' R› have"σ' ii = σ ii"by simp (metis option.sel) hence"((σ, NodeS ii (snd (sr s)) R), {}¬{ii}:arrive(m), (σ', NodeS ii (snd (sr s)) R)) ∈ onode_sos (trans (onp ii))" by (rule onode_arrive) with‹H={}›‹K={ii}›and‹s' = s› show"((σ, NodeS ii (snd (sr s)) R), H¬K:arrive(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by simp qed with‹ns = NodeS ii s R›‹ns' = NodeS ii s' R› show"((σ, snd (netgmap sr ns)), H¬K:arrive(m), (σ', snd (netgmap sr ns'))) ∈ trans (opnet onp ⟨ii; Ri⟩)" by (simp add: onode_comps) next fix n1 n2 s s' ζ H K assume IH1: "∧s s' ζ H K. (s, H¬K:arrive(m), s') ∈ trans (pnet np n1) ==> s ∈ reachable (pnet np n1) TT ==> netgmap sr s = netmask (net_tree_ips n1) (σ, ζ) ==> netgmap sr s' = netmask (net_tree_ips n1) (σ', snd (netgmap sr s')) ==> wf_net_tree n1 ==> ((σ, snd (netgmap sr s)), H¬K:arrive(m), σ', snd (netgmap sr s')) ∈ trans (opnet onp n1)" and IH2: "∧s s' ζ H K. (s, H¬K:arrive(m), s') ∈ trans (pnet np n2) ==> s ∈ reachable (pnet np n2) TT ==> netgmap sr s = netmask (net_tree_ips n2) (σ, ζ) ==> netgmap sr s' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s')) ==> wf_net_tree n2 ==> ((σ, snd (netgmap sr s)), H¬K:arrive(m), σ', snd (netgmap sr s')) ∈ trans (opnet onp n2)" and"(s, H¬K:arrive(m), s') ∈ trans (pnet np (n1 ∥ n2))" and sr: "s ∈ reachable (pnet np (n1 ∥ n2)) TT" and nm: "netgmap sr s = netmask (net_tree_ips (n1 ∥ n2)) (σ, ζ)" and nm': "netgmap sr s' = netmask (net_tree_ips (n1 ∥ n2)) (σ', snd (netgmap sr s'))" and"wf_net_tree (n1 ∥ n2)" from this(3) have"(s, H¬K:arrive(m), s') ∈ pnet_sos (trans (pnet np n1)) (trans (pnet np n2))" by simp thus"((σ, snd (netgmap sr s)), H¬K:arrive(m), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp (n1 ∥ n2))" proof (rule partial_arriveTE) fix s1 s1' s2 s2' H1 H2 K1 K2 assume"s = SubnetS s1 s2" and"s' = SubnetS s1' s2'" and tr1: "(s1, H1¬K1:arrive(m), s1') ∈ trans (pnet np n1)" and tr2: "(s2, H2¬K2:arrive(m), s2') ∈ trans (pnet np n2)" and"H = H1 ∪ H2" and"K = K1 ∪ K2"
from sr [simplified ‹s = SubnetS s1 s2›] have"s1 ∈ reachable (pnet np n1) TT" by (rule subnet_reachable(1)) hence"net_ips s1 = net_tree_ips n1"by (rule pnet_net_ips_net_tree_ips) with tr1 have"net_ips s1' = net_tree_ips n1"by (metis pnet_maintains_dom)
from sr [simplified ‹s = SubnetS s1 s2›] have"s2 ∈ reachable (pnet np n2) TT" by (rule subnet_reachable(2)) hence"net_ips s2 = net_tree_ips n2"by (rule pnet_net_ips_net_tree_ips) with tr2 have"net_ips s2' = net_tree_ips n2"by (metis pnet_maintains_dom)
from‹(s1, H1¬K1:arrive(m), s1') ∈ trans (pnet np n1)› ‹s1 ∈ reachable (pnet np n1) TT› have"((σ, snd (netgmap sr s1)), H1¬K1:arrive(m), (σ', snd (netgmap sr s1'))) ∈ trans (opnet onp n1)" proof (rule IH1 [OF _ _ _ _ ‹wf_net_tree n1›]) from nm [simplified ‹s = SubnetS s1 s2›] ‹net_tree_ips n1 ∩ net_tree_ips n2 = {}› ‹net_ips s1 = net_tree_ips n1› ‹net_ips s2 = net_tree_ips n2› show"netgmap sr s1 = netmask (net_tree_ips n1) (σ, snd (netgmap sr s1))" by (rule netgmap_subnet_split1) next from nm' [simplified ‹s' = SubnetS s1' s2'›] ‹net_tree_ips n1 ∩ net_tree_ips n2 = {}› ‹net_ips s1' = net_tree_ips n1› ‹net_ips s2' = net_tree_ips n2› show"netgmap sr s1' = netmask (net_tree_ips n1) (σ', snd (netgmap sr s1'))" by (rule netgmap_subnet_split1) qed
moreoverfrom‹(s2, H2¬K2:arrive(m), s2') ∈ trans (pnet np n2)› ‹s2 ∈ reachable (pnet np n2) TT› have"((σ, snd (netgmap sr s2)), H2¬K2:arrive(m), (σ', snd (netgmap sr s2'))) ∈ trans (opnet onp n2)" proof (rule IH2 [OF _ _ _ _ ‹wf_net_tree n2›]) from nm [simplified ‹s = SubnetS s1 s2›] ‹net_ips s1 = net_tree_ips n1› ‹net_ips s2 = net_tree_ips n2› show"netgmap sr s2 = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2))" by (rule netgmap_subnet_split2) next from nm' [simplified ‹s' = SubnetS s1' s2'›] ‹net_ips s1' = net_tree_ips n1› ‹net_ips s2' = net_tree_ips n2› show"netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))" by (rule netgmap_subnet_split2) qed ultimatelyshow"((σ, snd (netgmap sr s)), H¬K:arrive(m), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp (n1 ∥ n2))" using‹s = SubnetS s1 s2›‹s' = SubnetS s1' s2'›‹H = H1 ∪ H2›‹K = K1 ∪ K2› by simp (rule opnet_sos.opnet_arrive) qed qed with‹ζ = snd (netgmap sr s)›and‹ζ' = snd (netgmap sr s')› show"((σ, ζ), H¬K:arrive(m), (σ', ζ')) ∈ trans (opnet onp n)" by simp qed
lemma transfer_arrive: assumes"(s, H¬K:arrive(m), s') ∈ trans (pnet np n)" and"s ∈ reachable (pnet np n) TT" and"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"wf_net_tree n" obtains σ' ζ' where"((σ, ζ), H¬K:arrive(m), (σ', ζ')) ∈ trans (opnet onp n)" and"∀j. j∉net_ips ζ ⟶ σ' j = σ j" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" proof atomize_elim
define σ' where"σ' i = (if i∈net_tree_ips n then the (fst (netgmap sr s') i) else σ i)"for i
from assms(2) have"net_ips s = net_tree_ips n" by (rule pnet_net_ips_net_tree_ips) with assms(1) have"net_ips s' = net_tree_ips n" by (metis pnet_maintains_dom)
have"netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))" proof (rule prod_eqI) from‹net_ips s' = net_tree_ips n› show"fst (netgmap sr s') = fst (netmask (net_tree_ips n) (σ', snd (netgmap sr s')))" unfolding σ'_def [abs_def] by - (rule ext, clarsimp) qed simp
moreoverwith assms(1-3) have"((σ, ζ), H¬K:arrive(m), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" using‹wf_net_tree n›by (rule transfer_arrive')
moreoverhave"∀j. j∉net_ips ζ ⟶ σ' j = σ j" proof - have"∀j. j∉net_tree_ips n ⟶ σ' j = σ j"unfolding σ'_defby simp with assms(3) and‹net_ips s = net_tree_ips n› show ?thesis by clarsimp (metis (mono_tags) net_ips_netgmap snd_conv) qed
ultimatelyshow"∃σ' ζ'. ((σ, ζ), H¬K:arrive(m), (σ', ζ')) ∈ trans (opnet onp n) ∧ (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')"by auto qed
lemma transfer_cast: assumes"(s, mR:*cast(m), s') ∈ trans (pnet np n)" and"s ∈ reachable (pnet np n) TT" and"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"wf_net_tree n" obtains σ' ζ' where"((σ, ζ), mR:*cast(m), (σ', ζ')) ∈ trans (opnet onp n)" and"∀j. j∉net_ips ζ ⟶ σ' j = σ j" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" proof atomize_elim
define σ' where"σ' i = (if i∈net_tree_ips n then the (fst (netgmap sr s') i) else σ i)"for i
from assms(2) have"net_ips s = net_tree_ips n" .. with assms(1) have"net_ips s' = net_tree_ips n" by (metis pnet_maintains_dom) have"netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))" proof (rule prod_eqI) from‹net_ips s' = net_tree_ips n› show"fst (netgmap sr s') = fst (netmask (net_tree_ips n) (σ', snd (netgmap sr s')))" unfolding σ'_def [abs_def] by - (rule ext, clarsimp simp add: some_the_fst_netgmap) qed simp
from‹net_ips s' = net_tree_ips n›and‹net_ips s = net_tree_ips n› have"∀j. j∉net_ips (snd (netgmap sr s)) ⟶ σ' j = σ j" unfolding σ'_defby simp
from‹netgmap sr s = netmask (net_tree_ips n) (σ, ζ)› have"ζ = snd (netgmap sr s)"by simp
from assms(1-3) ‹netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))› assms(4) have"((σ, snd (netgmap sr s)), mR:*cast(m), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" proof (induction n arbitrary: s s' ζ mR) fix ii Ri ns ns' ζ mR assume"(ns, mR:*cast(m), ns') ∈ trans (pnet np ⟨ii; Ri⟩)" and nsr: "ns ∈ reachable (pnet np ⟨ii; Ri⟩) TT" and"netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)" and"netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))" from this(1) have"(ns, mR:*cast(m), ns') ∈ node_sos (trans (np ii))" by (simp add: node_comps) moreoverwith nsr obtain s s' R where"ns = NodeS ii s R" and"ns' = NodeS ii s' R" by (metis net_node_reachable_is_node node_castTE') ultimatelyhave"(NodeS ii s R, mR:*cast(m), NodeS ii s' R) ∈ node_sos (trans (np ii))" by simp
from‹netgmap sr ns = netmask (net_tree_ips ⟨ii; Ri⟩) (σ, ζ)›and‹ns = NodeS ii s R› have"σ ii = fst (sr s)" by simp (metis map_upd_Some_unfold) from‹netgmap sr ns' = netmask (net_tree_ips ⟨ii; Ri⟩) (σ', snd (netgmap sr ns'))› and‹ns' = NodeS ii s' R› have"σ' ii = fst (sr s')"by simp (metis map_upd_Some_unfold)
from‹(NodeS ii s R, mR:*cast(m), NodeS ii s' R) ∈ node_sos (trans (np ii))› have"((σ, NodeS ii (snd (sr s)) R), mR:*cast(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" proof (rule node_castTE) assume"(s, broadcast m, s') ∈ trans (np ii)" and"mR = R" from‹σ ii = fst (sr s)›‹σ' ii = fst (sr s')›and this(1) have"((σ, snd (sr s)), broadcast m, (σ', snd (sr s'))) ∈ trans (onp ii)" by (rule trans) hence"((σ, NodeS ii (snd (sr s)) R), R:*cast(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by (rule onode_bcast) with‹mR = R›show"((σ, NodeS ii (snd (sr s)) R), mR:*cast(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by simp next fix D assume"(s, groupcast D m, s') ∈ trans (np ii)" and"mR = R ∩ D" from‹σ ii = fst (sr s)›‹σ' ii = fst (sr s')›and this(1) have"((σ, snd (sr s)), groupcast D m, (σ', snd (sr s'))) ∈ trans (onp ii)" by (rule trans) hence"((σ, NodeS ii (snd (sr s)) R), (R ∩ D):*cast(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by (rule onode_gcast) with‹mR = R ∩ D›show"((σ, NodeS ii (snd (sr s)) R), mR:*cast(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by simp next fix d assume"(s, unicast d m, s') ∈ trans (np ii)" and"d ∈ R" and"mR = {d}" from‹σ ii = fst (sr s)›‹σ' ii = fst (sr s')›and this(1) have"((σ, snd (sr s)), unicast d m, (σ', snd (sr s'))) ∈ trans (onp ii)" by (rule trans) hence"((σ, NodeS ii (snd (sr s)) R), {d}:*cast(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" using‹d∈R›by (rule onode_ucast) with‹mR={d}›show"((σ, NodeS ii (snd (sr s)) R), mR:*cast(m), (σ', NodeS ii (snd (sr s')) R)) ∈ onode_sos (trans (onp ii))" by simp qed with‹ns = NodeS ii s R›‹ns' = NodeS ii s' R› show"((σ, snd (netgmap sr ns)), mR:*cast(m), (σ', snd (netgmap sr ns'))) ∈ trans (opnet onp ⟨ii; Ri⟩)" by (simp add: onode_comps) next fix n1 n2 s s' ζ mR assume IH1: "∧s s' ζ mR. (s, mR:*cast(m), s') ∈ trans (pnet np n1) ==> s ∈ reachable (pnet np n1) TT ==> netgmap sr s = netmask (net_tree_ips n1) (σ, ζ) ==> netgmap sr s' = netmask (net_tree_ips n1) (σ', snd (netgmap sr s')) ==> wf_net_tree n1 ==> ((σ, snd (netgmap sr s)), mR:*cast(m), σ', snd (netgmap sr s')) ∈ trans (opnet onp n1)" and IH2: "∧s s' ζ mR. (s, mR:*cast(m), s') ∈ trans (pnet np n2) ==> s ∈ reachable (pnet np n2) TT ==> netgmap sr s = netmask (net_tree_ips n2) (σ, ζ) ==> netgmap sr s' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s')) ==> wf_net_tree n2 ==> ((σ, snd (netgmap sr s)), mR:*cast(m), σ', snd (netgmap sr s')) ∈ trans (opnet onp n2)" and"(s, mR:*cast(m), s') ∈ trans (pnet np (n1 ∥ n2))" and sr: "s ∈ reachable (pnet np (n1 ∥ n2)) TT" and nm: "netgmap sr s = netmask (net_tree_ips (n1 ∥ n2)) (σ, ζ)" and nm': "netgmap sr s' = netmask (net_tree_ips (n1 ∥ n2)) (σ', snd (netgmap sr s'))" and"wf_net_tree (n1 ∥ n2)" from this(3) have"(s, mR:*cast(m), s') ∈ pnet_sos (trans (pnet np n1)) (trans (pnet np n2))" by simp thenobtain s1 s1' s2 s2' H K where"s = SubnetS s1 s2" and"s' = SubnetS s1' s2'" and"H ⊆ mR" and"K ∩ mR = {}" and trtr: "((s1, mR:*cast(m), s1') ∈ trans (pnet np n1) ∧ (s2, H¬K:arrive(m), s2') ∈ trans (pnet np n2)) ∨ ((s1, H¬K:arrive(m), s1') ∈ trans (pnet np n1) ∧ (s2, mR:*cast(m), s2') ∈ trans (pnet np n2))" by (rule partial_castTE) metis+
from sr [simplified ‹s = SubnetS s1 s2›] have"s1 ∈ reachable (pnet np n1) TT" by (rule subnet_reachable(1)) hence"net_ips s1 = net_tree_ips n1"by (rule pnet_net_ips_net_tree_ips) with trtr have"net_ips s1' = net_tree_ips n1"by (metis pnet_maintains_dom)
from sr [simplified ‹s = SubnetS s1 s2›] have"s2 ∈ reachable (pnet np n2) TT" by (rule subnet_reachable(2)) hence"net_ips s2 = net_tree_ips n2"by (rule pnet_net_ips_net_tree_ips) with trtr have"net_ips s2' = net_tree_ips n2"by (metis pnet_maintains_dom)
from nm [simplified ‹s = SubnetS s1 s2›] ‹net_tree_ips n1 ∩ net_tree_ips n2 = {}› ‹net_ips s1 = net_tree_ips n1› ‹net_ips s2 = net_tree_ips n2› have"netgmap sr s1 = netmask (net_tree_ips n1) (σ, snd (netgmap sr s1))" by (rule netgmap_subnet_split1)
from nm' [simplified ‹s' = SubnetS s1' s2'›] ‹net_tree_ips n1 ∩ net_tree_ips n2 = {}› ‹net_ips s1' = net_tree_ips n1› ‹net_ips s2' = net_tree_ips n2› have"netgmap sr s1' = netmask (net_tree_ips n1) (σ', snd (netgmap sr s1'))" by (rule netgmap_subnet_split1)
from nm [simplified ‹s = SubnetS s1 s2›] ‹net_ips s1 = net_tree_ips n1› ‹net_ips s2 = net_tree_ips n2› have"netgmap sr s2 = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2))" by (rule netgmap_subnet_split2)
from nm' [simplified ‹s' = SubnetS s1' s2'›] ‹net_ips s1' = net_tree_ips n1› ‹net_ips s2' = net_tree_ips n2› have"netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))" by (rule netgmap_subnet_split2)
from trtr show"((σ, snd (netgmap sr s)), mR:*cast(m), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp (n1 ∥ n2))" proof (elim disjE conjE) assume"(s1, mR:*cast(m), s1') ∈ trans (pnet np n1)" and"(s2, H¬K:arrive(m), s2') ∈ trans (pnet np n2)" from‹(s1, mR:*cast(m), s1') ∈ trans (pnet np n1)› ‹s1 ∈ reachable (pnet np n1) TT› ‹netgmap sr s1 = netmask (net_tree_ips n1) (σ, snd (netgmap sr s1))› ‹netgmap sr s1' = netmask (net_tree_ips n1) (σ', snd (netgmap sr s1'))› ‹wf_net_tree n1› have"((σ, snd (netgmap sr s1)), mR:*cast(m), (σ', snd (netgmap sr s1'))) ∈ trans (opnet onp n1)" by (rule IH1)
moreoverfrom‹(s2, H¬K:arrive(m), s2') ∈ trans (pnet np n2)› ‹s2 ∈ reachable (pnet np n2) TT› ‹netgmap sr s2 = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2))› ‹netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))› ‹wf_net_tree n2› have"((σ, snd (netgmap sr s2)), H¬K:arrive(m), (σ', snd (netgmap sr s2'))) ∈ trans (opnet onp n2)" by (rule transfer_arrive')
ultimatelyhave"((σ, SubnetS (snd (netgmap sr s1)) (snd (netgmap sr s2))), mR:*cast(m), (σ', SubnetS (snd (netgmap sr s1')) (snd (netgmap sr s2')))) ∈ opnet_sos (trans (opnet onp n1)) (trans (opnet onp n2))" using‹H ⊆ mR›and‹K ∩ mR = {}›by (rule opnet_sos.intros(1)) with‹s = SubnetS s1 s2›‹s' = SubnetS s1' s2'›show ?thesis by simp next assume"(s1, H¬K:arrive(m), s1') ∈ trans (pnet np n1)" and"(s2, mR:*cast(m), s2') ∈ trans (pnet np n2)" from‹(s1, H¬K:arrive(m), s1') ∈ trans (pnet np n1)› ‹s1 ∈ reachable (pnet np n1) TT› ‹netgmap sr s1 = netmask (net_tree_ips n1) (σ, snd (netgmap sr s1))› ‹netgmap sr s1' = netmask (net_tree_ips n1) (σ', snd (netgmap sr s1'))› ‹wf_net_tree n1› have"((σ, snd (netgmap sr s1)), H¬K:arrive(m), (σ', snd (netgmap sr s1'))) ∈ trans (opnet onp n1)" by (rule transfer_arrive')
moreoverfrom‹(s2, mR:*cast(m), s2') ∈ trans (pnet np n2)› ‹s2 ∈ reachable (pnet np n2) TT› ‹netgmap sr s2 = netmask (net_tree_ips n2) (σ, snd (netgmap sr s2))› ‹netgmap sr s2' = netmask (net_tree_ips n2) (σ', snd (netgmap sr s2'))› ‹wf_net_tree n2› have"((σ, snd (netgmap sr s2)), mR:*cast(m), (σ', snd (netgmap sr s2'))) ∈ trans (opnet onp n2)" by (rule IH2)
ultimatelyhave"((σ, SubnetS (snd (netgmap sr s1)) (snd (netgmap sr s2))), mR:*cast(m), (σ', SubnetS (snd (netgmap sr s1')) (snd (netgmap sr s2')))) ∈ opnet_sos (trans (opnet onp n1)) (trans (opnet onp n2))" using‹H ⊆ mR›and‹K ∩ mR = {}›by (rule opnet_sos.intros(2)) with‹s = SubnetS s1 s2›‹s' = SubnetS s1' s2'›show ?thesis by simp qed qed with‹ζ = snd (netgmap sr s)›have"((σ, ζ), mR:*cast(m), (σ', snd (netgmap sr s'))) ∈ trans (opnet onp n)" by simp moreoverfrom‹∀j. j∉net_ips (snd (netgmap sr s)) ⟶ σ' j = σ j›‹ζ = snd (netgmap sr s)› have"∀j. j∉net_ips ζ ⟶ σ' j = σ j"by simp moreovernote‹netgmap sr s' = netmask (net_tree_ips n) (σ', snd (netgmap sr s'))› ultimatelyshow"∃σ' ζ'. ((σ, ζ), mR:*cast(m), (σ', ζ')) ∈ trans (opnet onp n) ∧ (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" by auto qed
lemma transfer_pnet_action: assumes"s ∈ reachable (pnet np n) TT" and"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"wf_net_tree n" and"(s, a, s') ∈ trans (pnet np n)" obtains σ' ζ' where"((σ, ζ), a, (σ', ζ')) ∈ trans (opnet onp n)" and"∀j. j∉net_ips ζ ⟶ σ' j = σ j" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" proof atomize_elim show"∃σ' ζ'. ((σ, ζ), a, (σ', ζ')) ∈ trans (opnet onp n) ∧ (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" proof (cases a) case node_cast with assms(4) show ?thesis by (auto elim!: transfer_cast [OF _ assms(1-3)]) next case node_deliver with assms(4) show ?thesis by (auto elim!: transfer_deliver [OF _ assms(1-3)]) next case node_arrive with assms(4) show ?thesis by (auto elim!: transfer_arrive [OF _ assms(1-3)]) next case node_connect with assms(4) show ?thesis by (auto elim!: transfer_connect [OF _ assms(1-3)]) next case node_disconnect with assms(4) show ?thesis by (auto elim!: transfer_disconnect [OF _ assms(1-3)]) next case node_newpkt with assms(4) have False by (metis pnet_never_newpkt) thus ?thesis .. next case node_tau with assms(4) show ?thesis by (auto elim!: transfer_tau [OF _ assms(1-3), simplified]) qed qed
lemma transfer_action_pnet_closed: assumes"(s, a, s') ∈ trans (closed (pnet np n))" obtains a' where"(s, a', s') ∈ trans (pnet np n)" and"∧σ ζ σ' ζ'. [ ((σ, ζ), a', (σ', ζ')) ∈ trans (opnet onp n); (∀j. j∉net_ips ζ ⟶ σ' j = σ j) ] ==> ((σ, ζ), a, (σ', ζ')) ∈ trans (oclosed (opnet onp n))" proof (atomize_elim) from assms have"(s, a, s') ∈ cnet_sos (trans (pnet np n))"by simp thus"∃a'. (s, a', s') ∈ trans (pnet np n) ∧ (∀σ ζ σ' ζ'. ((σ, ζ), a', (σ', ζ')) ∈ trans (opnet onp n) ⟶ (∀j. j ∉ net_ips ζ ⟶ σ' j = σ j) ⟶ ((σ, ζ), a, (σ', ζ')) ∈ trans (oclosed (opnet onp n)))" proof cases case (cnet_cast R m) thus ?thesis by (auto intro!: exI [where x="R:*cast(m)"] dest!: ocnet_cast) qed (auto intro!: ocnet_sos.intros [simplified]) qed
lemma transfer_action: assumes"s ∈ reachable (closed (pnet np n)) TT" and"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"wf_net_tree n" and"(s, a, s') ∈ trans (closed (pnet np n))" obtains σ' ζ' where"((σ, ζ), a, (σ', ζ')) ∈ trans (oclosed (opnet onp n))" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" proof atomize_elim from assms(1) have"s ∈ reachable (pnet np n) TT" .. from assms(4) show"∃σ' ζ'. ((σ, ζ), a, (σ', ζ')) ∈ trans (oclosed (opnet onp n)) ∧ netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" by (cases a)
((elim transfer_action_pnet_closed
transfer_pnet_action [OF ‹s ∈ reachable (pnet np n) TT› assms(2-3)])?,
(auto intro!: exI)[1])+ qed
lemma pnet_reachable_transfer': assumes"wf_net_tree n" and"s ∈ reachable (closed (pnet np n)) TT" shows"netgmap sr s ∈ netmask (net_tree_ips n) ` oreachable (oclosed (opnet onp n)) (λ_ _ _. True) U"
(is" _ ∈ ?f ` ?oreachable n") using assms(2) proofinduction fix s assume"s ∈ init (closed (pnet np n))" hence"s ∈ init (pnet np n)"by simp with‹wf_net_tree n›have"netgmap sr s ∈ netmask (net_tree_ips n) ` init (opnet onp n)" by (rule init_pnet_opnet) hence"netgmap sr s ∈ netmask (net_tree_ips n) ` init (oclosed (opnet onp n))" by simp moreoverhave"netmask (net_tree_ips n) ` init (oclosed (opnet onp n)) ⊆ netmask (net_tree_ips n) ` ?oreachable n" by (intro image_mono subsetI) (rule oreachable_init) ultimatelyshow"netgmap sr s ∈ netmask (net_tree_ips n) ` ?oreachable n" by (rule rev_subsetD) next fix s a s' assume"s ∈ reachable (closed (pnet np n)) TT" and"netgmap sr s ∈ netmask (net_tree_ips n) ` ?oreachable n" and"(s, a, s') ∈ trans (closed (pnet np n))" from this(2) obtain σ ζ where"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)" and"(σ, ζ) ∈ ?oreachable n" by clarsimp from‹s ∈ reachable (closed (pnet np n)) TT› this(1) ‹wf_net_tree n› and‹(s, a, s') ∈ trans (closed (pnet np n))› obtain σ' ζ' where"((σ, ζ), a, (σ', ζ')) ∈ trans (oclosed (opnet onp n))" and"netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')" by (rule transfer_action) from‹(σ, ζ) ∈ ?oreachable n›and this(1) have"(σ', ζ') ∈ ?oreachable n" by (rule oreachable_local) simp with‹netgmap sr s' = netmask (net_tree_ips n) (σ', ζ')› show"netgmap sr s' ∈ netmask (net_tree_ips n) ` ?oreachable n"by (rule image_eqI) qed
definition
someinit :: "nat ==> 'g" where "someinit i ≡ SOME x. x ∈ (fst o sr) ` init (np i)"
definition
initmissing :: "((nat ==> 'g option) × 'a) ==> (nat ==> 'g) × 'a" where "initmissing σ = (λi. case (fst σ) i of None ==> someinit i | Some s ==> s, snd σ)"
lemma initmnissing_snd_netgmap [simp]: assumes"initmissing (netgmap sr s) = (σ, ζ)" shows"snd (netgmap sr s) = ζ" using assms unfolding initmissing_def by simp
lemma in_net_ips_fst_init_missing [simp]: assumes"i ∈ net_ips s" shows"fst (initmissing (netgmap sr s)) i = the (fst (netgmap sr s) i)" using assms unfolding initmissing_def by (clarsimp split: option.split)
lemma not_in_net_ips_fst_init_missing [simp]: assumes"i ∉ net_ips s" shows"fst (initmissing (netgmap sr s)) i = someinit i" using assms unfolding initmissing_def by (clarsimp split: option.split)
lemma initmissing_oreachable_netmask [elim]: assumes"initmissing (netgmap sr s) ∈ oreachable (oclosed (opnet onp n)) (λ_ _ _. True) U"
(is"_ ∈ ?oreachable n") and"net_ips s = net_tree_ips n" shows"netgmap sr s ∈ netmask (net_tree_ips n) ` ?oreachable n" proof - obtain σ ζ where"initmissing (netgmap sr s) = (σ, ζ)"by (metis surj_pair) with assms(1) have"(σ, ζ) ∈ ?oreachable n"by simp
have"netgmap sr s = netmask (net_ips s) (σ, ζ)" proof (intro prod_eqI ext) fix i show"fst (netgmap sr s) i = fst (netmask (net_ips s) (σ, ζ)) i" proof (cases "i∈net_ips s") assume"i∈net_ips s" hence"fst (initmissing (netgmap sr s)) i = the (fst (netgmap sr s) i)" by (rule in_net_ips_fst_init_missing) moreoverfrom‹i∈net_ips s›have"Some (the (fst (netgmap sr s) i)) = fst (netgmap sr s) i" by (rule some_the_fst_netgmap) ultimatelyshow ?thesis using‹initmissing (netgmap sr s) = (σ, ζ)›by simp qed simp next from‹initmissing (netgmap sr s) = (σ, ζ)› show"snd (netgmap sr s) = snd (netmask (net_ips s) (σ, ζ))" by simp qed with assms(2) have"netgmap sr s = netmask (net_tree_ips n) (σ, ζ)"by simp moreoverfrom‹(σ, ζ) ∈ ?oreachable n› have"netmask (net_ips s) (σ, ζ) ∈ netmask (net_ips s) ` ?oreachable n" by (rule imageI) ultimatelyshow ?thesis by (simp only: assms(2)) qed
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.