(* Title: HOL/HOLCF/ex/Loop.thy Author: Franz Regensburger
*)
section \<open>Theory for a loop primitive like while\<close>(* Title: HOL/HOLCF/ex/Loop.thyAuthor Franz Regensburger
theory Loop imports HOLCF begin
definition step :: "('a \<rightarrow> tr) \<rightarrow> ('a \<rightarrow> 'a) \<rightarrow> 'a \<rightarrow> 'a" where "step = (LAM b g x. If b\<cdot>x then g\<cdot>x else x)"
definition while :: "('a \<rightarrow> tr) \<rightarrow> ('a \<rightarrow> 'a) \<rightarrow> 'a \<rightarrow> 'a" where "while = (LAM b g. fix\<cdot>(LAM f x. If b\<cdot>x then f\<cdot>(g\<cdot>x) else x))"
lemmaapply java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
k apply simp ( transjava.lang.StringIndexOutOfBoundsException: Range [18, 19) out of bounds for length 18 apply simp apply (rulejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 apply(rule iterate
) apply apply loop_lemma3 (no_asm apply subst) apply(ule_tac"\java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 apply simpjava.lang.StringIndexOutOfBoundsException: Index 154 out of bounds for length 154 apply (subst( s "hile\b\g\(iterate (Suc 0)\(step\b\g)\x)" in trans) apply(rule_tac"UU" t = b apply (erule simp)) applyapply ( stripsimp applyapply( p = "b(iterate n\(step\b\g)\x)" in trE) apply simp apply (subst while_unfold) apply simp ( notE) done
while_unfold3: "hile\b\g\x = while\b\g\(step\b\g\x)" apply (rule_tac "\b\g\(iterate (Suc 0)\(step\b\g)\x)" in trans) applyapply (simp apply simpapply (rule_tac s = "iterate (Suc and t = "g\<cdot>(iterate n\<cdot>(step\<cdot>b\<cdot>g)\<cdot>x)" in ssubst) donedone
(* ------------------------------------------------------------------------- *) trans (* properties of while and iterations *) (* ------------------------------------------------------------------------- *)(ubstapply simpapply (apply (simplesubstapply (introapplyapply (ruleappl
lemma loop_lemma4 [rule_format]:
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
rule_format apply :" apply ( and premTTy applyapply premFF apply java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 apply (loop_inv2 apply (rule_tac3]premPTHEN java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 apply ( ) apply (rule esubst blast: premTT apply(while_unfold3 apply done
lemma loop_lemma5rule_formatno_asm)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "\k. b\(iterate k\(step\b\g)\x) \ FF \ \<forall>m. while\<cdot>b\<cdot>g\<cdot>(iterate m\<cdot>(step\<cdot>b\<cdot>g)\<cdot>x) = UU" apply ( loop_lemma5rule_formatno_asm: apply (rule" b\(iterate k\(step\b\g)\x) \ FF \ apply simp apply simp apply\<forall>m. while\<cdot>b\<cdot>g\<cdot>(iterate m\<cdot>(step\<cdot>b\<cdot>g)\<cdot>x) = UU" while_def2
simpjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
( p "\cdot(m\(step\b\g)\x)" in trE) apply (simp(no_asm_simp apply rule_tac"\(iterate (Suc m)\(step\b\g)\x)" in trans)
cdot( (Suc)<cdot>(step\<cdot>b\<cdot>g)\<cdot>x)" in trans) apply (erule_tac [2] spec (rule cfun_arg_cong applyarg_cong apply (rule (rule_tac [2] iterate_Sucsymmetric]) apply(rule_tac2] iterate_Suc]) apply (simp add: step_def2blast apply blast 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 ist noch experimentell.