theory Monitor_Code imports"HOL-Library.Code_Target_Nat""Containers.Containers" Monitor Preliminaries begin
derive (eq) ceq enat
instantiation enat :: ccompare begin
definition ccompare_enat :: "enat comparator option"where "ccompare_enat = Some (λx y. if x = y then order.Eq else if x < y then order.Lt else order.Gt)"
lemma iarray_list_of_inj: "IArray.list_of xs = IArray.list_of ys ==> xs = ys" by (cases xs; cases ys) auto
instantiation iarray :: (ccompare) ccompare begin
definition ccompare_iarray :: "('a iarray ==> 'a iarray ==> order) option"where "ccompare_iarray = (case ID CCOMPARE('a list) of None ==> None | Some c ==> Some (λxs ys. c (IArray.list_of xs) (IArray.list_of ys)))"
lemma tfin_enat_code[code]: "(tfin :: enat set) = Collect_set (λx. x ≠∞)" by (auto simp: tfin_enat_def)
lemma tfin_ereal_code[code]: "(tfin :: ereal set) = Collect_set (λx. x ≠ -∞∧ x ≠∞)" by (auto simp: tfin_ereal_def)
lemma Ball_atms[code_unfold]: "Ball (atms r) P = list_all P (collect_subfmlas r [])" using collect_subfmlas_atms[where ?phis="[]"] by (auto simp: list_all_def)
lemma MIN_fold: "(MIN x∈set (z # zs). f x) = fold min (map f zs) (f z)" by (metis Min.set_eq_fold list.set_map list.simps(9))
declare progress.simps(1-8)[code]
lemma progress_matchP_code[code]: "progress (MatchP I r) ts = (case collect_subfmlas r [] of x # xs ==> fold min (map (λf. progress f ts) xs) (progress x ts))" using collect_subfmlas_atms[where ?r=r and ?phis="[]"] atms_nonempty[of r] by (auto split: list.splits) (smt (z3) MIN_fold[where ?f="λf. progress f ts"] list.simps(15))
lemma progress_matchF_code[code]: "progress (MatchF I r) ts = (if length ts = 0 then 0 else (let k = min (length ts - 1) (case collect_subfmlas r [] of x # xs ==> fold min (map (λf. progress f ts) xs) (progress x ts)) in Min {j ∈ {..k}. memR (ts ! j) (ts ! k) I}))" by (auto simp: progress_matchP_code[unfolded progress.simps])
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.