theory Refinement imports Denotational_Semantics Circus_Syntax begin
subsection‹Definitions›
text‹In the following, data (state) simulation and functional backwards simulation
are defined. The simulation is defined as a function $S$, that corresponds to a state
abstraction function.›
definition"Simul S b = extend (make (ok b) (wait b) (tr b) (ref b)) (S (more b))"
definition
Simulation::"('θ::ev_eq,'σ) action ==> ('σ1 ==> 'σ) ==> ('θ, 'σ1) action ==> bool" (‹_ ⪯_ _›) where "A ⪯S B ≡∀ a b. (relation_of B) (a, b) ⟶ (relation_of A) (Simul S a, Simul S b)"
subsection‹Proofs›
text‹In order to simplify refinement proofs, some general refinement laws are
to deal with the refinement of Circus actions at operators level and not at UTP level.
these laws, and exploiting the advantages of a shallow embedding, the automated proof of
becomes surprisingly simple.›
lemma Schema_Sim: assumes A: "∧ a. (Pre sc1) (S a) ==> (Pre sc2) a" and B: "∧ a b. [Pre sc1 (S a) ; sc2 (a, b)]==> sc1 (S a, S b)" shows"(Schema sc1) ⪯S (Schema sc2)" by (auto simp: Simulation_def Simul_def relation_of_Schema rp_defs design_defs alpha_rp.defs A B
split: cond_splits)
lemma SUb_Sim: assumes A: "∧ a. (Pre sc1) (S a) ==> (Pre sc2) a" and B: "∧ a b. [Pre sc1 (S a) ; sc2 (a, b)]==> sc1 (S a, S b)" and C: "P ⪯S Q" shows"(state_update_before sc1 P) ⪯S (state_update_before sc2 Q)" apply (auto simp: Simulation_def Simul_def relation_of_state_update_before rp_defs design_defs alpha_rp.defs A B
split: cond_splits) apply (drule C[simplified Simulation_def, rule_format]) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto simp: A B Simul_def alpha_rp.defs) apply (clarsimp split: cond_splits)+ apply (drule C[simplified Simulation_def, rule_format]) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto simp: A B Simul_def alpha_rp.defs) apply (clarsimp split: cond_splits)+ apply (case_tac "ok aa", simp_all) apply (erule notE) back apply (drule C[simplified Simulation_def, rule_format]) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto simp: A B Simul_def alpha_rp.defs) apply (clarsimp split: cond_splits)+ apply (rule A) apply (case_tac "Pre sc1 (S (alpha_rp.more aa))", simp_all) apply (erule notE) back apply (drule C[simplified Simulation_def, rule_format]) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto simp: A B Simul_def alpha_rp.defs) apply (clarsimp split: cond_splits)+ apply (drule C[simplified Simulation_def, rule_format]) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto simp: A B Simul_def alpha_rp.defs) apply (clarsimp split: cond_splits)+ apply (rule B, auto) done
lemma Par_Sim: assumes A: " P ⪯S Q"and B: " P' ⪯S Q'" and C: "∧ a b. S (ns'2 a b) = ns2 (S a) (S b)" and D: "∧ a b. S (ns'1 a b) = ns1 (S a) (S b)" shows"(P [ ns1 | cs | ns2 ] P') ⪯S (Q [ ns'1 | cs | ns'2 ] Q')" apply (auto simp: Simulation_def relation_of_Par fun_eq_iff rp_defs Simul_def design_defs spec_def
alpha_rp.defs
dest: A[simplified Simulation_def Simul_def, rule_format]
B[simplified Simulation_def Simul_def, rule_format]) apply (split cond_splits)+ apply (simp, erule disjE, rule disjI1, simp, rule disjI2, simp_all, rule impI) apply (auto) apply (erule_tac x="tr ba"in allE, auto) apply (erule notE) back apply (rule_tac b="Simul S ba(ok := False)"in comp_intro) apply (auto simp: Simul_def alpha_rp.defs dest: A[simplified Simulation_def Simul_def, rule_format]) apply (erule_tac x="tr bb"in allE, auto) apply (erule notE) back apply (rule_tac b="Simul S bb(ok := False)"in comp_intro) apply (auto simp: Simul_def alpha_rp.defs dest: B[simplified Simulation_def Simul_def, rule_format]) apply (erule_tac x="tr ba"in allE, auto) apply (erule notE) back apply (rule_tac b="Simul S ba(ok := False)"in comp_intro) apply (auto simp: Simul_def alpha_rp.defs dest: A[simplified Simulation_def Simul_def, rule_format]) apply (erule_tac x="tr bb"in allE, auto) apply (erule notE) back apply (rule_tac b="Simul S bb(ok := False)"in comp_intro) apply (auto simp: Simul_def alpha_rp.defs dest: B[simplified Simulation_def Simul_def, rule_format]) apply (rule_tac x="Simul S s1"in exI) apply (rule_tac x="Simul S s2"in exI) apply (auto simp: Simul_def alpha_rp.defs
dest!: B[simplified Simulation_def Simul_def, rule_format]
A[simplified Simulation_def Simul_def, rule_format]
split: cond_splits) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto simp add: M_par_def alpha_rp.defs diff_tr_def fun_eq_iff ParMerge_def Simul_def
split : cond_splits) apply (rule_tac b="(ok = ok bb, wait = wait bb, tr = tr bb, ref = ref bb, … = S (alpha_rp.more bb))"in comp_intro, auto) apply (subst D[where a="(alpha_rp.more s1)"and b="(alpha_rp.more aa)", symmetric], simp) apply (subst C[where a="(alpha_rp.more s2)"and b="(alpha_rp.more bb)", symmetric], simp) apply (rule_tac b="(ok = ok bb, wait = wait bb, tr = tr bb, ref = ref bb, … = S (alpha_rp.more bb))"in comp_intro, auto) apply (subst D[where a="(alpha_rp.more s1)"and b="(alpha_rp.more aa)", symmetric], simp) apply (subst C[where a="(alpha_rp.more s2)"and b="(alpha_rp.more bb)", symmetric], simp) done
lemma Assign_Sim: assumes A: "∧ A. vy A = vx (S A)" and B: "∧ ff A. (S (y_update ff A)) = x_update ff (S A)" shows"(x `:=` vx) ⪯S (y `:=` vy)" by (auto simp: Simulation_def relation_of_Assign update_def rp_defs design_defs Simul_def A B
alpha_rp.defs split: cond_splits)
lemma Guard_Sim: assumes A: "P ⪯S Q"and B: "∧ A. h A = g (S A)" shows"(g `&` P) ⪯S (h `&` Q)" apply (auto simp: Simulation_def) apply (case_tac "h (alpha_rp.more a)") defer apply (case_tac "g (S (alpha_rp.more a))") apply (auto simp: true_Guard1 false_Guard1 Simul_def alpha_rp.defs Simulation_def B
dest!: A[simplified, rule_format] Stop_Sim[simplified, rule_format]) done
lemma Write0_Sim: assumes A: "P ⪯S Q" shows"a → P ⪯S a → Q " using A apply (auto simp: Simulation_def write0_def relation_of_Prefix0 design_defs rp_defs) apply (erule_tac x="ba"in allE) apply (erule_tac x="c"in allE, auto) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto split: cond_splits simp: Simul_def alpha_rp.defs do_def) done
lemma Read_Sim: assumes A: " P ⪯S Q"and B: "∧ A. (d A) = c (S A)" shows"a`?`c → P ⪯S a`?`d → Q" using A apply (auto simp: Simulation_def read_def relation_of_iPrefix design_defs rp_defs) apply (erule_tac x="ba"in allE, erule_tac x="ca"in allE, simp) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto split: cond_splits simp: Simul_def alpha_rp.defs do_I_def select_def B) done
lemma Read1_Sim: assumes A: " P ⪯S Q"and B: "∧ A. (d A) = c (S A)" shows"a`?`c`:`s → P ⪯S a`?`d`:`s → Q" using A apply (auto simp: Simulation_def read1_def relation_of_iPrefix design_defs rp_defs) apply (erule_tac x="ba"in allE, erule_tac x="ca"in allE, simp) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto split: cond_splits simp: Simul_def alpha_rp.defs do_I_def select_def B) done
lemma Read1S_Sim: assumes A: " P ⪯S Q"and B: "∧ A. (d A) = c (S A)"and C: "∧ A. (s' A) = s (S A)" shows"a`?`c`∈`s → P ⪯S a`?`d`∈`s' → Q" using A apply (auto simp: Simulation_def read1_def relation_of_iPrefix design_defs rp_defs) apply (erule_tac x="ba"in allE, erule_tac x="ca"in allE, simp) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto split: cond_splits simp: Simul_def alpha_rp.defs do_I_def select_def B C) done
lemma Write_Sim: assumes A: "P ⪯S Q"and B: "∧ A. (d A) = c (S A)" shows"a`!`c → P ⪯S a`!`d → Q " using A apply (auto simp: Simulation_def write1_def relation_of_oPrefix design_defs rp_defs) apply (erule_tac x="ba"in allE, erule_tac x="ca"in allE, simp) apply (rule_tac b="Simul S ba"in comp_intro) apply (auto split: cond_splits simp: Simul_def alpha_rp.defs do_def select_def B) done
lemma rd_ref: assumes A:"R (P ⊨ Q) ∈ {p. is_CSP_process p}" and B:"R (P' ⊨ Q') ∈ {p. is_CSP_process p}" and C:"∧ a b. P (a, b) ==> P' (a, b)" and D:"∧ a b. Q' (a, b) ==> Q (a, b)" shows"(action_of (R (P ⊨ Q))) ⊑ (action_of (R (P' ⊨ Q')))" apply (auto simp: ref_def) apply (subst (asm) action_of_inverse, simp add: B[simplified]) apply (subst action_of_inverse, simp add: A[simplified]) apply (auto simp: rp_defs design_defs C D split: cond_splits) done
lemma rd_impl: assumes A:"R (P ⊨ Q) ∈ {p. is_CSP_process p}" and B:"R (P' ⊨ Q') ∈ {p. is_CSP_process p}" and C:"∧ a b. P (a, b) ==> P' (a, b)" and D:"∧ a b. Q' (a, b) ==> Q (a, b)" shows"R (P' ⊨ Q') (a, b) ⟶ R (P ⊨ Q) (a::('a::ev_eq, 'b) alpha_rp_scheme, b)" apply (insert rd_ref[of P Q P' Q', OF A B C D]) apply (auto simp: ref_def) apply (subst (asm) action_of_inverse, simp add: B[simplified]) apply (subst (asm) action_of_inverse, simp add: A[simplified]) apply (erule_tac x=a in allE) apply (erule_tac x=b in allE) apply (auto) done
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.