src/FOL/ex/cla.ML
author lcp
Wed, 19 Oct 1994 09:41:48 +0100
changeset 644 112cf8574cf1
parent 492 7bc980c7585e
child 665 97e9ad6c1c4a
permissions -rw-r--r--
FOL/ex/cla/58: slightly shorter proof
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
(*  Title: 	FOL/ex/cla
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
    Author: 	Lawrence C Paulson, Cambridge University Computer Laboratory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1992  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
Classical First-Order Logic
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
writeln"File FOL/ex/cla.";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
open Cla;    (*in case structure Int is open!*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
goal FOL.thy "(P --> Q | R) --> (P-->Q) | (P-->R)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
(*If and only if*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
goal FOL.thy "(P<->Q) <-> (Q<->P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    21
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    22
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    23
goal FOL.thy "~ (P <-> ~P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
(*Sample problems from 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
  F. J. Pelletier, 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
  Seventy-Five Problems for Testing Automatic Theorem Provers,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
  J. Automated Reasoning 2 (1986), 191-216.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
  Errata, JAR 4 (1988), 236-236.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
The hardest problems -- judging by experience with several theorem provers,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
including matrix ones -- are 34 and 43.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    36
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
writeln"Pelletier's examples";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
(*1*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
goal FOL.thy "(P-->Q)  <->  (~Q --> ~P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
(*2*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
goal FOL.thy "~ ~ P  <->  P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
(*3*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
goal FOL.thy "~(P-->Q) --> (Q-->P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
(*4*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
goal FOL.thy "(~P-->Q)  <->  (~Q --> P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
(*5*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
goal FOL.thy "((P|Q)-->(P|R)) --> (P|(Q-->R))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
(*6*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
goal FOL.thy "P | ~ P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
(*7*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
goal FOL.thy "P | ~ ~ ~ P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
(*8.  Peirce's law*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
goal FOL.thy "((P-->Q) --> P)  -->  P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
(*9*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
goal FOL.thy "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
(*10*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
goal FOL.thy "(Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P<->Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
(*11.  Proved in each direction (incorrectly, says Pelletier!!)  *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
goal FOL.thy "P<->P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
(*12.  "Dijkstra's law"*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
goal FOL.thy "((P <-> Q) <-> R)  <->  (P <-> (Q <-> R))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
(*13.  Distributive law*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
goal FOL.thy "P | (Q & R)  <-> (P | Q) & (P | R)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
(*14*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
goal FOL.thy "(P <-> Q) <-> ((Q | ~P) & (~Q|P))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
(*15*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
goal FOL.thy "(P --> Q) <-> (~P | Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
(*16*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
goal FOL.thy "(P-->Q) | (Q-->P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
(*17*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
goal FOL.thy "((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   122
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
writeln"Classical Logic: examples with quantifiers";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   126
goal FOL.thy "(ALL x. P(x) & Q(x)) <-> (ALL x. P(x))  &  (ALL x. Q(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   127
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   128
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   129
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   130
goal FOL.thy "(EX x. P-->Q(x))  <->  (P --> (EX x.Q(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   132
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   133
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   134
goal FOL.thy "(EX x.P(x)-->Q)  <->  (ALL x.P(x)) --> Q";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   136
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   137
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   138
goal FOL.thy "(ALL x.P(x)) | Q  <->  (ALL x. P(x) | Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
13
b73f7e42135e Added example from Avron: Gentzen-Type Systems, Resolution and Tableaux, JAR 10
lcp
parents: 0
diff changeset
   142
(*Discussed in Avron, Gentzen-Type Systems, Resolution and Tableaux,
b73f7e42135e Added example from Avron: Gentzen-Type Systems, Resolution and Tableaux, JAR 10
lcp
parents: 0
diff changeset
   143
  JAR 10 (265-281), 1993.  Proof is trivial!*)
b73f7e42135e Added example from Avron: Gentzen-Type Systems, Resolution and Tableaux, JAR 10
lcp
parents: 0
diff changeset
   144
goal FOL.thy
b73f7e42135e Added example from Avron: Gentzen-Type Systems, Resolution and Tableaux, JAR 10
lcp
parents: 0
diff changeset
   145
    "~ ((EX x.~P(x)) & ((EX x.P(x)) | (EX x.P(x) & Q(x))) & ~ (EX x.P(x)))";
b73f7e42135e Added example from Avron: Gentzen-Type Systems, Resolution and Tableaux, JAR 10
lcp
parents: 0
diff changeset
   146
by (fast_tac FOL_cs 1);
b73f7e42135e Added example from Avron: Gentzen-Type Systems, Resolution and Tableaux, JAR 10
lcp
parents: 0
diff changeset
   147
result();
b73f7e42135e Added example from Avron: Gentzen-Type Systems, Resolution and Tableaux, JAR 10
lcp
parents: 0
diff changeset
   148
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
writeln"Problems requiring quantifier duplication";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
(*Needs multiple instantiation of ALL.*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
goal FOL.thy "(ALL x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   154
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   156
(*Needs double instantiation of the quantifier*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
goal FOL.thy "EX x. P(x) --> P(a) & P(b)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
goal FOL.thy "EX z. P(z) --> (ALL x. P(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
492
7bc980c7585e added a new example due to Robin Arthan
lcp
parents: 428
diff changeset
   165
goal FOL.thy "EX x. (EX y. P(y)) --> P(x)";
7bc980c7585e added a new example due to Robin Arthan
lcp
parents: 428
diff changeset
   166
by (best_tac FOL_dup_cs 1);
7bc980c7585e added a new example due to Robin Arthan
lcp
parents: 428
diff changeset
   167
result();
7bc980c7585e added a new example due to Robin Arthan
lcp
parents: 428
diff changeset
   168
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
(*from Vladimir Lifschitz, What Is the Inverse Method?, JAR 5 (1989), 1--23*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
goal FOL.thy "EX x x'. ALL y. EX z z'. \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
\               (~P(y,y) | P(x,x) | ~S(z,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
\               (S(x,y) | ~S(y,z) | Q(z',z'))  & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   173
\               (Q(x',y) | ~Q(y,z') | S(x',x'))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
writeln"Hard examples with quantifiers";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   176
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
writeln"Problem 18";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
goal FOL.thy "EX y. ALL x. P(y)-->P(x)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
writeln"Problem 19";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   183
goal FOL.thy "EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   185
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
writeln"Problem 20";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   188
goal FOL.thy "(ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))     \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   189
\   --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   190
by (fast_tac FOL_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   191
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   192
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   193
writeln"Problem 21";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
goal FOL.thy "(EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> (EX x. P<->Q(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   198
writeln"Problem 22";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   199
goal FOL.thy "(ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
by (fast_tac FOL_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   203
writeln"Problem 23";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   204
goal FOL.thy "(ALL x. P | Q(x))  <->  (P | (ALL x. Q(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   205
by (best_tac FOL_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   206
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   207
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   208
writeln"Problem 24";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   209
goal FOL.thy "~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
\    ~(EX x.P(x)) --> (EX x.Q(x)) & (ALL x. Q(x)|R(x) --> S(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   211
\   --> (EX x. P(x)&R(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
by (fast_tac FOL_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   213
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
writeln"Problem 25";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   216
goal FOL.thy "(EX x. P(x)) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   217
\       (ALL x. L(x) --> ~ (M(x) & R(x))) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   218
\       (ALL x. P(x) --> (M(x) & L(x))) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   219
\       ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   220
\   --> (EX x. Q(x)&P(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
by (best_tac FOL_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   222
(*slow*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   223
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   224
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   225
writeln"Problem 26";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   226
goal FOL.thy "((EX x. p(x)) <-> (EX x. q(x))) &	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   227
\     (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   228
\ --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   229
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   230
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   231
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   232
writeln"Problem 27";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   233
goal FOL.thy "(EX x. P(x) & ~Q(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   234
\             (ALL x. P(x) --> R(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   235
\             (ALL x. M(x) & L(x) --> P(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   236
\             ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   237
\         --> (ALL x. M(x) --> ~L(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   238
by (fast_tac FOL_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   239
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   240
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   241
writeln"Problem 28.  AMENDED";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   242
goal FOL.thy "(ALL x. P(x) --> (ALL x. Q(x))) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   243
\       ((ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   244
\       ((EX x.S(x)) --> (ALL x. L(x) --> M(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   245
\   --> (ALL x. P(x) & L(x) --> M(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   246
by (fast_tac FOL_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   247
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   248
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   249
writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   250
goal FOL.thy "(EX x. P(x)) & (EX y. Q(y))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   251
\   --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->     \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   252
\        (ALL x y. P(x) & Q(y) --> R(x) & S(y)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   253
by (fast_tac FOL_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   254
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   255
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   256
writeln"Problem 30";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   257
goal FOL.thy "(ALL x. P(x) | Q(x) --> ~ R(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   258
\       (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   259
\   --> (ALL x. S(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   260
by (fast_tac FOL_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   261
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   262
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   263
writeln"Problem 31";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   264
goal FOL.thy "~(EX x.P(x) & (Q(x) | R(x))) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   265
\       (EX x. L(x) & P(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   266
\       (ALL x. ~ R(x) --> M(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   267
\   --> (EX x. L(x) & M(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   268
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   269
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   270
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   271
writeln"Problem 32";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   272
goal FOL.thy "(ALL x. P(x) & (Q(x)|R(x))-->S(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   273
\       (ALL x. S(x) & R(x) --> L(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   274
\       (ALL x. M(x) --> R(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   275
\   --> (ALL x. P(x) & M(x) --> L(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   276
by (best_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   277
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   278
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   279
writeln"Problem 33";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   280
goal FOL.thy "(ALL x. P(a) & (P(x)-->P(b))-->P(c))  <->    \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   281
\    (ALL x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   282
by (best_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   283
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   284
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   285
writeln"Problem 34  AMENDED (TWICE!!)  NOT PROVED AUTOMATICALLY";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   286
(*Andrews's challenge*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   287
goal FOL.thy "((EX x. ALL y. p(x) <-> p(y))  <->		\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   288
\              ((EX x. q(x)) <-> (ALL y. p(y))))     <->	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   289
\             ((EX x. ALL y. q(x) <-> q(y))  <->		\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   290
\              ((EX x. p(x)) <-> (ALL y. q(y))))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   291
by (safe_tac FOL_cs);			(*22 secs*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   292
by (TRYALL (fast_tac FOL_cs));		(*128 secs*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   293
by (TRYALL (best_tac FOL_dup_cs));	(*77 secs*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   294
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   295
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   296
writeln"Problem 35";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   297
goal FOL.thy "EX x y. P(x,y) -->  (ALL u v. P(u,v))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   298
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   299
(*6.1 secs*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   300
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   301
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   302
writeln"Problem 36";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   303
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   304
     "(ALL x. EX y. J(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   305
\     (ALL x. EX y. G(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   306
\     (ALL x y. J(x,y) | G(x,y) --> (ALL z. J(y,z) | G(y,z) --> H(x,z)))   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   307
\ --> (ALL x. EX y. H(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   308
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   309
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   310
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   311
writeln"Problem 37";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   312
goal FOL.thy "(ALL z. EX w. ALL x. EX y. \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   313
\          (P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u.Q(u,w)))) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   314
\       (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   315
\       ((EX x y. Q(x,y)) --> (ALL x. R(x,x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   316
\   --> (ALL x. EX y. R(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   317
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   318
(*slow...Poly/ML: 9.7 secs*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   319
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   320
428
49cc52442678 problem 38 is provable
lcp
parents: 36
diff changeset
   321
writeln"Problem 38";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   322
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   323
    "(ALL x. p(a) & (p(x) --> (EX y. p(y) & r(x,y))) -->	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   324
\            (EX z. EX w. p(z) & r(x,w) & r(w,z)))  <->		\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   325
\    (ALL x. (~p(a) | p(x) | (EX z. EX w. p(z) & r(x,w) & r(w,z))) &	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   326
\            (~p(a) | ~(EX y. p(y) & r(x,y)) |				\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   327
\             (EX z. EX w. p(z) & r(x,w) & r(w,z))))";
428
49cc52442678 problem 38 is provable
lcp
parents: 36
diff changeset
   328
by (fast_tac FOL_cs 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   329
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   330
writeln"Problem 39";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   331
goal FOL.thy "~ (EX x. ALL y. F(y,x) <-> ~F(y,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   332
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   333
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   334
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   335
writeln"Problem 40.  AMENDED";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   336
goal FOL.thy "(EX y. ALL x. F(x,y) <-> F(x,x)) -->  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   337
\             ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   338
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   339
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   340
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   341
writeln"Problem 41";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   342
goal FOL.thy "(ALL z. EX y. ALL x. f(x,y) <-> f(x,z) & ~ f(x,x))	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   343
\         --> ~ (EX z. ALL x. f(x,z))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   344
by (best_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   345
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   346
428
49cc52442678 problem 38 is provable
lcp
parents: 36
diff changeset
   347
writeln"Problem 42";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   348
goal FOL.thy "~ (EX y. ALL x. p(x,y) <-> ~ (EX z. p(x,z) & p(z,x)))";
428
49cc52442678 problem 38 is provable
lcp
parents: 36
diff changeset
   349
by (best_tac FOL_dup_cs 1);
49cc52442678 problem 38 is provable
lcp
parents: 36
diff changeset
   350
result();
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   351
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   352
writeln"Problem 43  NOT PROVED AUTOMATICALLY";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   353
goal FOL.thy "(ALL x. ALL y. q(x,y) <-> (ALL z. p(z,x) <-> p(z,y)))	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   354
\         --> (ALL x. (ALL y. q(x,y) <-> q(y,x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   355
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   356
writeln"Problem 44";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   357
goal FOL.thy "(ALL x. f(x) -->						\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   358
\             (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &   	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   359
\             (EX x. j(x) & (ALL y. g(y) --> h(x,y)))			\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   360
\             --> (EX x. j(x) & ~f(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   361
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   362
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   363
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   364
writeln"Problem 45";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   365
goal FOL.thy "(ALL x. f(x) & (ALL y. g(y) & h(x,y) --> j(x,y))	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   366
\                     --> (ALL y. g(y) & h(x,y) --> k(y))) &	\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   367
\     ~ (EX y. l(y) & k(y)) &					\
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   368
\     (EX x. f(x) & (ALL y. h(x,y) --> l(y))			\
36
70c6014c9b6f examples now use ~= for "not equals"
lcp
parents: 13
diff changeset
   369
\                 & (ALL y. g(y) & h(x,y) --> j(x,y)))		\
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   370
\     --> (EX x. f(x) & ~ (EX y. g(y) & h(x,y)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   371
by (best_tac FOL_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   372
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   373
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   374
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   375
writeln"Problems (mainly) involving equality or functions";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   376
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   377
writeln"Problem 48";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   378
goal FOL.thy "(a=b | c=d) & (a=c | b=d) --> a=d | b=c";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   379
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   380
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   381
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   382
writeln"Problem 49  NOT PROVED AUTOMATICALLY";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   383
(*Hard because it involves substitution for Vars;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   384
  the type constraint ensures that x,y,z have the same type as a,b,u. *)
36
70c6014c9b6f examples now use ~= for "not equals"
lcp
parents: 13
diff changeset
   385
goal FOL.thy "(EX x y::'a. ALL z. z=x | z=y) & P(a) & P(b) & a~=b \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   386
\		--> (ALL u::'a.P(u))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   387
by (safe_tac FOL_cs);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   388
by (res_inst_tac [("x","a")] allE 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   389
ba 1;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   390
by (res_inst_tac [("x","b")] allE 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   391
ba 1;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   392
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   393
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   394
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   395
writeln"Problem 50";  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   396
(*What has this to do with equality?*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   397
goal FOL.thy "(ALL x. P(a,x) | (ALL y.P(x,y))) --> (EX x. ALL y.P(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   398
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   399
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   400
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   401
writeln"Problem 51";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   402
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   403
    "(EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   404
\    (EX z. ALL x. EX w. (ALL y. P(x,y) <-> y=w) <-> x=z)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   405
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   406
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   407
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   408
writeln"Problem 52";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   409
(*Almost the same as 51. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   410
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   411
    "(EX z w. ALL x y. P(x,y) <->  (x=z & y=w)) -->  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   412
\    (EX w. ALL y. EX z. (ALL x. P(x,y) <-> x=z) <-> y=w)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   413
by (best_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   414
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   415
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   416
writeln"Problem 55";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   417
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   418
(*Original, equational version by Len Schubert, via Pelletier *** NOT PROVED
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   419
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   420
  "(EX x. lives(x) & killed(x,agatha)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   421
\  lives(agatha) & lives(butler) & lives(charles) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   422
\  (ALL x. lives(x) --> x=agatha | x=butler | x=charles) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   423
\  (ALL x y. killed(x,y) --> hates(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   424
\  (ALL x y. killed(x,y) --> ~richer(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   425
\  (ALL x. hates(agatha,x) --> ~hates(charles,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   426
\  (ALL x. ~ x=butler --> hates(agatha,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   427
\  (ALL x. ~richer(x,agatha) --> hates(butler,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   428
\  (ALL x. hates(agatha,x) --> hates(butler,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   429
\  (ALL x. EX y. ~hates(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   430
\  ~ agatha=butler --> \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   431
\  killed(?who,agatha)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   432
by (safe_tac FOL_cs);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   433
by (dres_inst_tac [("x1","x")] (spec RS mp) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   434
ba 1;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   435
be (spec RS exE) 1;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   436
by (REPEAT (etac allE 1));
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   437
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   438
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   439
****)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   440
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   441
(*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   442
  fast_tac DISCOVERS who killed Agatha. *)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   443
goal FOL.thy "lives(agatha) & lives(butler) & lives(charles) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   444
\  (killed(agatha,agatha) | killed(butler,agatha) | killed(charles,agatha)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   445
\  (ALL x y. killed(x,y) --> hates(x,y) & ~richer(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   446
\  (ALL x. hates(agatha,x) --> ~hates(charles,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   447
\  (hates(agatha,agatha) & hates(agatha,charles)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   448
\  (ALL x. lives(x) & ~richer(x,agatha) --> hates(butler,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   449
\  (ALL x. hates(agatha,x) --> hates(butler,x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   450
\  (ALL x. ~hates(x,agatha) | ~hates(x,butler) | ~hates(x,charles)) --> \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   451
\   killed(?who,agatha)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   452
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   453
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   454
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   455
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   456
writeln"Problem 56";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   457
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   458
    "(ALL x. (EX y. P(y) & x=f(y)) --> P(x)) <-> (ALL x. P(x) --> P(f(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   459
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   460
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   461
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   462
writeln"Problem 57";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   463
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   464
    "P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   465
\    (ALL x y z. P(x,y) & P(y,z) --> P(x,z))    -->   P(f(a,b), f(a,c))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   466
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   467
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   468
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   469
writeln"Problem 58  NOT PROVED AUTOMATICALLY";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   470
goal FOL.thy "(ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))";
644
112cf8574cf1 FOL/ex/cla/58: slightly shorter proof
lcp
parents: 492
diff changeset
   471
by (fast_tac (FOL_cs addEs [subst_context]) 1);
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   472
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   473
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   474
writeln"Problem 59";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   475
goal FOL.thy "(ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   476
by (best_tac FOL_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   477
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   478
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   479
writeln"Problem 60";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   480
goal FOL.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   481
    "ALL x. P(x,f(x)) <-> (EX y. (ALL z. P(z,y) --> P(z,f(x))) & P(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   482
by (fast_tac FOL_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   483
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   484
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   485
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   486
writeln"Reached end of file.";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   487
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   488
(*Thu Jul 23 1992: loaded in 467.1s using iffE*)