diff -r 68a7acb5f22e -r fd19f77dcf60 src/FOLP/ex/quant.ML --- a/src/FOLP/ex/quant.ML Sat Sep 17 20:49:14 2005 +0200 +++ b/src/FOLP/ex/quant.ML Sun Sep 18 14:25:48 2005 +0200 @@ -7,101 +7,99 @@ Needs declarations of the theory "thy" and the tactic "tac" *) -writeln"File FOLP/ex/quant.ML"; - Goal "?p : (ALL x y. P(x,y)) --> (ALL y x. P(x,y))"; by tac; -result(); +result(); Goal "?p : (EX x y. P(x,y)) --> (EX y x. P(x,y))"; by tac; -result(); +result(); (*Converse is false*) Goal "?p : (ALL x. P(x)) | (ALL x. Q(x)) --> (ALL x. P(x) | Q(x))"; by tac; -result(); +result(); Goal "?p : (ALL x. P-->Q(x)) <-> (P--> (ALL x. Q(x)))"; by tac; -result(); +result(); Goal "?p : (ALL x. P(x)-->Q) <-> ((EX x. P(x)) --> Q)"; by tac; -result(); +result(); writeln"Some harder ones"; Goal "?p : (EX x. P(x) | Q(x)) <-> (EX x. P(x)) | (EX x. Q(x))"; by tac; -result(); +result(); (*6 secs*) (*Converse is false*) Goal "?p : (EX x. P(x)&Q(x)) --> (EX x. P(x)) & (EX x. Q(x))"; by tac; -result(); +result(); writeln"Basic test of quantifier reasoning"; (*TRUE*) Goal "?p : (EX y. ALL x. Q(x,y)) --> (ALL x. EX y. Q(x,y))"; -by tac; -result(); +by tac; +result(); Goal "?p : (ALL x. Q(x)) --> (EX x. Q(x))"; -by tac; -result(); +by tac; +result(); writeln"The following should fail, as they are false!"; Goal "?p : (ALL x. EX y. Q(x,y)) --> (EX y. ALL x. Q(x,y))"; -by tac handle ERROR => writeln"Failed, as expected"; +by tac handle ERROR => writeln"Failed, as expected"; (*Check that subgoals remain: proof failed.*) -getgoal 1; +getgoal 1; Goal "?p : (EX x. Q(x)) --> (ALL x. Q(x))"; -by tac handle ERROR => writeln"Failed, as expected"; -getgoal 1; +by tac handle ERROR => writeln"Failed, as expected"; +getgoal 1; Goal "?p : P(?a) --> (ALL x. P(x))"; by tac handle ERROR => writeln"Failed, as expected"; (*Check that subgoals remain: proof failed.*) -getgoal 1; +getgoal 1; Goal "?p : (P(?a) --> (ALL x. Q(x))) --> (ALL x. P(x) --> Q(x))"; by tac handle ERROR => writeln"Failed, as expected"; -getgoal 1; +getgoal 1; writeln"Back to things that are provable..."; Goal "?p : (ALL x. P(x)-->Q(x)) & (EX x. P(x)) --> (EX x. Q(x))"; -by tac; -result(); +by tac; +result(); (*An example of why exI should be delayed as long as possible*) Goal "?p : (P --> (EX x. Q(x))) & P --> (EX x. Q(x))"; -by tac; -result(); +by tac; +result(); Goal "?p : (ALL x. P(x)-->Q(f(x))) & (ALL x. Q(x)-->R(g(x))) & P(d) --> R(?a)"; -by tac; -(*Verify that no subgoals remain.*) -uresult(); +by tac; +(*Verify that no subgoals remain.*) +uresult(); Goal "?p : (ALL x. Q(x)) --> (EX x. Q(x))"; by tac; -result(); +result(); writeln"Some slow ones"; @@ -110,20 +108,17 @@ (*Principia Mathematica *11.53 *) Goal "?p : (ALL x y. P(x) --> Q(y)) <-> ((EX x. P(x)) --> (ALL y. Q(y)))"; by tac; -result(); +result(); (*6 secs*) (*Principia Mathematica *11.55 *) Goal "?p : (EX x y. P(x) & Q(x,y)) <-> (EX x. P(x) & (EX y. Q(x,y)))"; by tac; -result(); +result(); (*9 secs*) (*Principia Mathematica *11.61 *) Goal "?p : (EX y. ALL x. P(x) --> Q(x,y)) --> (ALL x. P(x) --> (EX y. Q(x,y)))"; by tac; -result(); +result(); (*3 secs*) - -writeln"Reached end of file."; -