# HG changeset patch # User paulson # Date 855575531 -3600 # Node ID 4988dda71c0b4c566d2c006200345f93425dde5c # Parent 5ac837d98a8512ebd68d32a4cd6d92053cae8b68 Renamed structure Int (intuitionistic prover) to IntPr to prevent clash with Basis Library structure Int diff -r 5ac837d98a85 -r 4988dda71c0b src/FOLP/ex/ROOT.ML --- a/src/FOLP/ex/ROOT.ML Mon Feb 10 12:34:54 1997 +0100 +++ b/src/FOLP/ex/ROOT.ML Mon Feb 10 12:52:11 1997 +0100 @@ -19,7 +19,7 @@ writeln"\n** Intuitionistic examples **\n"; time_use "int.ML"; -val thy = IFOLP.thy and tac = Int.fast_tac 1; +val thy = IFOLP.thy and tac = IntPr.fast_tac 1; time_use "prop.ML"; time_use "quant.ML"; diff -r 5ac837d98a85 -r 4988dda71c0b src/FOLP/ex/int.ML --- a/src/FOLP/ex/int.ML Mon Feb 10 12:34:54 1997 +0100 +++ b/src/FOLP/ex/int.ML Mon Feb 10 12:52:11 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 FOLP/ex/int.ML"; @@ -30,34 +30,34 @@ *) goal IFOLP.thy "?p : ~~(P&Q) <-> ~~P & ~~Q"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : ~~~P <-> ~P"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : ~~((P --> Q | R) --> (P-->Q) | (P-->R))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : (P<->Q) <-> (Q<->P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Lemmas for the propositional double-negation translation"; goal IFOLP.thy "?p : P --> ~~P"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : ~~(~~P --> P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : ~~P & ~~(P --> Q) --> ~~Q"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); @@ -65,12 +65,12 @@ (*The attempt to prove them terminates quickly!*) goal IFOLP.thy "?p : ((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 IFOLP.thy "?p : (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; @@ -78,100 +78,100 @@ writeln"Problem ~~1"; goal IFOLP.thy "?p : ~~((P-->Q) <-> (~Q --> ~P))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*5 secs*) writeln"Problem ~~2"; goal IFOLP.thy "?p : ~~(~~P <-> P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*1 secs*) writeln"Problem 3"; goal IFOLP.thy "?p : ~(P-->Q) --> (Q-->P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~4"; goal IFOLP.thy "?p : ~~((~P-->Q) <-> (~Q --> P))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*9 secs*) writeln"Problem ~~5"; goal IFOLP.thy "?p : ~~((P|Q-->P|R) --> P|(Q-->R))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); (*10 secs*) writeln"Problem ~~6"; goal IFOLP.thy "?p : ~~(P | ~P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~7"; goal IFOLP.thy "?p : ~~(P | ~~~P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~8. Peirce's law"; goal IFOLP.thy "?p : ~~(((P-->Q) --> P) --> P)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 9"; goal IFOLP.thy "?p : ((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 IFOLP.thy "?p : (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 IFOLP.thy "?p : P<->P"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); writeln"Problem ~~12. Dijkstra's law "; goal IFOLP.thy "?p : ~~(((P <-> Q) <-> R) <-> (P <-> (Q <-> R)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : ((P <-> Q) <-> R) --> ~~(P <-> (Q <-> R))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem 13. Distributive law"; goal IFOLP.thy "?p : P | (Q & R) <-> (P | Q) & (P | R)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~14"; goal IFOLP.thy "?p : ~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~15"; goal IFOLP.thy "?p : ~~((P --> Q) <-> (~P | Q))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~16"; goal IFOLP.thy "?p : ~~((P-->Q) | (Q-->P))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); writeln"Problem ~~17"; goal IFOLP.thy "?p : ~~(((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); (*over 5 minutes?? -- printing the proof term takes 40 secs!!*) result(); @@ -181,23 +181,23 @@ writeln"The converse is classical in the following implications..."; goal IFOLP.thy "?p : (EX x.P(x)-->Q) --> (ALL x.P(x)) --> Q"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : ((ALL x.P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : ((ALL x. ~P(x))-->Q) --> ~ (ALL x. ~ (P(x)|Q))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : (ALL x.P(x)) | Q --> (ALL x. P(x) | Q)"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); goal IFOLP.thy "?p : (EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))"; -by (Int.fast_tac 1); +by (IntPr.fast_tac 1); result(); @@ -207,24 +207,24 @@ (*The attempt to prove them terminates quickly!*) goal IFOLP.thy "?p : ((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 IFOLP.thy "?p : (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 IFOLP.thy "?p : (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 IFOLP.thy "?p : (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 IFOLP.thy "?p : 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; @@ -244,7 +244,7 @@ writeln"Problem 20"; goal IFOLP.thy "?p : (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"; @@ -254,12 +254,12 @@ writeln"Problem 22"; goal IFOLP.thy "?p : (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 IFOLP.thy "?p : ~~ ((ALL x. P | Q(x)) <-> (P | (ALL x. Q(x))))"; -by (Int.best_tac 1); +by (IntPr.best_tac 1); result(); writeln"Problem 24"; @@ -267,10 +267,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"; @@ -279,21 +279,21 @@ \ (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 29. Essentially the same as Principia Mathematica *11.71"; goal IFOLP.thy "?p : (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 IFOLP.thy "?p : (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"; @@ -301,7 +301,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"; @@ -309,18 +309,18 @@ \ (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); (*SLOW*) +by (IntPr.best_tac 1); (*SLOW*) result(); writeln"Problem 39"; goal IFOLP.thy "?p : ~ (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 IFOLP.thy "?p : (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"; @@ -328,38 +328,38 @@ \ (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 IFOLP.thy "?p : (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 IFOLP.thy "?p : (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); (*60 seconds*) +by (IntPr.best_tac 1); (*60 seconds*) result(); writeln"Problem 56"; goal IFOLP.thy "?p : (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 IFOLP.thy "?p : 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 IFOLP.thy "?p : 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 5ac837d98a85 -r 4988dda71c0b src/FOLP/intprover.ML --- a/src/FOLP/intprover.ML Mon Feb 10 12:34:54 1997 +0100 +++ b/src/FOLP/intprover.ML Mon Feb 10 12:52:11 1997 +0100 @@ -5,12 +5,12 @@ 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 Roy Dyckhoff. -Contraction-Free Sequent Calculi for Intuitionistic Logic. +Contraction-Free Sequent Calculi for IntPruitionistic Logic. J. Symbolic Logic (in press) *) @@ -27,7 +27,7 @@ end; -structure Int : INT_PROVER = +structure IntPr : INT_PROVER = struct (*Negation is treated as a primitive symbol, with rules notI (introduction), diff -r 5ac837d98a85 -r 4988dda71c0b src/FOLP/simpdata.ML --- a/src/FOLP/simpdata.ML Mon Feb 10 12:34:54 1997 +0100 +++ b/src/FOLP/simpdata.ML Mon Feb 10 12:52:11 1997 +0100 @@ -10,7 +10,7 @@ fun int_prove_fun_raw s = (writeln s; prove_goal IFOLP.thy s - (fn prems => [ (cut_facts_tac prems 1), (Int.fast_tac 1) ])); + (fn prems => [ (cut_facts_tac prems 1), (IntPr.fast_tac 1) ])); fun int_prove_fun s = int_prove_fun_raw ("?p : "^s);