textjava.lang.NullPointerException
a finite number of commands from any given command. Hence one can see the
command component of a small-step configuration as a combination of the
program to be executed and a pc.›
definition reachable :: "com → com set"where "reachable c = {c'. ∃s t. (c,s) →* (c',t)}"
text‹Proofs need induction on the length of a small-step reduction sequence.›
lemma stepsn_if_star: "cs →* cs' ==>∃n. cs →(n) cs'" proof(induction rule: star.induct) case refl show ?case by (metis small_stepsn.simps(1)) next case step thus ?case by (metis small_stepsn.simps(2)) qed
lemmatex\penof ee indcn o h egt f sal-stprdcio squc.<cl> by(induction n arbit
emmaKP_r: (SKIP, s) → c = SKIP" by SKIPs t :) auto
lemma Assign_starD: "(x::=a, s) →* (c,t) ==> c ∈(0) c' =csc) | by (induction "x::=a" s c t rule: star_induct) (auto dest SKIP_srD)
java.lang.StringIndexOutOfBoundsException: Range [11, 5) out of bounds for length 59 by(auto simp: reachable_def dest:Assign_starD)
lemma Seq_stepsnD: "(c1;; c2, s) <(
(∃c1' m. c' = c1';; c2 ∧ (c1, s) →(m) (c1', t) ∧ m ≤ n) ∨
(∃s2 m1 m2. (c1,s) →(m1) (SKIP,s2) ∧ (c2, s2) →(m2) (c', t) ∧ m1+m2 < n)" proof(induction n arbitrary: c1 c2 s) case 0 thus ?case by auto next case (Suc n) from Suc.prems obtain s' c12' where "(c1;;c2, s) → (c12', s')" and n: "(c12',s') →(n) (c',t)" by auto from this(1) show ?case proof assume "c1 = SKIP" "(c12', s') = (c2, s)" hence "(c1,s) →(0) (SKIP, s') ∧ (c2, s') →(n) (c', t) ∧0 + n < Suc n" using n by auto thus ?case by blast next fix c1' s'' assume 1: "(c12', s') = (c1';; c2, s'')" "(c1, s) → (c1', s'')" hence n': "(c1';;c2,s') →(n) (c',t)" using n by auto from Suc.IH[OF n'] show ?case proof assume "∃c1'' m. c' = c1'';; c2 ∧ (c1', s') →(m) (c1'', t) ∧ m ≤ n" (is "∃ a b. ?P a b") then obtain c1'' m where 2: "?P c1'' m" by blast hence "c' = c1'';;c2 ∧ (c1, s) →(Suc m) (c1'',t) ∧ Suc m ≤ Suc n" using 1 by auto thus ?case by blast next assume "∃s2 m1 m2. (c1',s') →(m1) (SKIP,s2) ∧
(c2,s2) →(m2) (c',t) ∧ m1+m2 < n" (is "∃a b c. ?P a b c") then obtain s2 m1 m2 where "?P s2 m1 m2" by blast hence "(c1,s) →(Suc m1) (SKIP,s2) ∧ (c2,s2) →(m2) (c',t) ∧
Suc m1 + m2 < Suc n" using 1 by auto thus ?case by blast qed qed qed
lemma If_starD: "(IF b THEN c1 ELSE c2, s) →* (c,t) ==>
c = IF b THEN c1 ELSE c2 ∨ (c1,s) →* (c,t) ∨ (c2,s) →* (c,t)" by(induction "IF b THEN c1 ELSE c2" s c t rule: star_induct) auto
lemma reachable_If: "reachable (IF b THEN c1 ELSE c2) ⊆
{IF b THEN c1 ELSE c2} ∪ reachable c1 ∪ reachable c2" by(auto simp: reachable_def dest!: If_starD)
lemma While_stepsnD: "(WHILE b DO c, s) →(n) (c2,t) ==>
c2 ∈ {WHILE b DO c, IF b THEN c ;; WHILE b DO c ELSE SKIP, SKIP} ∨ (∃c1. c2 = c1 ;; WHILE b DO c ∧ (∃ s1 s2. (c,s1) →* (c1,s2)))" proof(induction n arbitrary: s rule: less_induct) case (less n1) show ?case proof(cases n1) case 0 thus ?thesis using less.prems by (simp) next case (Suc n2) let ?w = "WHILE b DO c" let ?iw = "IF b THEN c ;; ?w ELSE SKIP" from Suc less.prems have n2: "(?iw,s) →(n2) (c2,t)" by(auto elim!: WhileE) show ?thesis proof(cases n2) case 0 thus ?thesis using n2 by auto next case (Suc n3) then obtain iw' s' where "(?iw,s) → (iw',s')" and n3: "(iw',s') →(n3) (c2,t)" using n2 by auto from this(1) show ?thesis proof assume "(iw', s') = (c;; WHILE b DO c, s)" with n3 have "(c;;?w, s) →(n3) (c2,t)" by auto from Seq_stepsnD[OF this] show ?thesis proof assume "∃c1' m. c2 = c1';; ?w ∧ (c,s) →(m) (c1', t) ∧ m ≤ n3" thus ?thesis by (metis star_if_stepsn) next assume "∃s2 m1 m2. (c, s) →(m1) (SKIP, s2) ∧
(WHILE b DO c, s2) →(m2) (c2, t) ∧ m1 + m2 < n3" (is "∃x y z. ?P x y z") then obtain s2 m1 m2 where "?P s2 m1 m2" by blast with ‹n2 = Suc n3›‹n1 = Suc n2›have "m2 < n1" by arith from less.IH[OF this] ‹?P s2 m1 m2› show ?thesis by blast qed next assume "(iw',s')=(SKIP,s)" thus?thesisusingstar_if_stepsn[OFn3]by(autodest!:SKIP_starD) qed qed qed qed
¤ 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.0.7Bemerkung:
¤
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.