Up to index of Isabelle/HOL/HOL-Complex/CSP-Prover
theory Parallel_cms = Parallel + Domain_SF_prod_cms:(*-------------------------------------------* | CSP-Prover | | December 2004 | | Yoshinao Isobe (AIST JAPAN) | *-------------------------------------------*) theory Parallel_cms = Parallel + Domain_SF_prod_cms: (* The following simplification rules are deleted in this theory file *) (* because they unexpectly rewrite UnionT and InterT. *) (* disj_not1: (~ P | Q) = (P --> Q) *) declare disj_not1 [simp del] (* The following simplification is sometimes unexpected. *) (* *) (* not_None_eq: (x ~= None) = (EX y. x = Some y) *) declare not_None_eq [simp del] (***************************************************************** 1. [[P |[X]| Q]]T : non expanding 2. [[P |[X]| Q]]F : non expanding 3. 4. *****************************************************************) (********************************************************* map Parallel T *********************************************************) (*** restT (subset) ***) lemma Parallel_restT_sub: "[| [[P]]T ev1 rest n <= [[P]]T ev2 rest n ; [[Q]]T ev1 rest n <= [[Q]]T ev2 rest n |] ==> [[P |[X]| Q]]T ev1 rest n <= [[P |[X]| Q]]T ev2 rest n" apply (simp add: subsetT_iff) apply (intro allI impI) apply (simp add: in_restT) apply (simp add: Parallel_memT) apply (elim conjE exE) apply (rule_tac x="s" in exI) apply (rule_tac x="ta" in exI) apply (simp) apply (erule par_tr_lengthtE) by (auto) (*** restT (equal) ***) lemma Parallel_restT: "[| [[P]]T ev1 rest n = [[P]]T ev2 rest n ; [[Q]]T ev1 rest n = [[Q]]T ev2 rest n |] ==> [[P |[X]| Q]]T ev1 rest n = [[P |[X]| Q]]T ev2 rest n" apply (rule order_antisym) by (simp_all add: Parallel_restT_sub) (*** distT lemma ***) lemma Parallel_distT: "TTs = {([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)} ==> (EX TT. TT:TTs & distance([[P |[X]| Q]]T ev1, [[P |[X]| Q]]T ev2) <= distance((fst TT), (snd TT)))" apply (rule rest_to_dist_pair) by (auto intro: Parallel_restT) (*** map_alpha T lemma ***) lemma Parallel_evalT_map_alpha_lm: "[| distance ([[P]]T ev1, [[P]]T ev2) <= alpha * distance (ev1, ev2) ; distance ([[Q]]T ev1, [[Q]]T ev2) <= alpha * distance (ev1, ev2) |] ==> distance ([[P |[X]| Q]]T ev1, [[P |[X]| Q]]T ev2) <= alpha * distance (ev1, ev2)" apply (insert Parallel_distT [of "{([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)}" P ev1 ev2 Q X]) by (auto) (*** Parallel_evalT_map_alpha ***) lemma Parallel_evalT_map_alpha: "[| map_alpha [[P]]T alpha ; map_alpha [[Q]]T alpha |] ==> map_alpha [[P |[X]| Q]]T alpha" apply (simp add: map_alpha_def) apply (intro allI) apply (erule conjE) apply (drule_tac x="x" in spec) apply (drule_tac x="x" in spec) apply (drule_tac x="y" in spec) apply (drule_tac x="y" in spec) by (simp add: Parallel_evalT_map_alpha_lm) (*** Parallel_evalT_non_expanding ***) lemma Parallel_evalT_non_expanding: "[| non_expanding [[P]]T ; non_expanding [[Q]]T |] ==> non_expanding [[P |[X]| Q]]T" by (simp add: non_expanding_def Parallel_evalT_map_alpha) (*** Parallel_evalT_contraction_alpha ***) lemma Parallel_evalT_contraction_alpha: "[| contraction_alpha [[P]]T alpha ; contraction_alpha [[Q]]T alpha |] ==> contraction_alpha [[P |[X]| Q]]T alpha" by (simp add: contraction_alpha_def Parallel_evalT_map_alpha) (********************************************************* map Parallel F *********************************************************) (*** restF (subset) ***) lemma Parallel_restF_sub: "[| [[P]]F ev1 rest n <= [[P]]F ev2 rest n ; [[Q]]F ev1 rest n <= [[Q]]F ev2 rest n |] ==> [[P |[X]| Q]]F ev1 rest n <= [[P |[X]| Q]]F ev2 rest n" apply (simp add: subsetF_iff) apply (intro allI impI) apply (simp add: in_restF) apply (simp add: Parallel_memF) apply (elim conjE exE) apply (rule_tac x="Y" in exI) apply (rule_tac x="Z" in exI) apply (simp) apply (rule_tac x="sa" in exI) apply (rule_tac x="t" in exI) apply (simp) apply (drule_tac x="sa" in spec) apply (drule_tac x="t" in spec) apply (drule_tac x="Y" in spec) apply (drule_tac x="Z" in spec) apply (erule disjE, simp) (* lengtht s < n *) apply (erule par_tr_lengthtE) apply (simp) apply (elim conjE exE, simp) (* lengtht s < n *) apply (case_tac "~ notick s'", simp) apply (simp add: par_tr_last) apply (elim conjE exE, simp) apply (erule par_tr_lengthtE) apply (rotate_tac 4) apply (drule sym, simp) apply (force) done (*** restF (equal) ***) lemma Parallel_restF: "[| [[P]]F ev1 rest n = [[P]]F ev2 rest n ; [[Q]]F ev1 rest n = [[Q]]F ev2 rest n |] ==> [[P |[X]| Q]]F ev1 rest n = [[P |[X]| Q]]F ev2 rest n" apply (rule order_antisym) by (simp_all add: Parallel_restF_sub) (*** distF lemma ***) lemma Parallel_distF: "FFs = {([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)} ==> (EX FF. FF:FFs & distance([[P |[X]| Q]]F ev1, [[P |[X]| Q]]F ev2) <= distance((fst FF), (snd FF)))" apply (rule rest_to_dist_pair) by (auto intro: Parallel_restF) (*** map_alpha F lemma ***) lemma Parallel_evalF_map_alpha_lm: "[| distance ([[P]]F ev1, [[P]]F ev2) <= alpha * distance (ev1, ev2) ; distance ([[Q]]F ev1, [[Q]]F ev2) <= alpha * distance (ev1, ev2) |] ==> distance ([[P |[X]| Q]]F ev1, [[P |[X]| Q]]F ev2) <= alpha * distance (ev1, ev2)" apply (insert Parallel_distF [of "{([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)}" P ev1 ev2 Q X]) by (auto) (*** Parallel_evalF_map_alpha ***) lemma Parallel_evalF_map_alpha: "[| map_alpha [[P]]F alpha ; map_alpha [[Q]]F alpha |] ==> map_alpha [[P |[X]| Q]]F alpha" apply (simp add: map_alpha_def) apply (intro allI) apply (erule conjE) apply (drule_tac x="x" in spec) apply (drule_tac x="x" in spec) apply (drule_tac x="y" in spec) apply (drule_tac x="y" in spec) by (simp add: Parallel_evalF_map_alpha_lm) (*** Parallel_evalF_non_expanding ***) lemma Parallel_evalF_non_expanding: "[| non_expanding [[P]]F ; non_expanding [[Q]]F |] ==> non_expanding [[P |[X]| Q]]F" by (simp add: non_expanding_def Parallel_evalF_map_alpha) (*** Parallel_evalF_contraction_alpha ***) lemma Parallel_evalF_contraction_alpha: "[| contraction_alpha [[P]]F alpha ; contraction_alpha [[Q]]F alpha |] ==> contraction_alpha [[P |[X]| Q]]F alpha" by (simp add: contraction_alpha_def Parallel_evalF_map_alpha) (****************** to add them again ******************) declare disj_not1 [simp] declare not_None_eq [simp] end
lemma Parallel_restT_sub:
[| [[P]]T ev1 rest n ≤ [[P]]T ev2 rest n; [[Q]]T ev1 rest n ≤ [[Q]]T ev2 rest n |] ==> [[P |[X]| Q]]T ev1 rest n ≤ [[P |[X]| Q]]T ev2 rest n
lemma Parallel_restT:
[| [[P]]T ev1 rest n = [[P]]T ev2 rest n; [[Q]]T ev1 rest n = [[Q]]T ev2 rest n |] ==> [[P |[X]| Q]]T ev1 rest n = [[P |[X]| Q]]T ev2 rest n
lemma Parallel_distT:
TTs = {([[P]]T ev1, [[P]]T ev2), ([[Q]]T ev1, [[Q]]T ev2)} ==> ∃TT. TT ∈ TTs ∧ distance ([[P |[X]| Q]]T ev1, [[P |[X]| Q]]T ev2) ≤ distance (fst TT, snd TT)
lemma Parallel_evalT_map_alpha_lm:
[| distance ([[P]]T ev1, [[P]]T ev2) ≤ alpha * distance (ev1, ev2); distance ([[Q]]T ev1, [[Q]]T ev2) ≤ alpha * distance (ev1, ev2) |] ==> distance ([[P |[X]| Q]]T ev1, [[P |[X]| Q]]T ev2) ≤ alpha * distance (ev1, ev2)
lemma Parallel_evalT_map_alpha:
[| map_alpha [[P]]T alpha; map_alpha [[Q]]T alpha |] ==> map_alpha [[P |[X]| Q]]T alpha
lemma Parallel_evalT_non_expanding:
[| non_expanding [[P]]T; non_expanding [[Q]]T |] ==> non_expanding [[P |[X]| Q]]T
lemma Parallel_evalT_contraction_alpha:
[| contraction_alpha [[P]]T alpha; contraction_alpha [[Q]]T alpha |] ==> contraction_alpha [[P |[X]| Q]]T alpha
lemma Parallel_restF_sub:
[| [[P]]F ev1 rest n ≤ [[P]]F ev2 rest n; [[Q]]F ev1 rest n ≤ [[Q]]F ev2 rest n |] ==> [[P |[X]| Q]]F ev1 rest n ≤ [[P |[X]| Q]]F ev2 rest n
lemma Parallel_restF:
[| [[P]]F ev1 rest n = [[P]]F ev2 rest n; [[Q]]F ev1 rest n = [[Q]]F ev2 rest n |] ==> [[P |[X]| Q]]F ev1 rest n = [[P |[X]| Q]]F ev2 rest n
lemma Parallel_distF:
FFs = {([[P]]F ev1, [[P]]F ev2), ([[Q]]F ev1, [[Q]]F ev2)} ==> ∃FF. FF ∈ FFs ∧ distance ([[P |[X]| Q]]F ev1, [[P |[X]| Q]]F ev2) ≤ distance (fst FF, snd FF)
lemma Parallel_evalF_map_alpha_lm:
[| distance ([[P]]F ev1, [[P]]F ev2) ≤ alpha * distance (ev1, ev2); distance ([[Q]]F ev1, [[Q]]F ev2) ≤ alpha * distance (ev1, ev2) |] ==> distance ([[P |[X]| Q]]F ev1, [[P |[X]| Q]]F ev2) ≤ alpha * distance (ev1, ev2)
lemma Parallel_evalF_map_alpha:
[| map_alpha [[P]]F alpha; map_alpha [[Q]]F alpha |] ==> map_alpha [[P |[X]| Q]]F alpha
lemma Parallel_evalF_non_expanding:
[| non_expanding [[P]]F; non_expanding [[Q]]F |] ==> non_expanding [[P |[X]| Q]]F
lemma Parallel_evalF_contraction_alpha:
[| contraction_alpha [[P]]F alpha; contraction_alpha [[Q]]F alpha |] ==> contraction_alpha [[P |[X]| Q]]F alpha