text‹ Here, we mechanise a representation of UTP theories using locales~cite‹"Ballarin06"›. We also
link them to the HOL-Algebra library~cite‹"Ballarin17"›, which allows us to import properties from
complete lattices and Galois connections. ›
lemma upred_weak_complete_lattice [simp]: "weak_complete_lattice P" by (simp add: upred_lattice.weak.weak_complete_lattice_axioms)
lemma upred_lattice_eq [simp]: "(.=<P>) = (=)" by (simp add: upred_lattice_def)
lemma upred_lattice_le [simp]: "le P P Q = (P ⊑ Q)" by (simp add: upred_lattice_def)
lemma upred_lattice_carrier [simp]: "carrier P = UNIV" by (simp add: upred_lattice_def)
lemma Healthy_fixed_points [simp]: "fps P H = [H]H" by (simp add: fps_def upred_lattice_def Healthy_def)
lemma upred_lattice_Idempotent [simp]: "Idem<P> H = Idempotent H" using upred_lattice.weak_partial_order_axioms by (auto simp add: idempotent_def Idempotent_def)
lemma upred_lattice_Monotonic [simp]: "Mono<P> H = Monotonic H" using upred_lattice.weak_partial_order_axioms by (auto simp add: isotone_def mono_def)
subsection‹ UTP theories hierarchy ›
definition utp_order :: "('α × 'α) health ==> 'α hrel gorder"where "utp_order H = ( carrier = {P. P is H}, eq = (=), le = (⊑) )"
text‹ Constant @{term utp_order} obtains the order structure associated with a UTP theory.
Its carrier is the set of healthy predicates, equality is HOL equality, and the order is
refinement. ›
lemma isotone_utp_orderI: "Monotonic H ==> isotone (utp_order X) (utp_order Y) H" by (auto simp add: mono_def isotone_def utp_weak_partial_order)
lemma Mono_utp_orderI: "[∧ P Q. [ P ⊑ Q; P is H; Q is H ]==> F(P) ⊑ F(Q) ]==> Mono H F" by (auto simp add: isotone_def utp_weak_partial_order)
text‹ The UTP order can equivalently be characterised as the fixed point lattice, @{const fpl}. ›
lemma utp_order_fpl: "utp_order H = fpl P H" by (auto simp add: utp_order_def upred_lattice_def fps_def Healthy_def)
subsection‹ UTP theory hierarchy ›
text‹ We next define a hierarchy of locales that characterise different classes of UTP theory.
Minimally we require that a UTP theory's healthiness condition is idempotent. ›
text‹ The healthiness conditions of a UTP theory lattice form a complete lattice, and allows us to make
use of complete lattice results from HOL-Algebra~cite‹"Ballarin17"›, such as the Knaster-Tarski theorem. We can also
retrieve lattice operators as below. ›
abbreviation utp_top (‹\⊤›) where"utp_top ≡ top (utp_order H)"
lemma upred_lattice_inf: "Lattice.inf P A = ⊓ A" by (metis Sup_least Sup_upper UNIV_I antisym_conv subsetI upred_lattice.weak.inf_greatest upred_lattice.weak.inf_lower upred_lattice_carrier upred_lattice_le)
text‹ We can then derive a number of properties about these operators, as below.›
context utp_theory_lattice begin
lemma LFP_healthy_comp: "\<mu> F = \<mu> (F ∘H)" proof - have"{P. (P is H) ∧ F P ⊑ P} = {P. (P is H) ∧ F (H P) ⊑ P}" by (auto simp add: Healthy_def) thus ?thesis by (simp add: LEAST_FP_def) qed
lemma GFP_healthy_comp: "\<nu> F = \<nu> (F ∘H)" proof - have"{P. (P is H) ∧ P ⊑ F P} = {P. (P is H) ∧ P ⊑ F (H P)}" by (auto simp add: Healthy_def) thus ?thesis by (simp add: GREATEST_FP_def) qed
lemma top_healthy [closure]: "\<top> is H" using weak.top_closed by auto
lemma bottom_healthy [closure]: "\<bottom> is H" using weak.bottom_closed by auto
lemma utp_top: "P is H==> P ⊑\<top>" using weak.top_higher by auto
lemma utp_bottom: "P is H==>\<bottom> ⊑ P" using weak.bottom_lower by auto
end
lemma upred_top: "⊤<P> = false" using ball_UNIV greatest_def by fastforce
lemma upred_bottom: "⊥<P> = true" by fastforce
text‹ One way of obtaining a complete lattice is showing that the healthiness conditions
are monotone, which the below locale characterises. ›
hence"complete_lattice (utp_order H)" by (simp add: utp_order_def, simp add: upred_lattice_def)
thus"utp_theory_lattice H" by (simp add: utp_theory_axioms utp_theory_lattice.intro utp_theory_lattice_axioms.intro) qed
text‹ In a monotone theory, the top and bottom can always be obtained by applying the healthiness
condition to the predicate top and bottom, respectively. ›
context utp_theory_mono begin
lemma healthy_top: "\<top> = H(false)" proof - have"\<top> = ⊤PH" by (simp add: utp_order_fpl) alsohave"... = H⊤<P>" using Knaster_Tarski_idem_extremes(1)[of PH] by (simp add: HCond_Idempotent HCond_Mono) alsohave"... = H false" by (simp add: upred_top) finallyshow ?thesis . qed
lemma healthy_bottom: "\<bottom> = H(true)" proof - have"\<bottom> = ⊥PH" by (simp add: utp_order_fpl) alsohave"... = H⊥<P>" using Knaster_Tarski_idem_extremes(2)[of PH] by (simp add: HCond_Idempotent HCond_Mono) alsohave"... = H true" by (simp add: upred_bottom) finallyshow ?thesis . qed
lemma healthy_inf: assumes"A ⊆[H]H" shows"\<Sqinter> A = H (⊓ A)" using Knaster_Tarski_idem_inf_eq[OF upred_weak_complete_lattice, of "H"] by (simp, metis HCond_Idempotent HCond_Mono assms partial_object.simps(3) upred_lattice_def upred_lattice_inf utp_order_def)
sublocale utp_theory_continuous ⊆ utp_theory_mono proof show"Monotonic H" by (simp add: Continuous_Monotonic HCond_Cont) qed
context utp_theory_continuous begin
lemma healthy_inf_cont: assumes"A ⊆[H]H""A ≠ {}" shows"\<Sqinter> A = ⊓ A" proof - have"\<Sqinter> A = ⊓ (H`A)" using Continuous_def HCond_Cont assms(1) assms(2) healthy_inf by auto alsohave"... = ⊓ A" by (unfold Healthy_carrier_image[OF assms(1)], simp) finallyshow ?thesis . qed
lemma healthy_inf_def: assumes"A ⊆[H]H" shows"\<Sqinter> A = (if (A = {}) then \<top> else (⊓ A))" using assms healthy_inf_cont weak.weak_inf_empty by auto
lemma healthy_meet_cont: assumes"P is H""Q is H" shows"P \<sqinter> Q = P ⊓ Q" using healthy_inf_cont[of "{P, Q}"] assms by (simp add: Healthy_if meet_def)
lemma meet_is_healthy [closure]: assumes"P is H""Q is H" shows"P ⊓ Q is H" by (metis Continuous_Disjunctous Disjunctuous_def HCond_Cont Healthy_def' assms(1) assms(2))
lemma meet_bottom [simp]: assumes"P is H" shows"P ⊓\<bottom> = \<bottom>" by (simp add: assms semilattice_sup_class.sup_absorb2 utp_bottom)
lemma meet_top [simp]: assumes"P is H" shows"P ⊓\<top> = P" by (simp add: assms semilattice_sup_class.sup_absorb1 utp_top)
text‹ The UTP theory lfp operator can be rewritten to the alphabetised predicate lfp when
in a continuous context. ›
theorem utp_lfp_def: assumes"Monotonic F""F ∈[H]H→[H]H" shows"\<mu> F = (μ X ∙ F(H(X)))" proof (rule antisym) have ne: "{P. (P is H) ∧ F P ⊑ P} ≠ {}" proof - have"F \<top> ⊑\<top>" using assms(2) utp_top weak.top_closed by force thus ?thesis by (auto, rule_tac x="\<top>"in exI, auto simp add: top_healthy) qed show"\<mu> F ⊑ (μ X ∙ F (H X))" proof - have"⊓{P. (P is H) ∧ F(P) ⊑ P} ⊑⊓{P. F(H(P)) ⊑ P}" proof - have1: "∧ P. F(H(P)) = H(F(H(P)))" by (metis HCond_Idem Healthy_def assms(2) funcset_mem mem_Collect_eq) show ?thesis proof (rule Sup_least, auto) fix P assume a: "F (H P) ⊑ P" hence F: "(F (H P)) ⊑ (H P)" by (metis 1 HCond_Mono mono_def) show"⊓{P. (P is H) ∧ F P ⊑ P} ⊑ P" proof (rule Sup_upper2[of "F (H P)"]) show"F (H P) ∈ {P. (P is H) ∧ F P ⊑ P}" proof (auto) show"F (H P) is H" by (metis 1 Healthy_def) show"F (F (H P)) ⊑ F (H P)" using F mono_def assms(1) by blast qed show"F (H P) ⊑ P" by (simp add: a) qed qed qed
with ne show ?thesis by (simp add: LEAST_FP_def gfp_def, subst healthy_inf_cont, auto simp add: lfp_def) qed from ne show"(μ X ∙ F (H X)) ⊑\<mu> F" apply (simp add: LEAST_FP_def gfp_def, subst healthy_inf_cont, auto simp add: lfp_def) apply (rule Sup_least) apply (auto simp add: Healthy_def Sup_upper) done qed
lemma UINF_ind_Healthy [closure]: assumes"∧ i. P(i) is H" shows"(⊓ i ∙ P(i)) is H" by (simp add: closure assms)
end
text‹ In another direction, we can also characterise UTP theories that are relational. Minimally
this requires that the healthiness condition is closed under sequential composition. ›
locale utp_theory_rel =
utp_theory + assumes Healthy_Sequence [closure]: "[ P is H; Q is H]==> (P ;; Q) is H" begin
lemma upower_Suc_Healthy [closure]: assumes"P is H" shows"P ^ Suc n is H" by (induct n, simp_all add: closure assms upred_semiring.power_Suc)
end
locale utp_theory_cont_rel = utp_theory_rel + utp_theory_continuous begin
lemma seq_cont_Sup_distl: assumes"P is H""A ⊆[H]H""A ≠ {}" shows"P ;; (\<Sqinter> A) = \<Sqinter> {P ;; Q | Q. Q ∈ A }" proof - have"{P ;; Q | Q. Q ∈ A } ⊆[H]H" using Healthy_Sequence assms(1) assms(2) by (auto) thus ?thesis by (simp add: healthy_inf_cont seq_Sup_distl setcompr_eq_image assms) qed
lemma seq_cont_Sup_distr: assumes"Q is H""A ⊆[H]H""A ≠ {}" shows"(\<Sqinter> A) ;; Q = \<Sqinter> {P ;; Q | P. P ∈ A }" proof - have"{P ;; Q | P. P ∈ A } ⊆[H]H" using Healthy_Sequence assms(1) assms(2) by (auto) thus ?thesis by (simp add: healthy_inf_cont seq_Sup_distr setcompr_eq_image assms) qed
lemma uplus_healthy [closure]: assumes"P is H" shows"P+ is H" by (simp add: uplus_power_def closure assms)
end
text‹ There also exist UTP theories with units. Not all theories have both a left and a right unit
(e.g. H1-H2 designs) and so we split up the locale into two cases. ›
locale utp_theory_units =
utp_theory_rel + fixes utp_unit (‹II›) assumes Healthy_Unit [closure]: "II is H" begin
text‹ We can characterise the theory Kleene star by lifting the relational one. ›
definition utp_star (‹_\⋆› [999] 999) where
[upred_defs]: "utp_star P = (P\<star> ;; II)"
text‹ We can then characterise tests as refinements of units. ›
text‹ Example Galois connection / retract: Existential quantification ›
lemma Idempotent_ex: "mwb_lens x ==> Idempotent (ex x)" by (simp add: Idempotent_def exists_twice)
lemma Monotonic_ex: "mwb_lens x ==> Monotonic (ex x)" by (simp add: mono_def ex_mono)
lemma ex_closed_unrest: "vwb_lens x ==>[ex x]H = {P. x ♯ P}" by (simp add: Healthy_def unrest_as_exists)
text‹ Any theory can be composed with an existential quantification to produce a Galois connection ›
theorem ex_retract: assumes"vwb_lens x""Idempotent H""ex x ∘ H = H ∘ ex x" shows"retract ((ex x ∘ H) <==⟨ex x, H⟩==> H)" proof (unfold_locales, simp_all) show"H ∈[ex x ∘ H]H→[H]H" using Healthy_Idempotent assms by blast from assms(1) assms(3)[THEN sym] show"ex x ∈[H]H→[ex x ∘ H]H" by (simp add: Pi_iff Healthy_def fun_eq_iff exists_twice) fix P Q assume"P is (ex x ∘ H)""Q is H" thus"(H P ⊑ Q) = (P ⊑ (∃ x ∙ Q))" by (metis (no_types, lifting) Healthy_Idempotent Healthy_if assms comp_apply dual_order.trans ex_weakens utp_pred_laws.ex_mono vwb_lens_wb) next fix P assume"P is (ex x ∘ H)" thus"(∃ x ∙ H P) ⊑ P" by (simp add: Healthy_def) qed
corollary ex_retract_id: assumes"vwb_lens x" shows"retract (ex x <==⟨ex x, id⟩==> id)" using assms ex_retract[where H="id"] by (auto) end
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.14Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 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.