text‹Abstract interpretation over type ‹st› instead of functions.›
context Gamma_semilattice begin
fun aval' :: "aexp → 'av st → 'av"where "aval' (N i) S = num' i" | "aval' (V x) S = fun S x" | "aval' (Plus a1 a2) S = plus' (aval' a1 S) (aval' a2 S)"
lemma aval'_correct: "s ∈ γs S ==> aval a s ∈ γ(aval' a S)" by (induction a) (auto simp: gamma_num' gamma_plus' γ_st_def)
lemma gamma_Step_subcomm: fixes C1 C2 :: "'a::semilattice_sup acom" assumes"!!x e S. f1 x e (γo S) ⊆ γo (f2 x e S)" "!!b S. g1 b (γo S) ⊆ γo (g2 b S)" shows"Step f1 g1 (γo S) (γc C) ≤ γc (Step f2 g2 S C)" proof(induction C arbitrary: S) qed (auto simp: assms intro!: mono_gamma_o sup_ge1 sup_ge2)
lemma in_gamma_update: "[ s ∈ γs S; i ∈ γ a ]==> s(x := i) ∈ γs(update S x a)" by(simp add: γ_st_def)
end
locale Abs_Int = Gamma_semilattice where γ=γ for γ :: "'av::semilattice_sup_top → val set" begin
definition"step' = Step (λx e S. case S of None → None | Some S → Some(update S x (aval' e S))) (λb S. S)"
definition AI :: "com → 'av st option acom option"where "AI c = pfp (step' ⊤) (bot c)"
lemma strip_step'[simp]: "strip(step' S C) = strip C" by(simp add: step'_def)
lemma top_on_post: "top_on_acom C X ==> top_on_opt (post C) X" by(simp add: top_on_acom_def post_in_annos)
lemma top_on_acom_simps: "top_on_acom (SKIP {Q}) X = top_on_opt Q X" "top_on_acom (x ::= e {Q}) X = top_on_opt Q X" "top_on_acom (C1;;C2) X = (top_on_acom C1 X ∧ top_on_acom C2 X)" "top_on_acom (IF b THEN {P1} C1 ELSE {P2} C2 {Q}) X = (top_on_opt P1 X ∧ top_on_acom C1 X ∧ top_on_opt P2 X ∧ top_on_acom C2 X ∧ top_on_opt Q X)" "top_on_acom ({I} WHILE b DO {P} C {Q}) X = (top_on_opt I X ∧ top_on_acom C X ∧ top_on_opt P X ∧ top_on_opt Q X)" by(auto simp add: top_on_acom_def)
lemma top_on_sup: "top_on_opt o1 X ==> top_on_opt o2 X ==> top_on_opt (o1 ⊔ o2 :: _ st option) X" apply(induction o1 o2 rule: sup_option.induct) apply(auto) by transfer simp
lemma top_on_Step: fixes C :: "('a::semilattice_sup_top)st option acom" assumes"!!x e S. [top_on_opt S X; x ∉ X; vars e ⊆ -X]==> top_on_opt (f x e S) X" "!!b S. top_on_opt S X ==> vars b ⊆ -X ==> top_on_opt (g b S) X" shows"[ vars C ⊆ -X; top_on_opt S X; top_on_acom C X ]==> top_on_acom (Step f g S C) X" proof(induction C arbitrary: S) qed (auto simp: top_on_acom_simps vars_acom_def top_on_post top_on_sup assms)
locale Measure = Measure1 + assumes m2: "x < y ==> m x > m y" begin
lemma m1: "x ≤ y ==> m x ≥ m y" by(auto simp: le_less m2)
lemma m_s2_rep: assumes"finite(X)"and"S1 = S2 on -X"and"∀x. S1 x ≤ S2 x"and"S1 ≠ S2" shows"(∑x∈X. m (S2 x)) < (∑x∈X. m (S1 x))" proof- from assms(3) have1: "∀x∈X. m(S1 x) ≥ m(S2 x)"by (simp add: m1) from assms(2,3,4) have"∃x∈X. S1 x < S2 x" by(simp add: fun_eq_iff) (metis Compl_iff le_neq_trans) hence2: "∃x∈X. m(S1 x) > m(S2 x)"by (metis m2) from sum_strict_mono_ex1[OF ‹finite X›12] show"(∑x∈X. m (S2 x)) < (∑x∈X. m (S1 x))" . qed
lemma m_s2: "finite(X) ==> fun S1 = fun S2 on -X ==> S1 < S2 ==> m_s S1 X > m_s S2 X" apply(auto simp add: less_st_def m_s_def) apply (transfer fixing: m) apply(simp add: less_eq_st_rep_iff eq_st_def m_s2_rep) done
locale Abs_Int_measure =
Abs_Int_mono where γ=γ + Measure where m=m for γ :: "'av::semilattice_sup_top → val set"and m :: "'av → nat" begin
lemma top_on_step': "[ top_on_acom C (-vars C) ]==> top_on_acom (step' ⊤ C) (-vars C)" unfolding step'_def by(rule top_on_Step)
(auto simp add: top_option_def fun_top split: option.splits)
lemma AI_Some_measure: "∃C. AI c = Some C" unfolding AI_def apply(rule pfp_termination[where I = "λC. top_on_acom C (- vars C)"and m="m_c"]) apply(simp_all add: m_c2 mono_step'_top bot_least top_on_bot) using top_on_step' apply(auto simp add: vars_acom_def) done
end
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet am 2026-06-29)
¤
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.