src/FOLP/ex/cla.ML
author haftmann
Tue, 10 Jul 2007 17:30:50 +0200
changeset 23709 fd31da8f752a
parent 17480 fd19f77dcf60
permissions -rw-r--r--
moved lfp_induct2 here
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
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
     6
Classical First-Order Logic.
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
     9
goal (theory "FOLP") "?p : (P --> Q | R) --> (P-->Q) | (P-->R)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
(*If and only if*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    15
goal (theory "FOLP") "?p : (P<->Q) <-> (Q<->P)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    19
goal (theory "FOLP") "?p : ~ (P <-> ~P)";
0
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    24
(*Sample problems from 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    25
  F. J. Pelletier, 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    26
  Seventy-Five Problems for Testing Automatic Theorem Provers,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    27
  J. Automated Reasoning 2 (1986), 191-216.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    28
  Errata, JAR 4 (1988), 236-236.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    29
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    30
The hardest problems -- judging by experience with several theorem provers,
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    31
including matrix ones -- are 34 and 43.
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    32
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    33
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    34
writeln"Pelletier's examples";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    35
(*1*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    36
goal (theory "FOLP") "?p : (P-->Q)  <->  (~Q --> ~P)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    37
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    38
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    39
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    40
(*2*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    41
goal (theory "FOLP") "?p : ~ ~ P  <->  P";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    42
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    43
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    44
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    45
(*3*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    46
goal (theory "FOLP") "?p : ~(P-->Q) --> (Q-->P)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    47
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    48
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    49
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    50
(*4*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    51
goal (theory "FOLP") "?p : (~P-->Q)  <->  (~Q --> P)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    52
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    53
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    54
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    55
(*5*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    56
goal (theory "FOLP") "?p : ((P|Q)-->(P|R)) --> (P|(Q-->R))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    57
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    58
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    59
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    60
(*6*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    61
goal (theory "FOLP") "?p : P | ~ P";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    62
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    63
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    64
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    65
(*7*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    66
goal (theory "FOLP") "?p : P | ~ ~ ~ P";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    67
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    68
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    69
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    70
(*8.  Peirce's law*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    71
goal (theory "FOLP") "?p : ((P-->Q) --> P)  -->  P";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    72
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    73
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    74
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    75
(*9*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    76
goal (theory "FOLP") "?p : ((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    77
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    78
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    79
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    80
(*10*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    81
goal (theory "FOLP") "?p : (Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P<->Q)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    82
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    83
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    84
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    85
(*11.  Proved in each direction (incorrectly, says Pelletier!!)  *)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    86
goal (theory "FOLP") "?p : P<->P";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    87
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    88
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    89
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    90
(*12.  "Dijkstra's law"*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    91
goal (theory "FOLP") "?p : ((P <-> Q) <-> R)  <->  (P <-> (Q <-> R))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    92
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    93
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    94
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    95
(*13.  Distributive law*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
    96
goal (theory "FOLP") "?p : P | (Q & R)  <-> (P | Q) & (P | R)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    97
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    98
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    99
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   100
(*14*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   101
goal (theory "FOLP") "?p : (P <-> Q) <-> ((Q | ~P) & (~Q|P))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   102
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   103
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   104
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   105
(*15*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   106
goal (theory "FOLP") "?p : (P --> Q) <-> (~P | Q)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   107
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   108
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   109
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   110
(*16*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   111
goal (theory "FOLP") "?p : (P-->Q) | (Q-->P)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   112
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   113
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   114
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   115
(*17*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   116
goal (theory "FOLP") "?p : ((P & (Q-->R))-->S) <-> ((~P | Q | S) & (~P | ~R | S))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   117
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   118
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   119
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   120
writeln"Classical Logic: examples with quantifiers";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   121
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   122
goal (theory "FOLP") "?p : (ALL x. P(x) & Q(x)) <-> (ALL x. P(x))  &  (ALL x. Q(x))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   123
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   124
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   125
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   126
goal (theory "FOLP") "?p : (EX x. P-->Q(x))  <->  (P --> (EX x. Q(x)))";
0
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
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   130
goal (theory "FOLP") "?p : (EX x. P(x)-->Q)  <->  (ALL x. P(x)) --> Q";
0
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
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   134
goal (theory "FOLP") "?p : (ALL x. P(x)) | Q  <->  (ALL x. P(x) | Q)";
0
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
writeln"Problems requiring quantifier duplication";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   139
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   140
(*Needs multiple instantiation of ALL.*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   141
(*
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   142
goal (theory "FOLP") "?p : (ALL x. P(x)-->P(f(x)))  &  P(d)-->P(f(f(f(d))))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   143
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   144
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   145
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   146
(*Needs double instantiation of the quantifier*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   147
goal (theory "FOLP") "?p : EX x. P(x) --> P(a) & P(b)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   148
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   149
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   150
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   151
goal (theory "FOLP") "?p : EX z. P(z) --> (ALL x. P(x))";
0
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
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   156
writeln"Hard examples with quantifiers";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   157
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   158
writeln"Problem 18";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   159
goal (theory "FOLP") "?p : EX y. ALL x. P(y)-->P(x)";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   160
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   161
result(); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   162
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   163
writeln"Problem 19";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   164
goal (theory "FOLP") "?p : EX x. ALL y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   165
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   166
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   167
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   168
writeln"Problem 20";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   169
goal (theory "FOLP") "?p : (ALL x y. EX z. ALL w. (P(x)&Q(y)-->R(z)&S(w)))     \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   170
\   --> (EX x y. P(x) & Q(y)) --> (EX z. R(z))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   171
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   172
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   173
(*
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   174
writeln"Problem 21";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   175
goal (theory "FOLP") "?p : (EX x. P-->Q(x)) & (EX x. Q(x)-->P) --> (EX x. P<->Q(x))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   176
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   177
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   178
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   179
writeln"Problem 22";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   180
goal (theory "FOLP") "?p : (ALL x. P <-> Q(x))  -->  (P <-> (ALL x. Q(x)))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   181
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   182
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   183
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   184
writeln"Problem 23";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   185
goal (theory "FOLP") "?p : (ALL x. P | Q(x))  <->  (P | (ALL x. Q(x)))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   186
by (best_tac FOLP_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   187
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   188
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   189
writeln"Problem 24";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   190
goal (theory "FOLP") "?p : ~(EX x. S(x)&Q(x)) & (ALL x. P(x) --> Q(x)|R(x)) &  \
3836
f1a1817659e6 fixed dots;
wenzelm
parents: 2574
diff changeset
   191
\    (~(EX x. P(x)) --> (EX x. Q(x))) & (ALL x. Q(x)|R(x) --> S(x))  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   192
\   --> (EX x. P(x)&R(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   193
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   194
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   195
(*
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   196
writeln"Problem 25";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   197
goal (theory "FOLP") "?p : (EX x. P(x)) &  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   198
\       (ALL x. L(x) --> ~ (M(x) & R(x))) &  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   199
\       (ALL x. P(x) --> (M(x) & L(x))) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   200
\       ((ALL x. P(x)-->Q(x)) | (EX x. P(x)&R(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   201
\   --> (EX x. Q(x)&P(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   202
by (best_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   203
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   204
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   205
writeln"Problem 26";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   206
goal (theory "FOLP") "?u : ((EX x. p(x)) <-> (EX x. q(x))) &   \
1459
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   207
\     (ALL x. ALL y. p(x) & q(y) --> (r(x) <-> s(y)))   \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   208
\ --> ((ALL x. p(x)-->r(x)) <-> (ALL x. q(x)-->s(x)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   209
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   210
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   211
*)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   212
writeln"Problem 27";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   213
goal (theory "FOLP") "?p : (EX x. P(x) & ~Q(x)) &   \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   214
\             (ALL x. P(x) --> R(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   215
\             (ALL x. M(x) & L(x) --> P(x)) &   \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   216
\             ((EX x. R(x) & ~ Q(x)) --> (ALL x. L(x) --> ~ R(x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   217
\         --> (ALL x. M(x) --> ~L(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   218
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   219
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   220
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   221
writeln"Problem 28.  AMENDED";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   222
goal (theory "FOLP") "?p : (ALL x. P(x) --> (ALL x. Q(x))) &   \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   223
\       ((ALL x. Q(x)|R(x)) --> (EX x. Q(x)&S(x))) &  \
3836
f1a1817659e6 fixed dots;
wenzelm
parents: 2574
diff changeset
   224
\       ((EX x. S(x)) --> (ALL x. L(x) --> M(x)))  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   225
\   --> (ALL x. P(x) & L(x) --> M(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   226
by (fast_tac FOLP_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   227
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   228
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   229
writeln"Problem 29.  Essentially the same as Principia Mathematica *11.71";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   230
goal (theory "FOLP") "?p : (EX x. P(x)) & (EX y. Q(y))  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   231
\   --> ((ALL x. P(x)-->R(x)) & (ALL y. Q(y)-->S(y))   <->     \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   232
\        (ALL x y. P(x) & Q(y) --> R(x) & S(y)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   233
by (fast_tac FOLP_cs 1); 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   234
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   235
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   236
writeln"Problem 30";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   237
goal (theory "FOLP") "?p : (ALL x. P(x) | Q(x) --> ~ R(x)) & \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   238
\       (ALL x. (Q(x) --> ~ S(x)) --> P(x) & R(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   239
\   --> (ALL x. S(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   240
by (fast_tac FOLP_cs 1);  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   241
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   242
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   243
writeln"Problem 31";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   244
goal (theory "FOLP") "?p : ~(EX x. P(x) & (Q(x) | R(x))) & \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   245
\       (EX x. L(x) & P(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   246
\       (ALL x. ~ R(x) --> M(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   247
\   --> (EX x. L(x) & M(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   248
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   249
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   250
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   251
writeln"Problem 32";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   252
goal (theory "FOLP") "?p : (ALL x. P(x) & (Q(x)|R(x))-->S(x)) & \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   253
\       (ALL x. S(x) & R(x) --> L(x)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   254
\       (ALL x. M(x) --> R(x))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   255
\   --> (ALL x. P(x) & M(x) --> L(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   256
by (best_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   257
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   258
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   259
writeln"Problem 33";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   260
goal (theory "FOLP") "?p : (ALL x. P(a) & (P(x)-->P(b))-->P(c))  <->    \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   261
\    (ALL x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   262
by (best_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   263
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   264
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   265
writeln"Problem 35";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   266
goal (theory "FOLP") "?p : EX x y. P(x,y) -->  (ALL u v. P(u,v))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   267
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   268
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   269
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   270
writeln"Problem 36";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   271
goal (theory "FOLP")
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   272
"?p : (ALL x. EX y. J(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   273
\     (ALL x. EX y. G(x,y)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   274
\     (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
   275
\ --> (ALL x. EX y. H(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   276
by (fast_tac FOLP_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 37";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   280
goal (theory "FOLP") "?p : (ALL z. EX w. ALL x. EX y. \
3836
f1a1817659e6 fixed dots;
wenzelm
parents: 2574
diff changeset
   281
\          (P(x,z)-->P(y,w)) & P(y,z) & (P(y,w) --> (EX u. Q(u,w)))) & \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   282
\       (ALL x z. ~P(x,z) --> (EX y. Q(y,z))) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   283
\       ((EX x y. Q(x,y)) --> (ALL x. R(x,x)))  \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   284
\   --> (ALL x. EX y. R(x,y))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   285
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   286
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   287
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   288
writeln"Problem 39";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   289
goal (theory "FOLP") "?p : ~ (EX x. ALL y. F(y,x) <-> ~F(y,y))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   290
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   291
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   292
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   293
writeln"Problem 40.  AMENDED";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   294
goal (theory "FOLP") "?p : (EX y. ALL x. F(x,y) <-> F(x,x)) -->  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   295
\             ~(ALL x. EX y. ALL z. F(z,y) <-> ~ F(z,x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   296
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   297
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   298
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   299
writeln"Problem 41";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   300
goal (theory "FOLP") "?p : (ALL z. EX y. ALL x. f(x,y) <-> f(x,z) & ~ f(x,x))  \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   301
\         --> ~ (EX z. ALL x. f(x,z))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   302
by (best_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   303
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   304
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   305
writeln"Problem 44";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   306
goal (theory "FOLP") "?p : (ALL x. f(x) -->                                    \
1459
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   307
\             (EX y. g(y) & h(x,y) & (EX y. g(y) & ~ h(x,y))))  &       \
d12da312eff4 expanded tabs
clasohm
parents: 0
diff changeset
   308
\             (EX x. j(x) & (ALL y. g(y) --> h(x,y)))                   \
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   309
\             --> (EX x. j(x) & ~f(x))";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   310
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   311
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   312
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   313
writeln"Problems (mainly) involving equality or functions";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   314
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   315
writeln"Problem 48";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   316
goal (theory "FOLP") "?p : (a=b | c=d) & (a=c | b=d) --> a=d | b=c";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   317
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   318
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   319
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   320
writeln"Problem 50";  
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   321
(*What has this to do with equality?*)
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   322
goal (theory "FOLP") "?p : (ALL x. P(a,x) | (ALL y. P(x,y))) --> (EX x. ALL y. P(x,y))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   323
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   324
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   325
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   326
writeln"Problem 56";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   327
goal (theory "FOLP")
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   328
 "?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
   329
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   330
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   331
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   332
writeln"Problem 57";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   333
goal (theory "FOLP")
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   334
"?p : P(f(a,b), f(b,c)) & P(f(b,c), f(a,c)) & \
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   335
\     (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
   336
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   337
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   338
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   339
writeln"Problem 58  NOT PROVED AUTOMATICALLY";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   340
goal (theory "FOLP") "?p : (ALL x y. f(x)=g(y)) --> (ALL x y. f(f(x))=f(g(y)))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   341
val f_cong = read_instantiate [("t","f")] subst_context;
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   342
by (fast_tac (FOLP_cs addIs [f_cong]) 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   343
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   344
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   345
writeln"Problem 59";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   346
goal (theory "FOLP") "?p : (ALL x. P(x) <-> ~P(f(x))) --> (EX x. P(x) & ~P(f(x)))";
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   347
by (best_tac FOLP_dup_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   348
result();
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   349
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   350
writeln"Problem 60";
17480
fd19f77dcf60 converted to Isar theory format;
wenzelm
parents: 3836
diff changeset
   351
goal (theory "FOLP")
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   352
"?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
   353
by (fast_tac FOLP_cs 1);
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
   354
result();