# HG changeset patch # User paulson # Date 855574314 -3600 # Node ID b301958c465d6e10aac34753d0206dc987e21c67 # Parent be48eff459e97512fe6ede1fe4a9acab876f16f7 Renamed structure Int (intuitionistic prover) to IntPr to prevent clash with Basis Library structure Int diff -r be48eff459e9 -r b301958c465d src/FOL/ex/If.ML --- a/src/FOL/ex/If.ML Fri Feb 07 17:15:30 1997 +0100 +++ b/src/FOL/ex/If.ML Mon Feb 10 12:31:54 1997 +0100 @@ -7,7 +7,7 @@ *) open If; -open Cla; (*in case structure Int is open!*) +open Cla; (*in case structure IntPr is open!*) val prems = goalw If.thy [if_def] "[| P ==> Q; ~P ==> R |] ==> if(P,Q,R)"; diff -r be48eff459e9 -r b301958c465d src/FOL/ex/ROOT.ML --- a/src/FOL/ex/ROOT.ML Fri Feb 07 17:15:30 1997 +0100 +++ b/src/FOL/ex/ROOT.ML Mon Feb 10 12:31:54 1997 +0100 @@ -20,7 +20,7 @@ writeln"\n** Intuitionistic examples **\n"; time_use "int.ML"; -val thy = IFOL.thy and tac = Int.fast_tac 1; +val thy = IFOL.thy and tac = IntPr.fast_tac 1; time_use "prop.ML"; time_use "quant.ML"; diff -r be48eff459e9 -r b301958c465d src/FOL/ex/cla.ML --- a/src/FOL/ex/cla.ML Fri Feb 07 17:15:30 1997 +0100 +++ b/src/FOL/ex/cla.ML Mon Feb 10 12:31:54 1997 +0100 @@ -8,7 +8,7 @@ writeln"File FOL/ex/cla.ML"; -open Cla; (*in case structure Int is open!*) +open Cla; (*in case structure IntPr is open!*) goal FOL.thy "(P --> Q | R) --> (P-->Q) | (P-->R)"; by (Fast_tac 1); diff -r be48eff459e9 -r b301958c465d src/FOL/ex/int.ML --- a/src/FOL/ex/int.ML Fri Feb 07 17:15:30 1997 +0100 +++ b/src/FOL/ex/int.ML Mon Feb 10 12:31:54 1997 +0100 @@ -6,13 +6,13 @@ Intuitionistic First-Order Logic Single-step commands: -by (Int.step_tac 1); +by (IntPr.step_tac 1); by (biresolve_tac safe_brls 1); by (biresolve_tac haz_brls 1); by (assume_tac 1); -by (Int.safe_tac 1); -by (Int.mp_tac 1); -by (Int.fast_tac 1); +by (IntPr.safe_tac 1); +by (IntPr.mp_tac 1); +by (IntPr.fast_tac 1); *) writeln"File FOL/ex/int."; @@ -30,40 +30,40 @@ intuitionstically equivalent to P. [Andy Pitts] *) goal IFOL.thy "~~(P&Q) <-> ~~P & ~~Q"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (* ~~ does NOT distribute over | *) goal IFOL.thy "~~(P-->Q) <-> (~~P --> ~~Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "~~~P <-> ~P"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "~~((P --> Q | R) --> (P-->Q) | (P-->R))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "(P<->Q) <-> (Q<->P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Lemmas for the propositional double-negation translation"; goal IFOL.thy "P --> ~~P"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "~~(~~P --> P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "~~P & ~~(P --> Q) --> ~~Q"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); @@ -71,12 +71,12 @@ (*The attempt to prove them terminates quickly!*) goal IFOL.thy "((P-->Q) --> P) --> P"; -by (Int.fast_tac 1) handle ERROR => writeln"Failed, as expected"; +by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected"; (*Check that subgoals remain: proof failed.*) getgoal 1; goal IFOL.thy "(P&Q-->R) --> (P-->R) | (Q-->R)"; -by (Int.fast_tac 1) handle ERROR => writeln"Failed, as expected"; +by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected"; getgoal 1; @@ -84,105 +84,105 @@ writeln"Problem ~~1"; goal IFOL.thy "~~((P-->Q) <-> (~Q --> ~P))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*5 secs*) writeln"Problem ~~2"; goal IFOL.thy "~~(~~P <-> P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*1 secs*) writeln"Problem 3"; goal IFOL.thy "~(P-->Q) --> (Q-->P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~4"; goal IFOL.thy "~~((~P-->Q) <-> (~Q --> P))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*9 secs*) writeln"Problem ~~5"; goal IFOL.thy "~~((P|Q-->P|R) --> P|(Q-->R))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*10 secs*) writeln"Problem ~~6"; goal IFOL.thy "~~(P | ~P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~7"; goal IFOL.thy "~~(P | ~~~P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~8. Peirce's law"; goal IFOL.thy "~~(((P-->Q) --> P) --> P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 9"; goal IFOL.thy "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*9 secs*) writeln"Problem 10"; goal IFOL.thy "(Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P<->Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"11. Proved in each direction (incorrectly, says Pelletier!!) "; goal IFOL.thy "P<->P"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); writeln"Problem ~~12. Dijkstra's law "; goal IFOL.thy "~~(((P <-> Q) <-> R) <-> (P <-> (Q <-> R)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "((P <-> Q) <-> R) --> ~~(P <-> (Q <-> R))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 13. Distributive law"; goal IFOL.thy "P | (Q & R) <-> (P | Q) & (P | R)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~14"; goal IFOL.thy "~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~15"; goal IFOL.thy "~~((P --> Q) <-> (~P | Q))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~16"; goal IFOL.thy "~~((P-->Q) | (Q-->P))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~17"; goal IFOL.thy "~~(((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*Dijkstra's "Golden Rule"*) goal IFOL.thy "(P&Q) <-> P <-> Q <-> (P|Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); @@ -192,23 +192,23 @@ writeln"The converse is classical in the following implications..."; goal IFOL.thy "(EX x.P(x)-->Q) --> (ALL x.P(x)) --> Q"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "((ALL x.P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "((ALL x. ~P(x))-->Q) --> ~ (ALL x. ~ (P(x)|Q))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "(ALL x.P(x)) | Q --> (ALL x. P(x) | Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOL.thy "(EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); @@ -218,24 +218,24 @@ (*The attempt to prove them terminates quickly!*) goal IFOL.thy "((ALL x.P(x))-->Q) --> (EX x.P(x)-->Q)"; -by (Int.fast_tac 1) handle ERROR => writeln"Failed, as expected"; +by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected"; getgoal 1; goal IFOL.thy "(P --> (EX x.Q(x))) --> (EX x. P-->Q(x))"; -by (Int.fast_tac 1) handle ERROR => writeln"Failed, as expected"; +by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected"; getgoal 1; goal IFOL.thy "(ALL x. P(x) | Q) --> ((ALL x.P(x)) | Q)"; -by (Int.fast_tac 1) handle ERROR => writeln"Failed, as expected"; +by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected"; getgoal 1; goal IFOL.thy "(ALL x. ~~P(x)) --> ~~(ALL x. P(x))"; -by (Int.fast_tac 1) handle ERROR => writeln"Failed, as expected"; +by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected"; getgoal 1; (*Classically but not intuitionistically valid. Proved by a bug in 1986!*) goal IFOL.thy "EX x. Q(x) --> (ALL x. Q(x))"; -by (Int.fast_tac 1) handle ERROR => writeln"Failed, as expected"; +by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected"; getgoal 1; @@ -255,7 +255,7 @@ writeln"Problem 20"; goal IFOL.thy "(ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w))) \ \ --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 21"; @@ -264,12 +264,12 @@ writeln"Problem 22"; goal IFOL.thy "(ALL x. P <-> Q(x)) --> (P <-> (ALL x. Q(x)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~23"; goal IFOL.thy "~~ ((ALL x. P | Q(x)) <-> (P | (ALL x. Q(x))))"; -by (Int.best_tac 1); +by (IntPr.best_tac 1); result(); writeln"Problem 24"; @@ -277,10 +277,10 @@ \ (~(EX x.P(x)) --> (EX x.Q(x))) & (ALL x. Q(x)|R(x) --> S(x)) \ \ --> ~~(EX x. P(x)&R(x))"; (*Not clear why fast_tac, best_tac, ASTAR and ITER_DEEPEN all take forever*) -by Int.safe_tac; +by IntPr.safe_tac; by (etac impE 1); -by (Int.fast_tac 1); -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 25"; @@ -289,7 +289,7 @@ \ (ALL x. P(x) --> (M(x) & L(x))) & \ \ ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x))) \ \ --> (EX x. Q(x)&P(x))"; -by (Int.best_tac 1); +by (IntPr.best_tac 1); result(); writeln"Problem ~~26"; @@ -304,7 +304,7 @@ \ (ALL x. M(x) & L(x) --> P(x)) & \ \ ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x))) \ \ --> (ALL x. M(x) --> ~L(x))"; -by (Int.fast_tac 1); (*21 secs*) +by (IntPr.fast_tac 1); (*21 secs*) result(); writeln"Problem ~~28. AMENDED"; @@ -312,21 +312,21 @@ \ (~~(ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) & \ \ (~~(EX x.S(x)) --> (ALL x. L(x) --> M(x))) \ \ --> (ALL x. P(x) & L(x) --> M(x))"; -by (Int.fast_tac 1); (*48 secs*) +by (IntPr.fast_tac 1); (*48 secs*) result(); writeln"Problem 29. Essentially the same as Principia Mathematica *11.71"; goal IFOL.thy "(EX x. P(x)) & (EX y. Q(y)) \ \ --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y)) <-> \ \ (ALL x y. P(x) & Q(y) --> R(x) & S(y)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~30"; goal IFOL.thy "(ALL x. (P(x) | Q(x)) --> ~ R(x)) & \ \ (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x)) \ \ --> (ALL x. ~~S(x))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 31"; @@ -334,7 +334,7 @@ \ (EX x. L(x) & P(x)) & \ \ (ALL x. ~ R(x) --> M(x)) \ \ --> (EX x. L(x) & M(x))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 32"; @@ -342,13 +342,13 @@ \ (ALL x. S(x) & R(x) --> L(x)) & \ \ (ALL x. M(x) --> R(x)) \ \ --> (ALL x. P(x) & M(x) --> L(x))"; -by (Int.best_tac 1); +by (IntPr.best_tac 1); result(); writeln"Problem ~~33"; goal IFOL.thy "(ALL x. ~~(P(a) & (P(x)-->P(b))-->P(c))) <-> \ \ (ALL x. ~~((~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c))))"; -by (Int.best_tac 1); +by (IntPr.best_tac 1); result(); @@ -358,7 +358,7 @@ \ (ALL x. EX y. G(x,y)) & \ \ (ALL x y. J(x,y) | G(x,y) --> (ALL z. J(y,z) | G(y,z) --> H(x,z))) \ \ --> (ALL x. EX y. H(x,y))"; -by (Int.fast_tac 1); (*35 secs*) +by (IntPr.fast_tac 1); (*35 secs*) result(); writeln"Problem 37"; @@ -372,13 +372,13 @@ writeln"Problem 39"; goal IFOL.thy "~ (EX x. ALL y. F(y,x) <-> ~F(y,y))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 40. AMENDED"; goal IFOL.thy "(EX y. ALL x. F(x,y) <-> F(x,x)) --> \ \ ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 44"; @@ -386,19 +386,19 @@ \ (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y)))) & \ \ (EX x. j(x) & (ALL y. g(y) --> h(x,y))) \ \ --> (EX x. j(x) & ~f(x))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 48"; goal IFOL.thy "(a=b | c=d) & (a=c | b=d) --> a=d | b=c"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 51"; goal IFOL.thy "(EX z w. ALL x y. P(x,y) <-> (x=z & y=w)) --> \ \ (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)"; -by (Int.best_tac 1); (*34 seconds*) +by (IntPr.best_tac 1); (*34 seconds*) result(); writeln"Problem 52"; @@ -406,26 +406,26 @@ goal IFOL.thy "(EX z w. ALL x y. P(x,y) <-> (x=z & y=w)) --> \ \ (EX w. ALL y. EX z. (ALL x. P(x,y) <-> x=z) <-> y=w)"; -by (Int.best_tac 1); (*34 seconds*) +by (IntPr.best_tac 1); (*34 seconds*) result(); writeln"Problem 56"; goal IFOL.thy "(ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 57"; goal IFOL.thy "P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) & \ \ (ALL x y z. P(x,y) & P(y,z) --> P(x,z)) --> P(f(a,b), f(a,c))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 60"; goal IFOL.thy "ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Reached end of file."; diff -r be48eff459e9 -r b301958c465d src/FOL/intprover.ML --- a/src/FOL/intprover.ML Fri Feb 07 17:15:30 1997 +0100 +++ b/src/FOL/intprover.ML Mon Feb 10 12:31:54 1997 +0100 @@ -5,7 +5,7 @@ A naive prover for intuitionistic logic -BEWARE OF NAME CLASHES WITH CLASSICAL TACTICS -- use Int.fast_tac ... +BEWARE OF NAME CLASHES WITH CLASSICAL TACTICS -- use IntPr.fast_tac ... Completeness (for propositional logic) is proved in @@ -29,7 +29,7 @@ end; -structure Int : INT_PROVER = +structure IntPr : INT_PROVER = struct (*Negation is treated as a primitive symbol, with rules notI (introduction), diff -r be48eff459e9 -r b301958c465d src/FOL/simpdata.ML --- a/src/FOL/simpdata.ML Fri Feb 07 17:15:30 1997 +0100 +++ b/src/FOL/simpdata.ML Mon Feb 10 12:31:54 1997 +0100 @@ -12,7 +12,7 @@ (writeln s; prove_goal IFOL.thy s (fn prems => [ (cut_facts_tac prems 1), - (Int.fast_tac 1) ])); + (IntPr.fast_tac 1) ])); val conj_simps = map int_prove_fun ["P & True <-> P", "True & P <-> P", @@ -123,7 +123,7 @@ fun int_prove nm thm = qed_goal nm IFOL.thy thm (fn prems => [ (cut_facts_tac prems 1), - (Int.fast_tac 1) ]); + (IntPr.fast_tac 1) ]); fun prove nm thm = qed_goal nm FOL.thy thm (fn _ => [fast_tac FOL_cs 1]);