# HG changeset patch # User nipkow # Date 1127484342 -7200 # Node ID 5f30179fbf44f3fe69ac6691d0fc563c6c2cb206 # Parent f601609d3300ce26f48b82e6bacb7c7d05a9a45b rules -> iprover diff -r f601609d3300 -r 5f30179fbf44 src/HOL/Extraction/Higman.thy --- a/src/HOL/Extraction/Higman.thy Fri Sep 23 16:05:10 2005 +0200 +++ b/src/HOL/Extraction/Higman.thy Fri Sep 23 16:05:42 2005 +0200 @@ -65,10 +65,10 @@ bar1 [Pure.intro]: "ws \ good \ ws \ bar" bar2 [Pure.intro]: "(\w. w # ws \ bar) \ ws \ bar" -theorem prop1: "([] # ws) \ bar" by rules +theorem prop1: "([] # ws) \ bar" by iprover theorem lemma1: "ws \ L as \ ws \ L (a # as)" - by (erule L.induct, rules+) + by (erule L.induct, iprover+) lemma lemma2': "(vs, ws) \ R a \ vs \ L as \ ws \ L (a # as)" apply (induct set: R) @@ -83,7 +83,7 @@ lemma lemma2: "(vs, ws) \ R a \ vs \ good \ ws \ good" apply (induct set: R) - apply rules + apply iprover apply (erule good.elims) apply simp_all apply (rule good0) @@ -102,7 +102,7 @@ apply (erule lemma1) apply (erule L.elims) apply simp_all - apply rules+ + apply iprover+ done lemma lemma3: "(ws, zs) \ T a \ ws \ good \ zs \ good" @@ -116,12 +116,12 @@ apply simp_all apply (rule good0) apply (erule lemma3') - apply rules+ + apply iprover+ done lemma lemma4: "(ws, zs) \ R a \ ws \ [] \ (ws, zs) \ T a" apply (induct set: R) - apply rules + apply iprover apply (case_tac vs) apply (erule R.elims) apply simp @@ -186,12 +186,12 @@ from letter_eq_dec show ?thesis proof assume ca: "c = a" - from ab have "(a # cs) # zs \ bar" by (rules intro: I ys Ta Tb) + from ab have "(a # cs) # zs \ bar" by (iprover intro: I ys Ta Tb) thus ?thesis by (simp add: Cons ca) next assume "c \ a" with ab have cb: "c = b" by (rule letter_neq) - from ab have "(b # cs) # zs \ bar" by (rules intro: I' Ta Tb) + from ab have "(b # cs) # zs \ bar" by (iprover intro: I' Ta Tb) thus ?thesis by (simp add: Cons cb) qed qed @@ -222,11 +222,11 @@ from letter_eq_dec show ?case proof assume "c = a" - thus ?thesis by (rules intro: I [simplified] R) + thus ?thesis by (iprover intro: I [simplified] R) next from R xsn have T: "(xs, zs) \ T a" by (rule lemma4) assume "c \ a" - thus ?thesis by (rules intro: prop2 Cons xsb xsn R T) + thus ?thesis by (iprover intro: prop2 Cons xsb xsn R T) qed qed qed @@ -240,7 +240,7 @@ show "[[]] \ bar" by (rule prop1) next fix c cs assume "[cs] \ bar" - thus "[c # cs] \ bar" by (rule prop3) (simp, rules) + thus "[c # cs] \ bar" by (rule prop3) (simp, iprover) qed qed @@ -256,11 +256,11 @@ shows "is_prefix ws f \ \vs. is_prefix vs f \ vs \ good" using bar proof induct case bar1 - thus ?case by rules + thus ?case by iprover next case (bar2 ws) have "is_prefix (f (length ws) # ws) f" by simp - thus ?case by (rules intro: bar2) + thus ?case by (iprover intro: bar2) qed theorem good_prefix: "\vs. is_prefix vs f \ vs \ good" diff -r f601609d3300 -r 5f30179fbf44 src/HOL/Extraction/Pigeonhole.thy --- a/src/HOL/Extraction/Pigeonhole.thy Fri Sep 23 16:05:10 2005 +0200 +++ b/src/HOL/Extraction/Pigeonhole.thy Fri Sep 23 16:05:42 2005 +0200 @@ -20,7 +20,7 @@ apply (induct m) apply (case_tac n) apply (case_tac [3] n) - apply (simp only: nat.simps, rules?)+ + apply (simp only: nat.simps, iprover?)+ done text {* @@ -34,7 +34,7 @@ have "\ (\j<0. x = f j)" proof assume "\j<0. x = f j" - then obtain j where j: "j < (0::nat)" by rules + then obtain j where j: "j < (0::nat)" by iprover thus "False" by simp qed thus ?case .. @@ -44,23 +44,23 @@ proof assume "\j (\j f l" have "\ (\jj l" with j have "j < l" by simp - with nex and eq show False by rules + with nex and eq show False by iprover qed qed thus ?case .. @@ -86,7 +86,7 @@ proof (induct n) case 0 hence "Suc 0 \ Suc 0 \ 0 < Suc 0 \ f (Suc 0) = f 0" by simp - thus ?case by rules + thus ?case by iprover next case (Suc n) { @@ -102,7 +102,7 @@ proof assume "\i j. i \ Suc n \ j < i \ ?f i = ?f j" then obtain i j where i: "i \ Suc n" and j: "j < i" - and f: "?f i = ?f j" by rules + and f: "?f i = ?f j" by iprover from j have i_nz: "Suc 0 \ i" by simp from i have iSSn: "i \ Suc (Suc n)" by simp have S0SSn: "Suc 0 \ Suc (Suc n)" by simp @@ -164,7 +164,7 @@ from search show ?case proof assume "\j (\ji j. i \ k \ j < i \ f i = f j" @@ -179,7 +179,7 @@ proof assume "f i = f j" hence "f (Suc k) = f j" by (simp add: eq) - with nex and j and eq show False by rules + with nex and j and eq show False by iprover qed next assume "i \ Suc k" @@ -187,7 +187,7 @@ thus ?thesis using i and j by (rule Suc) qed qed - thus ?thesis by (rules intro: le_SucI) + thus ?thesis by (iprover intro: le_SucI) qed qed } @@ -207,16 +207,16 @@ have "Suc 0 \ Suc 0" .. moreover have "0 < Suc 0" .. moreover from 0 have "f (Suc 0) = f 0" by simp - ultimately show ?case by rules + ultimately show ?case by iprover next case (Suc n) from search show ?case proof assume "\j < Suc (Suc n). f (Suc (Suc n)) = f j" - thus ?case by (rules intro: le_refl) + thus ?case by (iprover intro: le_refl) next assume "\ (\j < Suc (Suc n). f (Suc (Suc n)) = f j)" - hence nex: "\j < Suc (Suc n). f (Suc (Suc n)) \ f j" by rules + hence nex: "\j < Suc (Suc n). f (Suc (Suc n)) \ f j" by iprover let ?f = "\i. if f i = Suc n then f (Suc (Suc n)) else f i" have "\i. i \ Suc n \ ?f i \ n" proof - @@ -237,7 +237,7 @@ qed hence "\i j. i \ Suc n \ j < i \ ?f i = ?f j" by (rule Suc) then obtain i j where i: "i \ Suc n" and ji: "j < i" and f: "?f i = ?f j" - by rules + by iprover have "f i = f j" proof (cases "f i = Suc n") case True @@ -263,7 +263,7 @@ qed qed moreover from i have "i \ Suc (Suc n)" by simp - ultimately show ?thesis using ji by rules + ultimately show ?thesis using ji by iprover qed qed diff -r f601609d3300 -r 5f30179fbf44 src/HOL/Extraction/QuotRem.thy --- a/src/HOL/Extraction/QuotRem.thy Fri Sep 23 16:05:10 2005 +0200 +++ b/src/HOL/Extraction/QuotRem.thy Fri Sep 23 16:05:42 2005 +0200 @@ -12,27 +12,27 @@ apply (induct m) apply (case_tac n) apply (case_tac [3] n) - apply (simp only: nat.simps, rules?)+ + apply (simp only: nat.simps, iprover?)+ done theorem division: "\r q. a = Suc b * q + r \ r \ b" proof (induct a) case 0 have "0 = Suc b * 0 + 0 \ 0 \ b" by simp - thus ?case by rules + thus ?case by iprover next case (Suc a) - then obtain r q where I: "a = Suc b * q + r" and "r \ b" by rules + then obtain r q where I: "a = Suc b * q + r" and "r \ b" by iprover from nat_eq_dec show ?case proof assume "r = b" with I have "Suc a = Suc b * (Suc q) + 0 \ 0 \ b" by simp - thus ?case by rules + thus ?case by iprover next assume "r \ b" hence "r < b" by (simp add: order_less_le) with I have "Suc a = Suc b * q + (Suc r) \ (Suc r) \ b" by simp - thus ?case by rules + thus ?case by iprover qed qed diff -r f601609d3300 -r 5f30179fbf44 src/HOL/Extraction/Warshall.thy --- a/src/HOL/Extraction/Warshall.thy Fri Sep 23 16:05:10 2005 +0200 +++ b/src/HOL/Extraction/Warshall.thy Fri Sep 23 16:05:42 2005 +0200 @@ -38,7 +38,7 @@ by (induct ys) simp+ theorem list_all_scoc [simp]: "list_all P (xs @ [x]) = (P x \ list_all P xs)" - by (induct xs, simp+, rules) + by (induct xs, simp+, iprover) theorem list_all_lemma: "list_all P xs \ (\x. P x \ Q x) \ list_all Q xs" @@ -188,7 +188,7 @@ theorem lemma5': "\p. is_path r p (Suc i) j k \ \ is_path r p i j k \ \ (\q. \ is_path r q i j i) \ \ (\q'. \ is_path r q' i i k)" - by (rules dest: lemma5) + by (iprover dest: lemma5) theorem warshall: "\j k. \ (\p. is_path r p i j k) \ (\p. is_path r p i j k)" @@ -205,7 +205,7 @@ assume "r j k = F" hence "r j k ~= T" by simp hence "\ (\p. is_path r p 0 j k)" - by (rules dest: lemma2) + by (iprover dest: lemma2) thus ?thesis .. qed next @@ -217,7 +217,7 @@ proof assume "\ (\p. is_path r p i j i)" with h1 have "\ (\p. is_path r p (Suc i) j k)" - by (rules dest: lemma5') + by (iprover dest: lemma5') thus ?case .. next assume "\p. is_path r p i j i" @@ -226,7 +226,7 @@ proof assume "\ (\p. is_path r p i i k)" with h1 have "\ (\p. is_path r p (Suc i) j k)" - by (rules dest: lemma5') + by (iprover dest: lemma5') thus ?case .. next assume "\q. is_path r q i i k" @@ -240,7 +240,7 @@ next assume "\p. is_path r p i j k" hence "\p. is_path r p (Suc i) j k" - by (rules intro: lemma1) + by (iprover intro: lemma1) thus ?case .. qed qed