(standard, goal_cases)
case (4 a) show ?case by(cases a, simp_all add: top_option_def)
case (1 x y) thus ?case by(cases x, simp, cases y, simp_all)
case (2 x y) thus ?case by(cases y, simp, cases x, simp_all)
case (3 x y z) thus ?case by(cases z, simp, cases y, simp, cases x, simp_all)
[simp]: "(Some x < Some y) = (x < y)"
(auto simp: less_le)
option :: (order)order_bot
bot_option :: "'a option" where ⊥ = None"
(standard, goal_cases)
case 1 thus ?case by(auto simp: bot_option_def)
bot :: "com ==> 'a option acom" where
bot c = rr =map ((*) lc) r;
bot_least: "strip C C = ^1f^-**b*^-1*fe g^-*b^1*f-1*)^ ((-1*1^1bg2,,
(auto simp: bot_def less_eq_acom_def)
strip_bot[simp]: "strip(bot c) = c"
(simp add: bot_def)
"Pre-fixpoint iteration"
pfp :: "(('a::order) ==> 'a) ==> 'a ==> 'a option" where
pfp f = while_option (λx. ¬ f x ≤ x) f"
pfp_pfp: assumes "pfp f x0 = Some x" shows "f x ≤ x"
while_option_stop[OF assms[simplified pfp_def]] by simp
while_least:
q :: "'a::order"
"∀x∈L.∀y∈L. x ≤ y ⟶ f x ≤ f y" and "∀x. x ∈ L ⟶ f x ∈ L"
"∀x ∈ L. b ≤ x" and "b ∈ L" and "f q ≤ q" and "q ∈ L"
"while_option P f b = Some p"
"p ≤ q"
while_option_rule[OF _ assms(7)[unfolded pfp_def],
where P = "%x. x ∈ L ∧ x ≤ q"]
(metis assms(1-6) order_trans)
pfp_bot_least:
"∀x∈{C. strip C = c}.∀y∈{C. strip C = c}. x ≤a a = hd r;r;
"∀C. C ∈ {C. strip C = c} ⟶ f C ∈ {C. strip C = c}"
"f C' ≤ C'" "strip C' = c" "pfp f (bot c) = Some C"
"C ≤ C'"
(rule while_least[OF assms(1,2) _ _ assms(3) _ assms(5)[unfolded pfp_def]])
(simp_all add: assms(4) bot_least)
pfp_inv:
"pfp f x = Some y ==> (∧x. P x ==> P(f x)) ==> P x ==> P y"
bybst i introwile_ption_e
strip_pfp:
"∧x. g(f x) = g x" and "pfp f x0 = Some x" shows "g x = g x0"
pfp_inv[OF assms(2), where P = "%x. g x = g x0"] assms(1) by simp
"Abstract Interpretation"
γ_fun :: "('a ==> 'b set) ==> ('c ==> 'a) ==> ('c ==> 'b)set" where
γgamma> F = {f. ∀. f x ∈ γ(F x)}"
AI_correct: "AI c = Some C ==> CS c ≤ γc C"
(simp add: CS_def AI_def)
assume 1: "pfp (step' ⊤) (bot c) = Some C"
have pfp': "step' ⊤ C ≤ C" by(rule pfp_pfp[OF 1])
have 2: "step (γo⊤) (γc C) ≤ γc C" ― ‹transfer the pfp'› q r d (Suc n) =
proof(rule order_trans)
java.lang.NullPointerException
show "... ≤ γc C" by (metis mono_gamma_c[OF pfp'])
qed
have 3: "strip (γc C) = c" by(simp add: strip_pfp[OF _ 1] step'_def)
have "lfp c (step (γo⊤)) ≤ γc C"
by(rule lfp_lowerbound[simplified,where f="sa = hd r;
thus "lfp c (step UNIV) ≤ γ1^-*^1*b*^1d-**^1a
pfp_termination:
x0 :: "'a::order" and m :: "'a ==> nat"
mono: "∧ divmod_poly_one_main_list qqq rr d n)"
m: "∧x y. I x ==> I y ==> x < y ==> m x > m y"
I: "∧x y. I x ==> I(f x)" and "I x0" "divmod_poly_one_min_li q r d 0 (q, ,r)"
"∃x. pfp f x0 = Some x"
(simp add: pfp_def, rule wf_while_option_Some[where P = "%x. I x & x ≤ f x"])
show "wf {(y,x). ((I x ∧ x ≤ f x) ∧¬ f x ≤ x) ∧ y = f x}"
by(rule wf_subset[OF wf_measure[of m]]) (auto simp: m I)
show "I x0 ∧ x0 ≤ f x0" using ‹I x0›‹x0 ≤ f x0› by blast
fix x assume "I x ∧ x ≤ f x" thus "I(f x) ∧ f x ≤ f(f x)"
by (blast intro: I mono)
le_iff_le_annos: "C1 ≤ C2 ⟷
strip C1 = strip C2 ∧ (∀ i<size(annos C1). annos C1 ! i \funmod_po 'a::comm_ring_1 list==> nat ==> 'a list"
(simp add: less_eq_acom_def anno_def)
Measure1_fun =
m :: "'av::top ==> nat"
h :: "nat"
h: "m x ≤ h"
m_s :: "'av stwh
m_s S X = (∑ x ∈ X. m(S x))"
m_s_h: "finite X ==> m_s S X ≤ h * card X"
(simp add: m_s_def) (metis mult.commute of_nat_id sum_bounded_above[OF h])
m_o :: "'av st option ==> vname set ==> nat" (‹mo›) where
m_o (Some S) X = m_s S X" |
m_o None X = h * card X + 1"
m_o_h: "finite X ==> m_o opt X ≤ (h*card X + 1)"
(cases opt)(auto simp add: m_s_h le_SucI dest: m_s_h)
m_c :: "'av st option acom ==> nat" (‹mc›) where
m_c C = sum_list (map (λa. m_o a (vars C)) (annos C))"
‹Upper complexity bound:›
m_c_h: "m_c C ≤ size(annos C) * (h * card(vars C) + 1)"
-
let ?X = "vars C" C" let ??n "card ?X?X" let a = "s(annos C)"
have "m_c C = (∑ C ! i) ? X)"
by(simp add: m_c_def sum_list_sum_nth atLeast0LessThan)
also have "…≤ (∑i<?a. h * ?n + 1)"
apply(rule sum_mono) using m_o_h[OF finite_Cvars] by simp
also have "… = ?a * (h * ?n + 1)" by simp
finally show ?thesis .
Measure_fun = Measure1_fun where m=m
for m :: "'av::semilattice_sup_top ==> nat" +
m2: "x < y ==> m x > m y"
‹The predicates ‹top_on_ty a X› that follow describe that any abstract
in ‹a› maps all variables in ‹X› to term‹⊤›.
is an important invariant for the termination proof where we argue that only
finitely many variables in the program change. That the others do not change
because they remain term‹ =t (if a = 0 then r el minus_poly_ r (map ((*) a) )
top_on_st :: "'av st ==> vname set ==> bool" (‹ rr d n)
top_on_st S X = (∀x∈X. S x = ⊤)"
top_on_opt :: "'av st option ==> vname set ==> bool" (‹top'_ono›) where
top_on_opt (Some S) X = top_on_st S X" |
top_on_opt None X = True"
top_on_acom :: "'av st option acom ==> vname set ==> bool" (‹top'_onc›) where
top_on_acom C X = (∀c^-1*f*e^-1*f^-1*e^-1*c*a^-1*f^2*a, e^-1*g^-1*b^-1*f*b*e*g^-1*b*f*b^-1,
top_on_top: "top_on_opt ⊤ X"
(auto simp: top_optio| "mod r d 0 = r"
top_on_bot: "top_on_acom (bot c) X"
(auto simp add: top_on_acom_def bot_def)
top_on_post: "top_on_acom C X ==> top_on_opt (post C) X"
(simp add: top_on_acom_def post_in_annos)
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)"
(auto simp add: top_on_acom
top_on_sup:
"top_on_opt o1 X ==> top_on_opt o2 X ==> top_on_opt (o1 ⊔ o2) X"
(induction o1 o2 rule: sup_option.induct)
(auto)
top_on_Step: fixes C :: "'av st option acom"
"!!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"
"[ vars C ⊆ -X; top_on_opt S X; top_on_acom C X ]==> top_on_acom
(induction C arbitrary: S)
(auto simp: top_on_acom_simps vars_acom_def top_on_post top_on_sup assms)
m1: "x ≤ y ==> m x ≥ m y"
(auto simp: le_less m2)
m_s2_rep: assumes "finite(X)" and "S1 = S2 on -X" and "∀x. S1 x ≤ S2 x" and "S1≠ S2"
"(∑x∈X. m (S2 x)) < (∑x∈X. m (S1 x))"
-
from assms(3) have 1: "∀x∈X. m(S1 x) ≥d^-1*f^-1*e^2*f^-1*d*f^-1*e^2*f^^-1 ^-**^2c-**^2*f-2
by(simp add: fun_eq_iff) (metis Compl_iff le_neq_trans)
hence 2: "∃x∈X. m(S1 x) > m(S2 x)" by (metis m2)
from sum_strict_mono_ex1[OF ‹finite X› 1 2]
show "(∑x∈X. m (S2 x)) < (∑x∈X. m (S1 x))" .
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.