src/Sequents/LK/hardquant.ML
author paulson
Wed, 28 Jul 1999 13:46:51 +0200
changeset 7119 02d94b69ae04
parent 6252 935f183bf406
child 17481 75166ebb619b
permissions -rw-r--r--
more examples are working
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     1
(*  Title:      LK/ex/hard-quant
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     2
    ID:         $Id$
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     5
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     6
Hard examples with quantifiers.  Can be read to test the LK system.
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     7
From  F. J. Pelletier,
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     8
  Seventy-Five Problems for Testing Automatic Theorem Provers,
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
     9
  J. Automated Reasoning 2 (1986), 191-216.
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    10
  Errata, JAR 4 (1988), 236-236.
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    11
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    12
Uses pc_tac rather than fast_tac when the former is significantly faster.
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    13
*)
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    14
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    15
writeln"File LK/ex/hard-quant.";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    16
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    17
context LK.thy;
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    18
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    19
Goal "|- (ALL x. P(x) & Q(x)) <-> (ALL x. P(x))  &  (ALL x. Q(x))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    20
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    21
result(); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    22
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    23
Goal "|- (EX x. P-->Q(x))  <->  (P --> (EX x. Q(x)))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    24
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    25
result(); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    26
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    27
Goal "|- (EX x. P(x)-->Q)  <->  (ALL x. P(x)) --> Q";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    28
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    29
result(); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    30
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    31
Goal "|- (ALL x. P(x)) | Q  <->  (ALL x. P(x) | Q)";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    32
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    33
result(); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    34
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    35
writeln"Problems requiring quantifier duplication";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    36
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    37
(*Not provable by Fast_tac: needs multiple instantiation of ALL*)
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    38
Goal "|- (ALL x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    39
by (best_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    40
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    41
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    42
(*Needs double instantiation of the quantifier*)
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    43
Goal "|- EX x. P(x) --> P(a) & P(b)";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    44
by (fast_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    45
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    46
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    47
Goal "|- EX z. P(z) --> (ALL x. P(x))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    48
by (best_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    49
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    50
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    51
writeln"Hard examples with quantifiers";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    52
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    53
writeln"Problem 18";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    54
Goal "|- EX y. ALL x. P(y)-->P(x)";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    55
by (best_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    56
result(); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    57
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    58
writeln"Problem 19";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    59
Goal "|- EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    60
by (best_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    61
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    62
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    63
writeln"Problem 20";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    64
Goal "|- (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))     \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    65
\   --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    66
by (Fast_tac 1); 
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    67
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    68
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    69
writeln"Problem 21";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    70
Goal "|- (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> (EX x. P<->Q(x))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    71
by (best_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    72
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    73
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    74
writeln"Problem 22";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    75
Goal "|- (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    76
by (Fast_tac 1); 
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    77
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    78
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    79
writeln"Problem 23";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    80
Goal "|- (ALL x. P | Q(x))  <->  (P | (ALL x. Q(x)))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    81
by (best_tac LK_pack 1);  
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    82
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    83
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    84
writeln"Problem 24";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    85
Goal "|- ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &  \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    86
\    ~(EX x. P(x)) --> (EX x. Q(x)) & (ALL x. Q(x)|R(x) --> S(x))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    87
\   --> (EX x. P(x)&R(x))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    88
by (pc_tac LK_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    89
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    90
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    91
writeln"Problem 25";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
    92
Goal "|- (EX x. P(x)) &  \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    93
\       (ALL x. L(x) --> ~ (M(x) & R(x))) &  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    94
\       (ALL x. P(x) --> (M(x) & L(x))) &   \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    95
\       ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    96
\   --> (EX x. Q(x)&P(x))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    97
by (best_tac LK_pack 1);  
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    98
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
    99
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   100
writeln"Problem 26";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   101
Goal "|- ((EX x. p(x)) <-> (EX x. q(x))) &       \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   102
\     (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))   \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   103
\ --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   104
by (pc_tac LK_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   105
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   106
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   107
writeln"Problem 27";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   108
Goal "|- (EX x. P(x) & ~Q(x)) &   \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   109
\             (ALL x. P(x) --> R(x)) &   \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   110
\             (ALL x. M(x) & L(x) --> P(x)) &   \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   111
\             ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   112
\         --> (ALL x. M(x) --> ~L(x))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   113
by (pc_tac LK_pack 1); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   114
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   115
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   116
writeln"Problem 28.  AMENDED";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   117
Goal "|- (ALL x. P(x) --> (ALL x. Q(x))) &   \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   118
\       ((ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   119
\       ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   120
\   --> (ALL x. P(x) & L(x) --> M(x))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   121
by (pc_tac LK_pack 1);  
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   122
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   123
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   124
writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   125
Goal "|- (EX x. P(x)) & (EX y. Q(y))  \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   126
\   --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->     \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   127
\        (ALL x y. P(x) & Q(y) --> R(x) & S(y)))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   128
by (pc_tac LK_pack 1); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   129
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   130
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   131
writeln"Problem 30";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   132
Goal "|- (ALL x. P(x) | Q(x) --> ~ R(x)) & \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   133
\       (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   134
\   --> (ALL x. S(x))";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   135
by (Fast_tac 1);  
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   136
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   137
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   138
writeln"Problem 31";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   139
Goal "|- ~(EX x. P(x) & (Q(x) | R(x))) & \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   140
\       (EX x. L(x) & P(x)) & \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   141
\       (ALL x. ~ R(x) --> M(x))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   142
\   --> (EX x. L(x) & M(x))";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   143
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   144
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   145
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   146
writeln"Problem 32";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   147
Goal "|- (ALL x. P(x) & (Q(x)|R(x))-->S(x)) & \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   148
\       (ALL x. S(x) & R(x) --> L(x)) & \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   149
\       (ALL x. M(x) --> R(x))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   150
\   --> (ALL x. P(x) & M(x) --> L(x))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   151
by (best_tac LK_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   152
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   153
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   154
writeln"Problem 33";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   155
Goal "|- (ALL x. P(a) & (P(x)-->P(b))-->P(c))  <->    \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   156
\    (ALL x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   157
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   158
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   159
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   160
writeln"Problem 34  AMENDED (TWICE!!)";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   161
(*Andrews's challenge*)
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   162
Goal "|- ((EX x. ALL y. p(x) <-> p(y))  <->              \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   163
\              ((EX x. q(x)) <-> (ALL y. p(y))))     <->        \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   164
\             ((EX x. ALL y. q(x) <-> q(y))  <->                \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   165
\              ((EX x. p(x)) <-> (ALL y. q(y))))";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   166
by (best_tac LK_dup_pack 1); (*10 secs!*)
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   167
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   168
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   169
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   170
writeln"Problem 35";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   171
Goal "|- EX x y. P(x,y) -->  (ALL u v. P(u,v))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   172
by (best_tac LK_dup_pack 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   173
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   174
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   175
writeln"Problem 36";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   176
Goal "|- (ALL x. EX y. J(x,y)) & \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   177
\        (ALL x. EX y. G(x,y)) & \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   178
\        (ALL x y. J(x,y) | G(x,y) -->   \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   179
\        (ALL z. J(y,z) | G(y,z) --> H(x,z)))   \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   180
\        --> (ALL x. EX y. H(x,y))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   181
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   182
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   183
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   184
writeln"Problem 37";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   185
Goal "|- (ALL z. EX w. ALL x. EX y. \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   186
\          (P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u. Q(u,w)))) & \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   187
\       (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) & \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   188
\       ((EX x y. Q(x,y)) --> (ALL x. R(x,x)))  \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   189
\   --> (ALL x. EX y. R(x,y))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   190
by (pc_tac LK_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   191
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   192
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   193
writeln"Problem 38";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   194
Goal "|- (ALL x. p(a) & (p(x) --> (EX y. p(y) & r(x,y))) -->        \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   195
\                (EX z. EX w. p(z) & r(x,w) & r(w,z)))  <->         \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   196
\        (ALL x. (~p(a) | p(x) | (EX z. EX w. p(z) & r(x,w) & r(w,z))) &    \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   197
\                (~p(a) | ~(EX y. p(y) & r(x,y)) |                          \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   198
\                (EX z. EX w. p(z) & r(x,w) & r(w,z))))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   199
by (pc_tac LK_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   200
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   201
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   202
writeln"Problem 39";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   203
Goal "|- ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   204
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   205
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   206
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   207
writeln"Problem 40.  AMENDED";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   208
Goal "|- (EX y. ALL x. F(x,y) <-> F(x,x)) -->  \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   209
\        ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   210
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   211
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   212
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   213
writeln"Problem 41";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   214
Goal "|- (ALL z. EX y. ALL x. f(x,y) <-> f(x,z) & ~ f(x,x))      \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   215
\        --> ~ (EX z. ALL x. f(x,z))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   216
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   217
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   218
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   219
writeln"Problem 42";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   220
Goal "|- ~ (EX y. ALL x. p(x,y) <-> ~ (EX z. p(x,z) & p(z,x)))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   221
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   222
writeln"Problem 43  NOT PROVED AUTOMATICALLY";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   223
Goal "|- (ALL x. ALL y. q(x,y) <-> (ALL z. p(z,x) <-> p(z,y))) \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   224
\         --> (ALL x. (ALL y. q(x,y) <-> q(y,x)))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   225
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   226
writeln"Problem 44";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   227
Goal "|- (ALL x. f(x) -->                                        \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   228
\                (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &       \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   229
\        (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                   \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   230
\        --> (EX x. j(x) & ~f(x))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   231
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   232
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   233
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   234
writeln"Problem 45";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   235
Goal "|- (ALL x. f(x) & (ALL y. g(y) & h(x,y) --> j(x,y))        \
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   236
\                     --> (ALL y. g(y) & h(x,y) --> k(y))) &    \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   237
\     ~ (EX y. l(y) & k(y)) &                                   \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   238
\     (EX x. f(x) & (ALL y. h(x,y) --> l(y))                    \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   239
\                  & (ALL y. g(y) & h(x,y) --> j(x,y)))         \
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   240
\     --> (EX x. f(x) & ~ (EX y. g(y) & h(x,y)))";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   241
by (best_tac LK_pack 1); 
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   242
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   243
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   244
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   245
writeln"Problems (mainly) involving equality or functions";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   246
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   247
writeln"Problem 48";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   248
Goal "|- (a=b | c=d) & (a=c | b=d) --> a=d | b=c";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   249
by (fast_tac (pack() add_safes [subst]) 1);
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   250
result();
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   251
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   252
writeln"Problem 50";  
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   253
Goal "|- (ALL x. P(a,x) | (ALL y. P(x,y))) --> (EX x. ALL y. P(x,y))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   254
by (best_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   255
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   256
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   257
writeln"Problem 51";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   258
Goal "|- (EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->  \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   259
\        (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   260
by (fast_tac (pack() add_safes [subst]) 1);
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   261
result();
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   262
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   263
writeln"Problem 52";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   264
(*Almost the same as 51. *)
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   265
Goal "|- (EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->  \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   266
\        (EX w. ALL y. EX z. (ALL x. P(x,y) <-> x=z) <-> y=w)";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   267
by (fast_tac (pack() add_safes [subst]) 1);
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   268
result();
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   269
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   270
writeln"Problem 56";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   271
Goal "|- (ALL x.(EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   272
by (best_tac (pack() add_unsafes [symL, subst]) 1);
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   273
(*requires tricker to orient the equality properly*)
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   274
result();
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   275
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   276
writeln"Problem 57";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   277
Goal "|- P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) & \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   278
\        (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   279
by (Fast_tac 1);
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   280
result();
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   281
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   282
writeln"Problem 58!";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   283
Goal "|- (ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   284
by (fast_tac (pack() add_safes [subst]) 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   285
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   286
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   287
writeln"Problem 59";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   288
(*Unification works poorly here -- the abstraction %sobj prevents efficient
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   289
  operation of the occurs check*)
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   290
Unify.trace_bound := !Unify.search_bound - 1; 
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   291
Goal "|- (ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))";
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   292
by (best_tac LK_dup_pack 1);
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   293
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   294
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   295
writeln"Problem 60";
7119
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   296
Goal "|- ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   297
by (Fast_tac 1);
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   298
result();
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   299
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   300
writeln"Problem 62 as corrected in JAR 18 (1997), page 135";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   301
Goal "|- (ALL x. p(a) & (p(x) --> p(f(x))) --> p(f(f(x))))  <->     \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   302
\     (ALL x. (~p(a) | p(x) | p(f(f(x)))) &                      \
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   303
\             (~p(a) | ~p(f(x)) | p(f(f(x)))))";
02d94b69ae04 more examples are working
paulson
parents: 6252
diff changeset
   304
by (Fast_tac 1);
6252
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   305
result();
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   306
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   307
writeln"Reached end of file.";
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   308
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   309
(*18 June 92: loaded in 372 secs*)
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   310
(*19 June 92: loaded in 166 secs except #34, using repeat_goal_tac*)
935f183bf406 examples made separate dirs;
wenzelm
parents:
diff changeset
   311
(*29 June 92: loaded in 370 secs*)