src/FOLP/ex/cla.ML
author clasohm
Tue, 30 Jan 1996 15:19:20 +0100
changeset 1464 a608f83e3421
parent 1459 d12da312eff4
child 2574 3a832a3c6376
permissions -rw-r--r--
expanded tabs; removed commit() from ROOT.ML
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1459
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
     1
(*  Title:      FOLP/ex/cla
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
    ID:         $Id$
1459
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
    Copyright   1993  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
1464
a608f83e3421 expanded tabs; removed commit() from ROOT.ML
clasohm
parents: 1459
diff changeset
     9
writeln"File FOLP/ex/cla.ML";
0
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 FOLP.thy "?p : (P --> Q | R) --> (P-->Q) | (P-->R)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
by (fast_tac FOLP_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 FOLP.thy "?p : (P<->Q) <-> (Q<->P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
by (fast_tac FOLP_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 FOLP.thy "?p : ~ (P <-> ~P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
by (fast_tac FOLP_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 FOLP.thy "?p : (P-->Q)  <->  (~Q --> ~P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    41
by (fast_tac FOLP_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 FOLP.thy "?p : ~ ~ P  <->  P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    46
by (fast_tac FOLP_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 FOLP.thy "?p : ~(P-->Q) --> (Q-->P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    51
by (fast_tac FOLP_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 FOLP.thy "?p : (~P-->Q)  <->  (~Q --> P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    56
by (fast_tac FOLP_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 FOLP.thy "?p : ((P|Q)-->(P|R)) --> (P|(Q-->R))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    61
by (fast_tac FOLP_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 FOLP.thy "?p : P | ~ P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    66
by (fast_tac FOLP_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 FOLP.thy "?p : P | ~ ~ ~ P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    71
by (fast_tac FOLP_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 FOLP.thy "?p : ((P-->Q) --> P)  -->  P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    76
by (fast_tac FOLP_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 FOLP.thy "?p : ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    81
by (fast_tac FOLP_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 FOLP.thy "?p : (Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P<->Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    86
by (fast_tac FOLP_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 FOLP.thy "?p : P<->P";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    91
by (fast_tac FOLP_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 FOLP.thy "?p : ((P <-> Q) <-> R)  <->  (P <-> (Q <-> R))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    96
by (fast_tac FOLP_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 FOLP.thy "?p : P | (Q & R)  <-> (P | Q) & (P | R)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   101
by (fast_tac FOLP_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 FOLP.thy "?p : (P <-> Q) <-> ((Q | ~P) & (~Q|P))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   106
by (fast_tac FOLP_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 FOLP.thy "?p : (P --> Q) <-> (~P | Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   111
by (fast_tac FOLP_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 FOLP.thy "?p : (P-->Q) | (Q-->P)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   116
by (fast_tac FOLP_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 FOLP.thy "?p : ((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
by (fast_tac FOLP_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 FOLP.thy "?p : (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 FOLP_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 FOLP.thy "?p : (EX x. P-->Q(x))  <->  (P --> (EX x.Q(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   131
by (fast_tac FOLP_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 FOLP.thy "?p : (EX x.P(x)-->Q)  <->  (ALL x.P(x)) --> Q";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   135
by (fast_tac FOLP_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 FOLP.thy "?p : (ALL x.P(x)) | Q  <->  (ALL x. P(x) | Q)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   142
writeln"Problems requiring quantifier duplication";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
(*Needs multiple instantiation of ALL.*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
(*
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
goal FOLP.thy "?p : (ALL x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   147
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
(*Needs double instantiation of the quantifier*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   151
goal FOLP.thy "?p : EX x. P(x) --> P(a) & P(b)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   152
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   153
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   154
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   155
goal FOLP.thy "?p : EX z. P(z) --> (ALL x. P(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   156
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   159
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
writeln"Hard examples with quantifiers";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
writeln"Problem 18";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
goal FOLP.thy "?p : EX y. ALL x. P(y)-->P(x)";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   164
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
writeln"Problem 19";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
goal FOLP.thy "?p : EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   169
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
writeln"Problem 20";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   173
goal FOLP.thy "?p : (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))     \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
\   --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   175
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   176
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
(*
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
writeln"Problem 21";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
goal FOLP.thy "?p : (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> (EX x. P<->Q(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   180
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   183
writeln"Problem 22";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
goal FOLP.thy "?p : (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   185
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   188
writeln"Problem 23";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   189
goal FOLP.thy "?p : (ALL x. P | Q(x))  <->  (P | (ALL x. Q(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   190
by (best_tac FOLP_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 24";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
goal FOLP.thy "?p : ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
\    ~(EX x.P(x)) --> (EX x.Q(x)) & (ALL x. Q(x)|R(x) --> S(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
\   --> (EX x. P(x)&R(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   197
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   198
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   199
(*
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
writeln"Problem 25";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
goal FOLP.thy "?p : (EX x. P(x)) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
\       (ALL x. L(x) --> ~ (M(x) & R(x))) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   203
\       (ALL x. P(x) --> (M(x) & L(x))) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   204
\       ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   205
\   --> (EX x. Q(x)&P(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   206
by (best_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   207
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   208
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   209
writeln"Problem 26";
1459
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   210
goal FOLP.thy "?u : ((EX x. p(x)) <-> (EX x. q(x))) &   \
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   211
\     (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))   \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
\ --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   213
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   216
writeln"Problem 27";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   217
goal FOLP.thy "?p : (EX x. P(x) & ~Q(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   218
\             (ALL x. P(x) --> R(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   219
\             (ALL x. M(x) & L(x) --> P(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   220
\             ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
\         --> (ALL x. M(x) --> ~L(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   222
by (fast_tac FOLP_cs 1); 
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 28.  AMENDED";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   226
goal FOLP.thy "?p : (ALL x. P(x) --> (ALL x. Q(x))) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   227
\       ((ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   228
\       ((EX x.S(x)) --> (ALL x. L(x) --> M(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   229
\   --> (ALL x. P(x) & L(x) --> M(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   230
by (fast_tac FOLP_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   231
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   232
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   233
writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   234
goal FOLP.thy "?p : (EX x. P(x)) & (EX y. Q(y))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   235
\   --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->     \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   236
\        (ALL x y. P(x) & Q(y) --> R(x) & S(y)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   237
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   238
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   239
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   240
writeln"Problem 30";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   241
goal FOLP.thy "?p : (ALL x. P(x) | Q(x) --> ~ R(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   242
\       (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   243
\   --> (ALL x. S(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   244
by (fast_tac FOLP_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   245
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   246
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   247
writeln"Problem 31";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   248
goal FOLP.thy "?p : ~(EX x.P(x) & (Q(x) | R(x))) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   249
\       (EX x. L(x) & P(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   250
\       (ALL x. ~ R(x) --> M(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   251
\   --> (EX x. L(x) & M(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   252
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   253
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   254
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   255
writeln"Problem 32";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   256
goal FOLP.thy "?p : (ALL x. P(x) & (Q(x)|R(x))-->S(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   257
\       (ALL x. S(x) & R(x) --> L(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   258
\       (ALL x. M(x) --> R(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   259
\   --> (ALL x. P(x) & M(x) --> L(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   260
by (best_tac FOLP_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 33";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   264
goal FOLP.thy "?p : (ALL x. P(a) & (P(x)-->P(b))-->P(c))  <->    \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   265
\    (ALL x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   266
by (best_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   267
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   268
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   269
writeln"Problem 35";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   270
goal FOLP.thy "?p : EX x y. P(x,y) -->  (ALL u v. P(u,v))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   271
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   272
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   273
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   274
writeln"Problem 36";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   275
goal FOLP.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   276
"?p : (ALL x. EX y. J(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   277
\     (ALL x. EX y. G(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   278
\     (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
   279
\ --> (ALL x. EX y. H(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   280
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   281
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   282
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   283
writeln"Problem 37";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   284
goal FOLP.thy "?p : (ALL z. EX w. ALL x. EX y. \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   285
\          (P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u.Q(u,w)))) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   286
\       (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   287
\       ((EX x y. Q(x,y)) --> (ALL x. R(x,x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   288
\   --> (ALL x. EX y. R(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   289
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   290
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   291
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   292
writeln"Problem 39";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   293
goal FOLP.thy "?p : ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   294
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   295
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   296
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   297
writeln"Problem 40.  AMENDED";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   298
goal FOLP.thy "?p : (EX y. ALL x. F(x,y) <-> F(x,x)) -->  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   299
\             ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   300
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   301
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   302
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   303
writeln"Problem 41";
1459
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   304
goal FOLP.thy "?p : (ALL z. EX y. ALL x. f(x,y) <-> f(x,z) & ~ f(x,x))  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   305
\         --> ~ (EX z. ALL x. f(x,z))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   306
by (best_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   307
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   308
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   309
writeln"Problem 44";
1459
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   310
goal FOLP.thy "?p : (ALL x. f(x) -->                                    \
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   311
\             (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &       \
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   312
\             (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                   \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   313
\             --> (EX x. j(x) & ~f(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   314
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   315
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   316
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   317
writeln"Problems (mainly) involving equality or functions";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   318
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   319
writeln"Problem 48";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   320
goal FOLP.thy "?p : (a=b | c=d) & (a=c | b=d) --> a=d | b=c";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   321
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   322
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   323
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   324
writeln"Problem 50";  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   325
(*What has this to do with equality?*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   326
goal FOLP.thy "?p : (ALL x. P(a,x) | (ALL y.P(x,y))) --> (EX x. ALL y.P(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   327
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   328
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   329
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   330
writeln"Problem 56";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   331
goal FOLP.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   332
 "?p : (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
   333
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   334
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   335
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   336
writeln"Problem 57";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   337
goal FOLP.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   338
"?p : P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   339
\     (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
   340
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   341
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   342
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   343
writeln"Problem 58  NOT PROVED AUTOMATICALLY";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   344
goal FOLP.thy "?p : (ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   345
val f_cong = read_instantiate [("t","f")] subst_context;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   346
by (fast_tac (FOLP_cs addIs [f_cong]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   347
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   348
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   349
writeln"Problem 59";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   350
goal FOLP.thy "?p : (ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   351
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   352
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   353
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   354
writeln"Problem 60";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   355
goal FOLP.thy
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   356
"?p : 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
   357
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   358
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   359
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   360
writeln"Reached end of file.";