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