A little quantifier duplication for IFOL
authorpaulson
Mon, 27 Jul 1998 17:38:55 +0200
changeset 5203 eb5a1511a07d
parent 5202 084ceb3844f5
child 5204 858da18069d7
A little quantifier duplication for IFOL
src/FOL/ex/int.ML
src/FOL/intprover.ML
--- a/src/FOL/ex/int.ML	Mon Jul 27 16:04:20 1998 +0200
+++ b/src/FOL/ex/int.ML	Mon Jul 27 17:38:55 1998 +0200
@@ -15,6 +15,8 @@
 by (IntPr.fast_tac 1);
 *)
 
+context IFOL.thy;
+
 writeln"File FOL/ex/int.";
 
 (*Metatheorem (for PROPOSITIONAL formulae...):
@@ -29,40 +31,40 @@
 ~~Q is intuitionistically provable.  Finally, if P is a negation then ~~P is
 intuitionstically equivalent to P.  [Andy Pitts] *)
 
-goal IFOL.thy "~~(P&Q) <-> ~~P & ~~Q";
+Goal "~~(P&Q) <-> ~~P & ~~Q";
 by (IntPr.fast_tac 1);
 result();
 
 (* ~~ does NOT distribute over | *)
 
-goal IFOL.thy "~~(P-->Q)  <-> (~~P --> ~~Q)";
+Goal "~~(P-->Q)  <-> (~~P --> ~~Q)";
 by (IntPr.fast_tac 1);
 result();
 
-goal IFOL.thy "~~~P <-> ~P";
+Goal "~~~P <-> ~P";
 by (IntPr.fast_tac 1);
 result();
 
-goal IFOL.thy "~~((P --> Q | R)  -->  (P-->Q) | (P-->R))";
+Goal "~~((P --> Q | R)  -->  (P-->Q) | (P-->R))";
 by (IntPr.fast_tac 1);
 result();
 
-goal IFOL.thy "(P<->Q) <-> (Q<->P)";
+Goal "(P<->Q) <-> (Q<->P)";
 by (IntPr.fast_tac 1);
 result();
 
 
 writeln"Lemmas for the propositional double-negation translation";
 
-goal IFOL.thy "P --> ~~P";
+Goal "P --> ~~P";
 by (IntPr.fast_tac 1);
 result();
 
-goal IFOL.thy "~~(~~P --> P)";
+Goal "~~(~~P --> P)";
 by (IntPr.fast_tac 1);
 result();
 
-goal IFOL.thy "~~P & ~~(P --> Q) --> ~~Q";
+Goal "~~P & ~~(P --> Q) --> ~~Q";
 by (IntPr.fast_tac 1);
 result();
 
@@ -70,12 +72,12 @@
 writeln"The following are classically but not constructively valid.";
 
 (*The attempt to prove them terminates quickly!*)
-goal IFOL.thy "((P-->Q) --> P)  -->  P";
+Goal "((P-->Q) --> P)  -->  P";
 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)";
+Goal "(P&Q-->R)  -->  (P-->R) | (Q-->R)";
 by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected";  
 getgoal 1;  
 
@@ -83,7 +85,7 @@
 writeln"de Bruijn formulae";
 
 (*de Bruijn formula with three predicates*)
-goal IFOL.thy "((P<->Q) --> P&Q&R) &    \
+Goal "((P<->Q) --> P&Q&R) &    \
 \              ((Q<->R) --> P&Q&R) &    \
 \              ((R<->P) --> P&Q&R) --> P&Q&R";
 by (IntPr.fast_tac 1);
@@ -91,7 +93,7 @@
 
 
 (*de Bruijn formula with five predicates*)
-goal IFOL.thy "((P<->Q) --> P&Q&R&S&T) &    \
+Goal "((P<->Q) --> P&Q&R&S&T) &    \
 \              ((Q<->R) --> P&Q&R&S&T) &    \
 \              ((R<->S) --> P&Q&R&S&T) &    \
 \              ((S<->T) --> P&Q&R&S&T) &    \
@@ -100,108 +102,128 @@
 result();
 
 
+(*** Problems from of Sahlin, Franzen and Haridi, 
+     An Intuitionistic Predicate Logic Theorem Prover
+***)
+
+(*Problem 1.1*)
+Goal "(ALL x. EX y. ALL z. p(x) & q(y) & r(z)) <->  \
+\     (ALL z. EX y. ALL x. p(x) & q(y) & r(z))";
+(*
+by (IntPr.best_dup_tac 1);   (*2 minutes!  Is it worth it?*)
+*)
+
+(*Problem 3.1*)
+Goal "~ (EX x. ALL y. mem(y,x) <-> ~ mem(x,x))";
+by (IntPr.fast_tac 1);
+result();
+
+(*Problem 4.1: hopeless!*)
+Goal "(ALL x. p(x) --> p(h(x)) | p(g(x))) & (EX x. p(x)) & (ALL x. ~p(h(x))) \
+\     --> (EX x. p(g(g(g(g(g(x)))))))";
+
+
 writeln"Intuitionistic FOL: propositional problems based on Pelletier.";
 
 writeln"Problem ~~1";
-goal IFOL.thy "~~((P-->Q)  <->  (~Q --> ~P))";
+Goal "~~((P-->Q)  <->  (~Q --> ~P))";
 by (IntPr.fast_tac 1);
 result();
-(*5 secs*)
 
 
 writeln"Problem ~~2";
-goal IFOL.thy "~~(~~P  <->  P)";
+Goal "~~(~~P  <->  P)";
 by (IntPr.fast_tac 1);
 result();
 (*1 secs*)
 
 
 writeln"Problem 3";
-goal IFOL.thy "~(P-->Q) --> (Q-->P)";
+Goal "~(P-->Q) --> (Q-->P)";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem ~~4";
-goal IFOL.thy "~~((~P-->Q)  <->  (~Q --> P))";
+Goal "~~((~P-->Q)  <->  (~Q --> P))";
 by (IntPr.fast_tac 1);
 result();
 (*9 secs*)
 
 writeln"Problem ~~5";
-goal IFOL.thy "~~((P|Q-->P|R) --> P|(Q-->R))";
+Goal "~~((P|Q-->P|R) --> P|(Q-->R))";
 by (IntPr.fast_tac 1);
 result();
 (*10 secs*)
 
 
 writeln"Problem ~~6";
-goal IFOL.thy "~~(P | ~P)";
+Goal "~~(P | ~P)";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem ~~7";
-goal IFOL.thy "~~(P | ~~~P)";
+Goal "~~(P | ~~~P)";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem ~~8.  Peirce's law";
-goal IFOL.thy "~~(((P-->Q) --> P)  -->  P)";
+Goal "~~(((P-->Q) --> P)  -->  P)";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem 9";
-goal IFOL.thy "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)";
+Goal "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)";
 by (IntPr.fast_tac 1);
 result();
 (*9 secs*)
 
 
 writeln"Problem 10";
-goal IFOL.thy "(Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P<->Q)";
+Goal "(Q-->R) --> (R-->P&Q) --> (P-->(Q|R)) --> (P<->Q)";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"11.  Proved in each direction (incorrectly, says Pelletier!!) ";
-goal IFOL.thy "P<->P";
+Goal "P<->P";
 by (IntPr.fast_tac 1);
 
 writeln"Problem ~~12.  Dijkstra's law  ";
-goal IFOL.thy "~~(((P <-> Q) <-> R)  <->  (P <-> (Q <-> R)))";
+Goal "~~(((P <-> Q) <-> R)  <->  (P <-> (Q <-> R)))";
 by (IntPr.fast_tac 1);
 result();
 
-goal IFOL.thy "((P <-> Q) <-> R)  -->  ~~(P <-> (Q <-> R))";
+Goal "((P <-> Q) <-> R)  -->  ~~(P <-> (Q <-> R))";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem 13.  Distributive law";
-goal IFOL.thy "P | (Q & R)  <-> (P | Q) & (P | R)";
+Goal "P | (Q & R)  <-> (P | Q) & (P | R)";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem ~~14";
-goal IFOL.thy "~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))";
+Goal "~~((P <-> Q) <-> ((Q | ~P) & (~Q|P)))";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem ~~15";
-goal IFOL.thy "~~((P --> Q) <-> (~P | Q))";
+Goal "~~((P --> Q) <-> (~P | Q))";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem ~~16";
-goal IFOL.thy "~~((P-->Q) | (Q-->P))";
+Goal "~~((P-->Q) | (Q-->P))";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem ~~17";
-goal IFOL.thy
+Goal
   "~~(((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S)))";
 by (IntPr.fast_tac 1);    
 result();
 
 (*Dijkstra's "Golden Rule"*)
-goal IFOL.thy "(P&Q) <-> P <-> Q <-> (P|Q)";
+Goal "(P&Q) <-> P <-> Q <-> (P|Q)";
 by (IntPr.fast_tac 1);
 result();
 
@@ -211,23 +233,23 @@
 
 writeln"The converse is classical in the following implications...";
 
-goal IFOL.thy "(EX x. P(x)-->Q)  -->  (ALL x. P(x)) --> Q";
+Goal "(EX x. P(x)-->Q)  -->  (ALL x. P(x)) --> Q";
 by (IntPr.fast_tac 1); 
 result();  
 
-goal IFOL.thy "((ALL x. P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)";
+Goal "((ALL x. P(x))-->Q) --> ~ (ALL x. P(x) & ~Q)";
 by (IntPr.fast_tac 1); 
 result();  
 
-goal IFOL.thy "((ALL x. ~P(x))-->Q)  -->  ~ (ALL x. ~ (P(x)|Q))";
+Goal "((ALL x. ~P(x))-->Q)  -->  ~ (ALL x. ~ (P(x)|Q))";
 by (IntPr.fast_tac 1); 
 result();  
 
-goal IFOL.thy "(ALL x. P(x)) | Q  -->  (ALL x. P(x) | Q)";
+Goal "(ALL x. P(x)) | Q  -->  (ALL x. P(x) | Q)";
 by (IntPr.fast_tac 1); 
 result();  
 
-goal IFOL.thy "(EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))";
+Goal "(EX x. P --> Q(x)) --> (P --> (EX x. Q(x)))";
 by (IntPr.fast_tac 1);
 result();  
 
@@ -237,24 +259,24 @@
 writeln"The following are not constructively valid!";
 (*The attempt to prove them terminates quickly!*)
 
-goal IFOL.thy "((ALL x. P(x))-->Q) --> (EX x. P(x)-->Q)";
+Goal "((ALL x. P(x))-->Q) --> (EX x. P(x)-->Q)";
 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))";
+Goal "(P --> (EX x. Q(x))) --> (EX x. P-->Q(x))";
 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)";
+Goal "(ALL x. P(x) | Q) --> ((ALL x. P(x)) | Q)";
 by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected";  
 getgoal 1; 
 
-goal IFOL.thy "(ALL x. ~~P(x)) --> ~~(ALL x. P(x))";
+Goal "(ALL x. ~~P(x)) --> ~~(ALL x. P(x))";
 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))";
+Goal "EX x. Q(x) --> (ALL x. Q(x))";
 by (IntPr.fast_tac 1) handle ERROR => writeln"Failed, as expected";  
 getgoal 1; 
 
@@ -265,35 +287,35 @@
   Some will require quantifier duplication -- not currently available*)
 
 writeln"Problem ~~18";
-goal IFOL.thy "~~(EX y. ALL x. P(y)-->P(x))";
+Goal "~~(EX y. ALL x. P(y)-->P(x))";
 (*NOT PROVED*)
 
 writeln"Problem ~~19";
-goal IFOL.thy "~~(EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x)))";
+Goal "~~(EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x)))";
 (*NOT PROVED*)
 
 writeln"Problem 20";
-goal IFOL.thy "(ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))     \
+Goal "(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 (IntPr.fast_tac 1); 
 result();
 
 writeln"Problem 21";
-goal IFOL.thy "(EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> ~~(EX x. P<->Q(x))";
+Goal "(EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> ~~(EX x. P<->Q(x))";
 (*NOT PROVED; needs quantifier duplication*)
 
 writeln"Problem 22";
-goal IFOL.thy "(ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))";
+Goal "(ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))";
 by (IntPr.fast_tac 1); 
 result();
 
 writeln"Problem ~~23";
-goal IFOL.thy "~~ ((ALL x. P | Q(x))  <->  (P | (ALL x. Q(x))))";
-by (IntPr.best_tac 1);  
+Goal "~~ ((ALL x. P | Q(x))  <->  (P | (ALL x. Q(x))))";
+by (IntPr.fast_tac 1); 
 result();
 
 writeln"Problem 24";
-goal IFOL.thy "~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &  \
+Goal "~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &  \
 \    (~(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*)
@@ -304,22 +326,22 @@
 result();
 
 writeln"Problem 25";
-goal IFOL.thy "(EX x. P(x)) &  \
+Goal "(EX x. P(x)) &  \
 \       (ALL x. L(x) --> ~ (M(x) & R(x))) &  \
 \       (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 (IntPr.best_tac 1); 
+by (IntPr.fast_tac 1); 
 result();
 
 writeln"Problem ~~26";
-goal IFOL.thy "(~~(EX x. p(x)) <-> ~~(EX x. q(x))) &    \
+Goal "(~~(EX x. p(x)) <-> ~~(EX x. q(x))) &    \
 \     (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))   \
 \ --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))";
 (*NOT PROVED*)
 
 writeln"Problem 27";
-goal IFOL.thy "(EX x. P(x) & ~Q(x)) &   \
+Goal "(EX x. P(x) & ~Q(x)) &   \
 \             (ALL x. P(x) --> R(x)) &   \
 \             (ALL x. M(x) & L(x) --> P(x)) &   \
 \             ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))  \
@@ -328,7 +350,7 @@
 result();
 
 writeln"Problem ~~28.  AMENDED";
-goal IFOL.thy "(ALL x. P(x) --> (ALL x. Q(x))) &   \
+Goal "(ALL x. P(x) --> (ALL x. Q(x))) &   \
 \       (~~(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))";
@@ -336,21 +358,21 @@
 result();
 
 writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
-goal IFOL.thy "(EX x. P(x)) & (EX y. Q(y))  \
+Goal "(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 (IntPr.fast_tac 1); 
 result();
 
 writeln"Problem ~~30";
-goal IFOL.thy "(ALL x. (P(x) | Q(x)) --> ~ R(x)) & \
+Goal "(ALL x. (P(x) | Q(x)) --> ~ R(x)) & \
 \       (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
 \   --> (ALL x. ~~S(x))";
 by (IntPr.fast_tac 1);  
 result();
 
 writeln"Problem 31";
-goal IFOL.thy "~(EX x. P(x) & (Q(x) | R(x))) & \
+Goal "~(EX x. P(x) & (Q(x) | R(x))) & \
 \       (EX x. L(x) & P(x)) & \
 \       (ALL x. ~ R(x) --> M(x))  \
 \   --> (EX x. L(x) & M(x))";
@@ -358,31 +380,31 @@
 result();
 
 writeln"Problem 32";
-goal IFOL.thy "(ALL x. P(x) & (Q(x)|R(x))-->S(x)) & \
+Goal "(ALL x. P(x) & (Q(x)|R(x))-->S(x)) & \
 \       (ALL x. S(x) & R(x) --> L(x)) & \
 \       (ALL x. M(x) --> R(x))  \
 \   --> (ALL x. P(x) & M(x) --> L(x))";
-by (IntPr.best_tac 1);
+by (IntPr.fast_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 (IntPr.best_tac 1);
+Goal "(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 (IntPr.best_tac 1);   (*1.67s*)
 result();
 
 
 writeln"Problem 36";
-goal IFOL.thy 
+Goal 
      "(ALL x. EX y. J(x,y)) & \
 \     (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 (IntPr.fast_tac 1);  (*35 secs*)
+by (IntPr.fast_tac 1);  (*5 secs*)
 result();
 
 writeln"Problem 37";
-goal IFOL.thy
+Goal
        "(ALL z. EX w. ALL x. EX y. \
 \          ~~(P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u. Q(u,w)))) & \
 \       (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) & \
@@ -391,18 +413,18 @@
 (*NOT PROVED*)
 
 writeln"Problem 39";
-goal IFOL.thy "~ (EX x. ALL y. F(y,x) <-> ~F(y,y))";
+Goal "~ (EX x. ALL y. F(y,x) <-> ~F(y,y))";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem 40.  AMENDED";
-goal IFOL.thy "(EX y. ALL x. F(x,y) <-> F(x,x)) -->  \
+Goal "(EX y. ALL x. F(x,y) <-> F(x,x)) -->  \
 \             ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))";
 by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem 44";
-goal IFOL.thy "(ALL x. f(x) -->                                 \
+Goal "(ALL x. f(x) -->                                 \
 \             (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))";
@@ -410,41 +432,36 @@
 result();
 
 writeln"Problem 48";
-goal IFOL.thy "(a=b | c=d) & (a=c | b=d) --> a=d | b=c";
+Goal "(a=b | c=d) & (a=c | b=d) --> a=d | b=c";
 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)) -->  \
+Goal "(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 (IntPr.best_tac 1);  (*34 seconds*)
+by (IntPr.fast_tac 1);
 result();
 
 writeln"Problem 52";
 (*Almost the same as 51. *)
-goal IFOL.thy
-    "(EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->  \
+Goal "(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 (IntPr.best_tac 1);  (*34 seconds*)
+by (IntPr.fast_tac 1);
 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)))";
+Goal "(ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))";
 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)) & \
+Goal "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 (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))";
+Goal "ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))";
 by (IntPr.fast_tac 1);
 result();
 
--- a/src/FOL/intprover.ML	Mon Jul 27 16:04:20 1998 +0200
+++ b/src/FOL/intprover.ML	Mon Jul 27 17:38:55 1998 +0200
@@ -19,13 +19,16 @@
 signature INT_PROVER = 
   sig
   val best_tac: int -> tactic
+  val best_dup_tac: int -> tactic
   val fast_tac: int -> tactic
   val inst_step_tac: int -> tactic
   val safe_step_tac: int -> tactic
   val safe_brls: (bool * thm) list
   val safe_tac: tactic
   val step_tac: int -> tactic
+  val step_dup_tac: int -> tactic
   val haz_brls: (bool * thm) list
+  val haz_dup_brls: (bool * thm) list
   end;
 
 
@@ -50,6 +53,11 @@
       (true,allE), (true,not_impE), (true,imp_impE), (true,iff_impE),
       (true,all_impE), (true,ex_impE), (true,impE) ];
 
+val haz_dup_brls =
+    [ (false,disjI1), (false,disjI2), (false,exI), 
+      (true,all_dupE), (true,not_impE), (true,imp_impE), (true,iff_impE),
+      (true,all_impE), (true,ex_impE), (true,impE) ];
+
 (*0 subgoals vs 1 or more: the p in safep is for positive*)
 val (safe0_brls, safep_brls) =
     partition (apl(0,op=) o subgoals_of_brl) safe_brls;
@@ -72,6 +80,9 @@
 (*One safe or unsafe step. *)
 fun step_tac i = FIRST [safe_tac, inst_step_tac i, biresolve_tac haz_brls i];
 
+fun step_dup_tac i = FIRST [safe_tac, inst_step_tac i, 
+			    biresolve_tac haz_dup_brls i];
+
 (*Dumb but fast*)
 val fast_tac = SELECT_GOAL (DEPTH_SOLVE (step_tac 1));
 
@@ -79,5 +90,10 @@
 val best_tac = 
   SELECT_GOAL (BEST_FIRST (has_fewer_prems 1, size_of_thm) (step_tac 1));
 
+(*Uses all_dupE: allows multiple use of universal assumptions.  VERY slow.*)
+val best_dup_tac = 
+  SELECT_GOAL (BEST_FIRST (has_fewer_prems 1, size_of_thm) (step_dup_tac 1));
+
+
 end;