theory CSP_Processes imports Reactive_Processes begin
text‹A CSP process is a UTP reactive process that satisfies two additional
conditions called $CSP1$ and $CSP2$. A reactive process that satisfies
CSP1$ and $CSP2$ is said to be CSP healthy.›
subsection‹Definitions›
text‹We introduce here the definitions of the CSP healthiness conditions.›
definition CSP1::"(('θ,'σ) alphabet_rp) Healthiness_condition" where"CSP1 (P) ≡ P ∨ (λ(A, A'). ¬ok A ∧ tr A ≤ tr A')"
definition J_csp where"J_csp ≡ λ(A, A'). (ok A ⟶ ok A') ∧ tr A = tr A' ∧ wait A = wait A' ∧ ref A = ref A' ∧ more A = more A'"
definition CSP2::"(('θ,'σ) alphabet_rp) Healthiness_condition" where"CSP2 (P) ≡ P ;; J_csp"
definition is_CSP_process::"('θ,'σ) relation_rp ==> bool"where "is_CSP_process P ≡ P is CSP1 healthy ∧ P is CSP2 healthy ∧ P is R healthy"
lemma is_CSP_processE1 [elim?]: assumes"is_CSP_process P" obtains"P is CSP1 healthy""P is CSP2 healthy""P is R healthy" using assms unfolding is_CSP_process_def by simp
lemma is_CSP_processE2 [elim?]: assumes"is_CSP_process P" obtains"CSP1 P = P""CSP2 P = P""R P = P" using assms unfolding is_CSP_process_def by (simp add: Healthy_def')
subsection‹Proofs›
text‹Theorems and lemmas relative to CSP processes are introduced here.›
lemma CSP1_CSP2_commute: "CSP1 o CSP2 = CSP2 o CSP1" by (auto simp: csp_defs fun_eq_iff)
lemma disj_CSP1: assumes"P is CSP1 healthy" and"Q is CSP1 healthy" shows"(P ∨ Q) is CSP1 healthy" using assms by (auto simp: csp_defs design_defs rp_defs fun_eq_iff)
lemma disj_CSP2: "P is CSP2 healthy ==> Q is CSP2 healthy ==> (P ∨ Q) is CSP2 healthy" by (simp add: CSP2_is_H2[symmetric] Healthy_def' design_defs comp_ndet_l_distr)
lemma seq_CSP1: assumes A: "P is CSP1 healthy" assumes B: "Q is CSP1 healthy" shows"(P ;; Q) is CSP1 healthy" using A B by (auto simp: csp_defs design_defs rp_defs fun_eq_iff)
lemma seq_CSP2: assumes A: "Q is CSP2 healthy" shows"(P ;; Q) is CSP2 healthy" using A by (auto simp: CSP2_is_H2[symmetric] H2_J[symmetric])
lemma seq_R: assumes"P is R healthy" and"Q is R healthy" shows"(P ;; Q) is R healthy" proof - have"R P = P"and"R Q = Q" using assms by (simp_all only: Healthy_def) moreover have"(R P ;; R Q) is R healthy" apply (auto simp add: design_defs rp_defs prefix_def fun_eq_iff split: cond_splits) apply (rule_tac b=a in comp_intro, auto split: cond_splits) apply (rule_tac x="zs"in exI, auto split: cond_splits) apply (rule_tac b="ba(tr := tr a @ tr ba)"in comp_intro, auto split: cond_splits)+ done ultimatelyshow ?thesis by simp qed
lemma CSP1_join: assumes A: "x is CSP1 healthy" and B: "y is CSP1 healthy" shows"(x ⊓ y) is CSP1 healthy" using A B by (simp add: Healthy_def CSP1_def fun_eq_iff utp_defs)
lemma CSP2_join: assumes A: "x is CSP2 healthy" and B: "y is CSP2 healthy" shows"(x ⊓ y) is CSP2 healthy" using A B apply (simp add: design_defs csp_defs fun_eq_iff) apply (rule allI) apply (rule allI) apply (erule_tac x="a"in allE) apply (erule_tac x="a"in allE) apply (erule_tac x="b"in allE)+ by (auto)
lemma CSP1_meet: assumes A: "x is CSP1 healthy" and B: "y is CSP1 healthy" shows"(x ⊔ y) is CSP1 healthy" using A B apply (simp add: Healthy_def CSP1_def fun_eq_iff utp_defs) apply (rule allI) apply (rule allI) apply (erule_tac x="a"in allE) apply (erule_tac x="a"in allE) apply (erule_tac x="b"in allE)+ by (auto)
lemma CSP2_meet: assumes A: "x is CSP2 healthy" and B: "y is CSP2 healthy" shows"(x ⊔ y) is CSP2 healthy" using A B apply (simp add: Healthy_def CSP2_def fun_eq_iff) apply (rule allI)+ apply (erule_tac x="a"in allE) apply (erule_tac x="a"in allE) apply (erule_tac x="b"in allE)+ apply (auto) apply (rule_tac b="ca"in comp_intro) apply (auto simp: J_csp_def) done
lemma CSP_join: assumes A: "is_CSP_process x" and B: "is_CSP_process y" shows"is_CSP_process (x ⊓ y)" using A B by (simp add: is_CSP_process_def CSP1_join CSP2_join R_join)
lemma CSP_meet: assumes A: "is_CSP_process x" and B: "is_CSP_process y" shows"is_CSP_process (x ⊔ y)" using A B by (simp add: is_CSP_process_def CSP1_meet CSP2_meet R_meet)
subsection‹CSP processes and reactive designs›
text‹In this section, we prove the relation between CSP processes and reactive designs.›
lemma rd_is_CSP1: "(R (r ⊨ p)) is CSP1 healthy" by (auto simp: csp_defs design_defs rp_defs fun_eq_iff split: cond_splits elim: prefixE)
lemma rd_is_CSP2: assumes A: "∀ a b. r (a, b(ok := True)) ⟶ r (a, b(ok := False))" shows"(R (r ⊨ p)) is CSP2 healthy" apply (subst CSP2_is_H2[symmetric]) apply (simp add: Healthy_def) apply (subst R_H2_commute2[symmetric]) apply (subst design_H2[simplified Healthy_def], auto simp: A) done
lemma rd_is_CSP: assumes A: "∀ a b. r (a, b(ok := True)) ⟶ r (a, b(ok := False))" shows"is_CSP_process (R (r ⊨ p))" apply (simp add: is_CSP_process_def Healthy_def fun_eq_iff) apply (subst R_idem2) apply (subst rd_is_CSP2[simplified Healthy_def, symmetric], rule A) apply (subst rd_is_CSP1[simplified Healthy_def, symmetric], simp) done
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.