(* Title: HOL/UNITY/Comp.thy Author: Lawrence C Paulson, Cambridge University Computer Laboratory Author: Sidi Ehmety
Composition.
From Chandy and Sanders, "Reasoning About Program Composition", Technical Report 2000-003, University of Florida, 2000.
*)
section‹Composition: Basic Primitives›
theory Comp imports Union begin
instantiation program :: (type) ord begin
definition component_def: "F \ H \ (\G. F\G = H)"
definition strict_component_def: "F < (H::'a program) \ (F \ H & F \ H)"
instance ..
end
definition component_of :: "'a program =>'a program=> bool" (infixl‹component'_of\ 50) where"F component_of H == \G. F ok G & F\G = H"
definition strict_component_of :: "'a program\'a program=> bool" (infixl‹strict'_component'_of› 50) where"F strict_component_of H == F component_of H & F\H"
definition preserves :: "('a=>'b) => 'a program set" where"preserves v == \z. stable {s. v s = z}"
definition localize :: "('a=>'b) => 'a program => 'a program"where "localize v F == mk_program(Init F, Acts F,
AllowedActs F ∩ (∪G ∈ preserves v. Acts G))"
definition funPair :: "['a => 'b, 'a => 'c, 'a] => 'b * 'c" where"funPair f g == %x. (f x, g x)"
subsection‹The component relation› lemma componentI: "H \ F | H \ G ==> H \ (F\G)" apply (unfold component_def, auto) apply (rule_tac x = "G\Ga"in exI) apply (rule_tac [2] x = "G\F"in exI) apply (auto simp add: Join_ac) done
lemma component_eq_subset: "(F \ G) =
(Init G ⊆ Init F & Acts F ⊆ Acts G & AllowedActs G ⊆ AllowedActs F)" apply (unfold component_def) apply (force intro!: exI program_equalityI) done
lemma stable_localTo_stable2: "[| F \ stable {s. P (v s) (w s)};
G ∈ preserves v; G ∈ preserves w |]
==> F⊔G ∈ stable {s. P (v s) (w s)}" apply simp apply (subgoal_tac "G \ preserves (funPair v w) ") prefer 2 apply simp apply (drule_tac P1 = "case_prod Q"for Q in preserves_subset_stable [THEN subsetD],
auto) done
lemma Increasing_preserves_Stable: "[| F \ stable {s. v s \ w s}; G \ preserves v; F\G \ Increasing w |]
==> F⊔G ∈ Stable {s. v s ≤ w s}" apply (auto simp add: stable_def Stable_def Increasing_def Constrains_def all_conj_distrib) apply (blast intro: constrains_weaken) (*The G case remains*) apply (auto simp add: preserves_def stable_def constrains_def) (*We have a G-action, so delete assumptions about F-actions*) apply (erule_tac V = "\act \ Acts F. P act"for P in thin_rl) apply (erule_tac V = "\z. \act \ Acts F. P z act"for P in thin_rl) apply (subgoal_tac "v x = v xa") apply auto apply (erule order_trans, blast) done
(** component_of **)
(* component_of is stronger than \<le> *) lemma component_of_imp_component: "F component_of H ==> F \ H" by (unfold component_def component_of_def, blast)
(* component_of satisfies many of the same properties as \<le> *) lemma component_of_refl [simp]: "F component_of F" apply (unfold component_of_def) apply (rule_tac x = SKIP in exI, auto) done
lemma component_of_SKIP [simp]: "SKIP component_of F" by (unfold component_of_def, auto)
lemma component_of_trans: "[| F component_of G; G component_of H |] ==> F component_of H" apply (unfold component_of_def) apply (blast intro: Join_assoc [symmetric]) 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.