969
|
1 |
(* Title: HOL/ex/meson
|
|
2 |
ID: $Id$
|
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1992 University of Cambridge
|
|
5 |
|
|
6 |
Test data for the MESON proof procedure
|
|
7 |
(Excludes the equality problems 51, 52, 56, 58)
|
|
8 |
|
|
9 |
show_hyps:=false;
|
|
10 |
|
|
11 |
by (rtac ccontr 1);
|
|
12 |
val [prem] = gethyps 1;
|
|
13 |
val nnf = make_nnf prem;
|
|
14 |
val xsko = skolemize nnf;
|
|
15 |
by (cut_facts_tac [xsko] 1 THEN REPEAT (etac exE 1));
|
|
16 |
val [_,sko] = gethyps 1;
|
|
17 |
val clauses = make_clauses [sko];
|
|
18 |
val horns = make_horns clauses;
|
|
19 |
val go::_ = neg_clauses clauses;
|
|
20 |
|
|
21 |
goal HOL.thy "False";
|
|
22 |
by (rtac (make_goal go) 1);
|
|
23 |
by (prolog_step_tac horns 1);
|
|
24 |
by (depth_prolog_tac horns);
|
|
25 |
by (best_prolog_tac size_of_subgoals horns);
|
|
26 |
*)
|
|
27 |
|
|
28 |
writeln"File HOL/ex/meson-test.";
|
|
29 |
|
|
30 |
(**** Interactive examples ****)
|
|
31 |
|
|
32 |
(*Generate nice names for Skolem functions*)
|
|
33 |
Logic.auto_rename := true; Logic.set_rename_prefix "a";
|
|
34 |
|
|
35 |
|
|
36 |
writeln"Problem 25";
|
|
37 |
goal HOL.thy "(? x. P(x)) & \
|
|
38 |
\ (! x. L(x) --> ~ (M(x) & R(x))) & \
|
|
39 |
\ (! x. P(x) --> (M(x) & L(x))) & \
|
|
40 |
\ ((! x. P(x)-->Q(x)) | (? x. P(x)&R(x))) \
|
|
41 |
\ --> (? x. Q(x)&P(x))";
|
|
42 |
by (rtac ccontr 1);
|
|
43 |
val [prem25] = gethyps 1;
|
|
44 |
val nnf25 = make_nnf prem25;
|
|
45 |
val xsko25 = skolemize nnf25;
|
|
46 |
by (cut_facts_tac [xsko25] 1 THEN REPEAT (etac exE 1));
|
|
47 |
val [_,sko25] = gethyps 1;
|
|
48 |
val clauses25 = make_clauses [sko25]; (*7 clauses*)
|
|
49 |
val horns25 = make_horns clauses25; (*16 Horn clauses*)
|
|
50 |
val go25::_ = neg_clauses clauses25;
|
|
51 |
|
|
52 |
goal HOL.thy "False";
|
|
53 |
by (rtac (make_goal go25) 1);
|
|
54 |
by (depth_prolog_tac horns25);
|
|
55 |
|
|
56 |
|
|
57 |
writeln"Problem 26";
|
|
58 |
goal HOL.thy "((? x. p(x)) = (? x. q(x))) & \
|
|
59 |
\ (! x. ! y. p(x) & q(y) --> (r(x) = s(y))) \
|
|
60 |
\ --> ((! x. p(x)-->r(x)) = (! x. q(x)-->s(x)))";
|
|
61 |
by (rtac ccontr 1);
|
|
62 |
val [prem26] = gethyps 1;
|
|
63 |
val nnf26 = make_nnf prem26;
|
|
64 |
val xsko26 = skolemize nnf26;
|
|
65 |
by (cut_facts_tac [xsko26] 1 THEN REPEAT (etac exE 1));
|
|
66 |
val [_,sko26] = gethyps 1;
|
|
67 |
val clauses26 = make_clauses [sko26]; (*9 clauses*)
|
|
68 |
val horns26 = make_horns clauses26; (*24 Horn clauses*)
|
|
69 |
val go26::_ = neg_clauses clauses26;
|
|
70 |
|
|
71 |
goal HOL.thy "False";
|
|
72 |
by (rtac (make_goal go26) 1);
|
|
73 |
by (depth_prolog_tac horns26); (*6 secs*)
|
|
74 |
|
|
75 |
|
|
76 |
|
|
77 |
writeln"Problem 43 NOW PROVED AUTOMATICALLY!!";
|
|
78 |
goal HOL.thy "(! x. ! y. q x y = (! z. p z x = (p z y::bool))) \
|
|
79 |
\ --> (! x. (! y. q x y = (q y x::bool)))";
|
|
80 |
by (rtac ccontr 1);
|
|
81 |
val [prem43] = gethyps 1;
|
|
82 |
val nnf43 = make_nnf prem43;
|
|
83 |
val xsko43 = skolemize nnf43;
|
|
84 |
by (cut_facts_tac [xsko43] 1 THEN REPEAT (etac exE 1));
|
|
85 |
val [_,sko43] = gethyps 1;
|
|
86 |
val clauses43 = make_clauses [sko43]; (*6*)
|
|
87 |
val horns43 = make_horns clauses43; (*16*)
|
|
88 |
val go43::_ = neg_clauses clauses43;
|
|
89 |
|
|
90 |
goal HOL.thy "False";
|
|
91 |
by (rtac (make_goal go43) 1);
|
|
92 |
by (best_prolog_tac size_of_subgoals horns43);
|
|
93 |
(*8.7 secs*)
|
|
94 |
|
|
95 |
|
|
96 |
(*Restore variable name preservation*)
|
|
97 |
Logic.auto_rename := false;
|
|
98 |
|
|
99 |
|
|
100 |
(**** Batch test data ****)
|
|
101 |
|
|
102 |
(*Sample problems from
|
|
103 |
F. J. Pelletier,
|
|
104 |
Seventy-Five Problems for Testing Automatic Theorem Provers,
|
|
105 |
J. Automated Reasoning 2 (1986), 191-216.
|
|
106 |
Errata, JAR 4 (1988), 236-236.
|
|
107 |
|
|
108 |
The hardest problems -- judging by experience with several theorem provers,
|
|
109 |
including matrix ones -- are 34 and 43.
|
|
110 |
*)
|
|
111 |
|
|
112 |
writeln"Pelletier's examples";
|
|
113 |
(*1*)
|
|
114 |
goal HOL.thy "(P-->Q) = (~Q --> ~P)";
|
|
115 |
by (safe_meson_tac 1);
|
|
116 |
result();
|
|
117 |
|
|
118 |
(*2*)
|
|
119 |
goal HOL.thy "(~ ~ P) = P";
|
|
120 |
by (safe_meson_tac 1);
|
|
121 |
result();
|
|
122 |
|
|
123 |
(*3*)
|
|
124 |
goal HOL.thy "~(P-->Q) --> (Q-->P)";
|
|
125 |
by (safe_meson_tac 1);
|
|
126 |
result();
|
|
127 |
|
|
128 |
(*4*)
|
|
129 |
goal HOL.thy "(~P-->Q) = (~Q --> P)";
|
|
130 |
by (safe_meson_tac 1);
|
|
131 |
result();
|
|
132 |
|
|
133 |
(*5*)
|
|
134 |
goal HOL.thy "((P|Q)-->(P|R)) --> (P|(Q-->R))";
|
|
135 |
by (safe_meson_tac 1);
|
|
136 |
result();
|
|
137 |
|
|
138 |
(*6*)
|
|
139 |
goal HOL.thy "P | ~ P";
|
|
140 |
by (safe_meson_tac 1);
|
|
141 |
result();
|
|
142 |
|
|
143 |
(*7*)
|
|
144 |
goal HOL.thy "P | ~ ~ ~ P";
|
|
145 |
by (safe_meson_tac 1);
|
|
146 |
result();
|
|
147 |
|
|
148 |
(*8. Peirce's law*)
|
|
149 |
goal HOL.thy "((P-->Q) --> P) --> P";
|
|
150 |
by (safe_meson_tac 1);
|
|
151 |
result();
|
|
152 |
|
|
153 |
(*9*)
|
|
154 |
goal HOL.thy "((P|Q) & (~P|Q) & (P| ~Q)) --> ~ (~P | ~Q)";
|
|
155 |
by (safe_meson_tac 1);
|
|
156 |
result();
|
|
157 |
|
|
158 |
(*10*)
|
|
159 |
goal HOL.thy "(Q-->R) & (R-->P&Q) & (P-->Q|R) --> (P=Q)";
|
|
160 |
by (safe_meson_tac 1);
|
|
161 |
result();
|
|
162 |
|
|
163 |
(*11. Proved in each direction (incorrectly, says Pelletier!!) *)
|
|
164 |
goal HOL.thy "P=(P::bool)";
|
|
165 |
by (safe_meson_tac 1);
|
|
166 |
result();
|
|
167 |
|
|
168 |
(*12. "Dijkstra's law"*)
|
|
169 |
goal HOL.thy "((P = Q) = R) = (P = (Q = R))";
|
|
170 |
by (best_meson_tac size_of_subgoals 1);
|
|
171 |
result();
|
|
172 |
|
|
173 |
(*13. Distributive law*)
|
|
174 |
goal HOL.thy "(P | (Q & R)) = ((P | Q) & (P | R))";
|
|
175 |
by (safe_meson_tac 1);
|
|
176 |
result();
|
|
177 |
|
|
178 |
(*14*)
|
|
179 |
goal HOL.thy "(P = Q) = ((Q | ~P) & (~Q|P))";
|
|
180 |
by (safe_meson_tac 1);
|
|
181 |
result();
|
|
182 |
|
|
183 |
(*15*)
|
|
184 |
goal HOL.thy "(P --> Q) = (~P | Q)";
|
|
185 |
by (safe_meson_tac 1);
|
|
186 |
result();
|
|
187 |
|
|
188 |
(*16*)
|
|
189 |
goal HOL.thy "(P-->Q) | (Q-->P)";
|
|
190 |
by (safe_meson_tac 1);
|
|
191 |
result();
|
|
192 |
|
|
193 |
(*17*)
|
|
194 |
goal HOL.thy "((P & (Q-->R))-->S) = ((~P | Q | S) & (~P | ~R | S))";
|
|
195 |
by (safe_meson_tac 1);
|
|
196 |
result();
|
|
197 |
|
|
198 |
writeln"Classical Logic: examples with quantifiers";
|
|
199 |
|
|
200 |
goal HOL.thy "(! x. P(x) & Q(x)) = ((! x. P(x)) & (! x. Q(x)))";
|
|
201 |
by (safe_meson_tac 1);
|
|
202 |
result();
|
|
203 |
|
|
204 |
goal HOL.thy "(? x. P-->Q(x)) = (P --> (? x.Q(x)))";
|
|
205 |
by (safe_meson_tac 1);
|
|
206 |
result();
|
|
207 |
|
|
208 |
goal HOL.thy "(? x.P(x)-->Q) = ((! x.P(x)) --> Q)";
|
|
209 |
by (safe_meson_tac 1);
|
|
210 |
result();
|
|
211 |
|
|
212 |
goal HOL.thy "((! x.P(x)) | Q) = (! x. P(x) | Q)";
|
|
213 |
by (safe_meson_tac 1);
|
|
214 |
result();
|
|
215 |
|
|
216 |
goal HOL.thy "(! x. P(x)-->P(f(x))) & P(d)-->P(f(f(f(d))))";
|
|
217 |
by (safe_meson_tac 1);
|
|
218 |
result();
|
|
219 |
|
1259
|
220 |
(*Needs double instantiation of EXISTS*)
|
969
|
221 |
goal HOL.thy "? x. P(x) --> P(a) & P(b)";
|
|
222 |
by (safe_meson_tac 1);
|
|
223 |
result();
|
|
224 |
|
|
225 |
goal HOL.thy "? z. P(z) --> (! x. P(x))";
|
|
226 |
by (safe_meson_tac 1);
|
|
227 |
result();
|
|
228 |
|
|
229 |
writeln"Hard examples with quantifiers";
|
|
230 |
|
|
231 |
writeln"Problem 18";
|
|
232 |
goal HOL.thy "? y. ! x. P(y)-->P(x)";
|
|
233 |
by (safe_meson_tac 1);
|
|
234 |
result();
|
|
235 |
|
|
236 |
writeln"Problem 19";
|
|
237 |
goal HOL.thy "? x. ! y z. (P(y)-->Q(z)) --> (P(x)-->Q(x))";
|
|
238 |
by (safe_meson_tac 1);
|
|
239 |
result();
|
|
240 |
|
|
241 |
writeln"Problem 20";
|
|
242 |
goal HOL.thy "(! x y. ? z. ! w. (P(x)&Q(y)-->R(z)&S(w))) \
|
|
243 |
\ --> (? x y. P(x) & Q(y)) --> (? z. R(z))";
|
|
244 |
by (safe_meson_tac 1);
|
|
245 |
result();
|
|
246 |
|
|
247 |
writeln"Problem 21";
|
|
248 |
goal HOL.thy "(? x. P-->Q(x)) & (? x. Q(x)-->P) --> (? x. P=Q(x))";
|
|
249 |
by (safe_meson_tac 1);
|
|
250 |
result();
|
|
251 |
|
|
252 |
writeln"Problem 22";
|
|
253 |
goal HOL.thy "(! x. P = Q(x)) --> (P = (! x. Q(x)))";
|
|
254 |
by (safe_meson_tac 1);
|
|
255 |
result();
|
|
256 |
|
|
257 |
writeln"Problem 23";
|
|
258 |
goal HOL.thy "(! x. P | Q(x)) = (P | (! x. Q(x)))";
|
|
259 |
by (safe_meson_tac 1);
|
|
260 |
result();
|
|
261 |
|
|
262 |
writeln"Problem 24";
|
|
263 |
goal HOL.thy "~(? x. S(x)&Q(x)) & (! x. P(x) --> Q(x)|R(x)) & \
|
|
264 |
\ ~(? x.P(x)) --> (? x.Q(x)) & (! x. Q(x)|R(x) --> S(x)) \
|
|
265 |
\ --> (? x. P(x)&R(x))";
|
|
266 |
by (safe_meson_tac 1);
|
|
267 |
result();
|
|
268 |
|
|
269 |
writeln"Problem 25";
|
|
270 |
goal HOL.thy "(? x. P(x)) & \
|
|
271 |
\ (! x. L(x) --> ~ (M(x) & R(x))) & \
|
|
272 |
\ (! x. P(x) --> (M(x) & L(x))) & \
|
|
273 |
\ ((! x. P(x)-->Q(x)) | (? x. P(x)&R(x))) \
|
|
274 |
\ --> (? x. Q(x)&P(x))";
|
|
275 |
by (safe_meson_tac 1);
|
|
276 |
result();
|
|
277 |
|
|
278 |
writeln"Problem 26";
|
|
279 |
goal HOL.thy "((? x. p(x)) = (? x. q(x))) & \
|
|
280 |
\ (! x. ! y. p(x) & q(y) --> (r(x) = s(y))) \
|
|
281 |
\ --> ((! x. p(x)-->r(x)) = (! x. q(x)-->s(x)))";
|
|
282 |
by (safe_meson_tac 1);
|
|
283 |
result();
|
|
284 |
|
|
285 |
writeln"Problem 27";
|
|
286 |
goal HOL.thy "(? x. P(x) & ~Q(x)) & \
|
|
287 |
\ (! x. P(x) --> R(x)) & \
|
|
288 |
\ (! x. M(x) & L(x) --> P(x)) & \
|
|
289 |
\ ((? x. R(x) & ~ Q(x)) --> (! x. L(x) --> ~ R(x))) \
|
|
290 |
\ --> (! x. M(x) --> ~L(x))";
|
|
291 |
by (safe_meson_tac 1);
|
|
292 |
result();
|
|
293 |
|
|
294 |
writeln"Problem 28. AMENDED";
|
|
295 |
goal HOL.thy "(! x. P(x) --> (! x. Q(x))) & \
|
|
296 |
\ ((! x. Q(x)|R(x)) --> (? x. Q(x)&S(x))) & \
|
|
297 |
\ ((? x.S(x)) --> (! x. L(x) --> M(x))) \
|
|
298 |
\ --> (! x. P(x) & L(x) --> M(x))";
|
|
299 |
by (safe_meson_tac 1);
|
|
300 |
result();
|
|
301 |
|
|
302 |
writeln"Problem 29. Essentially the same as Principia Mathematica *11.71";
|
|
303 |
goal HOL.thy "(? x. F(x)) & (? y. G(y)) \
|
|
304 |
\ --> ( ((! x. F(x)-->H(x)) & (! y. G(y)-->J(y))) = \
|
|
305 |
\ (! x y. F(x) & G(y) --> H(x) & J(y)))";
|
|
306 |
by (safe_meson_tac 1); (*5 secs*)
|
|
307 |
result();
|
|
308 |
|
|
309 |
writeln"Problem 30";
|
|
310 |
goal HOL.thy "(! x. P(x) | Q(x) --> ~ R(x)) & \
|
|
311 |
\ (! x. (Q(x) --> ~ S(x)) --> P(x) & R(x)) \
|
|
312 |
\ --> (! x. S(x))";
|
|
313 |
by (safe_meson_tac 1);
|
|
314 |
result();
|
|
315 |
|
|
316 |
writeln"Problem 31";
|
|
317 |
goal HOL.thy "~(? x.P(x) & (Q(x) | R(x))) & \
|
|
318 |
\ (? x. L(x) & P(x)) & \
|
|
319 |
\ (! x. ~ R(x) --> M(x)) \
|
|
320 |
\ --> (? x. L(x) & M(x))";
|
|
321 |
by (safe_meson_tac 1);
|
|
322 |
result();
|
|
323 |
|
|
324 |
writeln"Problem 32";
|
|
325 |
goal HOL.thy "(! x. P(x) & (Q(x)|R(x))-->S(x)) & \
|
|
326 |
\ (! x. S(x) & R(x) --> L(x)) & \
|
|
327 |
\ (! x. M(x) --> R(x)) \
|
|
328 |
\ --> (! x. P(x) & M(x) --> L(x))";
|
|
329 |
by (safe_meson_tac 1);
|
|
330 |
result();
|
|
331 |
|
|
332 |
writeln"Problem 33";
|
|
333 |
goal HOL.thy "(! x. P(a) & (P(x)-->P(b))-->P(c)) = \
|
|
334 |
\ (! x. (~P(a) | P(x) | P(c)) & (~P(a) | ~P(b) | P(c)))";
|
|
335 |
by (safe_meson_tac 1); (*5.6 secs*)
|
|
336 |
result();
|
|
337 |
|
|
338 |
writeln"Problem 34 AMENDED (TWICE!!)";
|
|
339 |
(*Andrews's challenge*)
|
|
340 |
goal HOL.thy "((? x. ! y. p(x) = p(y)) = \
|
|
341 |
\ ((? x. q(x)) = (! y. p(y)))) = \
|
|
342 |
\ ((? x. ! y. q(x) = q(y)) = \
|
|
343 |
\ ((? x. p(x)) = (! y. q(y))))";
|
|
344 |
by (safe_meson_tac 1); (*90 secs*)
|
|
345 |
result();
|
|
346 |
|
|
347 |
writeln"Problem 35";
|
|
348 |
goal HOL.thy "? x y. P x y --> (! u v. P u v)";
|
|
349 |
by (safe_meson_tac 1);
|
|
350 |
result();
|
|
351 |
|
|
352 |
writeln"Problem 36";
|
|
353 |
goal HOL.thy "(! x. ? y. J x y) & \
|
|
354 |
\ (! x. ? y. G x y) & \
|
|
355 |
\ (! x y. J x y | G x y --> \
|
|
356 |
\ (! z. J y z | G y z --> H x z)) \
|
|
357 |
\ --> (! x. ? y. H x y)";
|
|
358 |
by (safe_meson_tac 1);
|
|
359 |
result();
|
|
360 |
|
|
361 |
writeln"Problem 37";
|
|
362 |
goal HOL.thy "(! z. ? w. ! x. ? y. \
|
|
363 |
\ (P x z-->P y w) & P y z & (P y w --> (? u.Q u w))) & \
|
|
364 |
\ (! x z. ~P x z --> (? y. Q y z)) & \
|
|
365 |
\ ((? x y. Q x y) --> (! x. R x x)) \
|
|
366 |
\ --> (! x. ? y. R x y)";
|
|
367 |
by (safe_meson_tac 1); (*causes unification tracing messages*)
|
|
368 |
result();
|
|
369 |
|
|
370 |
writeln"Problem 38";
|
|
371 |
goal HOL.thy
|
|
372 |
"(! x. p(a) & (p(x) --> (? y. p(y) & r x y)) --> \
|
|
373 |
\ (? z. ? w. p(z) & r x w & r w z)) = \
|
|
374 |
\ (! x. (~p(a) | p(x) | (? z. ? w. p(z) & r x w & r w z)) & \
|
|
375 |
\ (~p(a) | ~(? y. p(y) & r x y) | \
|
|
376 |
\ (? z. ? w. p(z) & r x w & r w z)))";
|
|
377 |
by (safe_meson_tac 1); (*62 secs*)
|
|
378 |
result();
|
|
379 |
|
|
380 |
writeln"Problem 39";
|
|
381 |
goal HOL.thy "~ (? x. ! y. F y x = (~F y y))";
|
|
382 |
by (safe_meson_tac 1);
|
|
383 |
result();
|
|
384 |
|
|
385 |
writeln"Problem 40. AMENDED";
|
|
386 |
goal HOL.thy "(? y. ! x. F x y = F x x) \
|
|
387 |
\ --> ~ (! x. ? y. ! z. F z y = (~F z x))";
|
|
388 |
by (safe_meson_tac 1);
|
|
389 |
result();
|
|
390 |
|
|
391 |
writeln"Problem 41";
|
|
392 |
goal HOL.thy "(! z. (? y. (! x. f x y = (f x z & ~ f x x)))) \
|
|
393 |
\ --> ~ (? z. ! x. f x z)";
|
|
394 |
by (safe_meson_tac 1);
|
|
395 |
result();
|
|
396 |
|
|
397 |
writeln"Problem 42";
|
|
398 |
goal HOL.thy "~ (? y. ! x. p x y = (~ (? z. p x z & p z x)))";
|
|
399 |
by (safe_meson_tac 1);
|
|
400 |
result();
|
|
401 |
|
|
402 |
writeln"Problem 43 NOW PROVED AUTOMATICALLY!!";
|
|
403 |
goal HOL.thy "(! x. ! y. q x y = (! z. p z x = (p z y::bool))) \
|
|
404 |
\ --> (! x. (! y. q x y = (q y x::bool)))";
|
|
405 |
by (safe_meson_tac 1);
|
|
406 |
result();
|
|
407 |
|
|
408 |
writeln"Problem 44";
|
|
409 |
goal HOL.thy "(! x. f(x) --> \
|
|
410 |
\ (? y. g(y) & h x y & (? y. g(y) & ~ h x y))) & \
|
|
411 |
\ (? x. j(x) & (! y. g(y) --> h x y)) \
|
|
412 |
\ --> (? x. j(x) & ~f(x))";
|
|
413 |
by (safe_meson_tac 1);
|
|
414 |
result();
|
|
415 |
|
|
416 |
writeln"Problem 45";
|
|
417 |
goal HOL.thy "(! x. f(x) & (! y. g(y) & h x y --> j x y) \
|
|
418 |
\ --> (! y. g(y) & h x y --> k(y))) & \
|
|
419 |
\ ~ (? y. l(y) & k(y)) & \
|
|
420 |
\ (? x. f(x) & (! y. h x y --> l(y)) \
|
|
421 |
\ & (! y. g(y) & h x y --> j x y)) \
|
|
422 |
\ --> (? x. f(x) & ~ (? y. g(y) & h x y))";
|
|
423 |
by (safe_meson_tac 1); (*11 secs*)
|
|
424 |
result();
|
|
425 |
|
|
426 |
writeln"Problem 46";
|
|
427 |
goal HOL.thy
|
|
428 |
"(! x. f(x) & (! y. f(y) & h y x --> g(y)) --> g(x)) & \
|
|
429 |
\ ((? x.f(x) & ~g(x)) --> \
|
|
430 |
\ (? x. f(x) & ~g(x) & (! y. f(y) & ~g(y) --> j x y))) & \
|
|
431 |
\ (! x y. f(x) & f(y) & h x y --> ~j y x) \
|
|
432 |
\ --> (! x. f(x) --> g(x))";
|
|
433 |
by (safe_meson_tac 1); (*11 secs*)
|
|
434 |
result();
|
|
435 |
|
1259
|
436 |
(*The Los problem? Circulated by John Harrison*)
|
|
437 |
goal HOL.thy "(! x y z. P x y & P y z --> P x z) & \
|
|
438 |
\ (! x y z. Q x y & Q y z --> Q x z) & \
|
|
439 |
\ (! x y. P x y --> P y x) & \
|
|
440 |
\ (! (x::'a) y. P x y | Q x y) \
|
|
441 |
\ --> (! x y. P x y) | (! x y. Q x y)";
|
|
442 |
by (safe_meson_tac 1);
|
|
443 |
result();
|
|
444 |
|
|
445 |
(*A similar example, suggested by Johannes Schumann and credited to Pelletier*)
|
969
|
446 |
goal HOL.thy "(!x y z. P x y --> P y z --> P x z) --> \
|
|
447 |
\ (!x y z. Q x y --> Q y z --> Q x z) --> \
|
|
448 |
\ (!x y.Q x y --> Q y x) --> (!x y. P x y | Q x y) --> \
|
|
449 |
\ (!x y.P x y) | (!x y.Q x y)";
|
|
450 |
by (safe_meson_tac 1); (*32 secs*)
|
|
451 |
result();
|
|
452 |
|
|
453 |
writeln"Problem 50";
|
|
454 |
(*What has this to do with equality?*)
|
|
455 |
goal HOL.thy "(! x. P a x | (! y.P x y)) --> (? x. ! y.P x y)";
|
|
456 |
by (safe_meson_tac 1);
|
|
457 |
result();
|
|
458 |
|
|
459 |
writeln"Problem 55";
|
|
460 |
|
|
461 |
(*Non-equational version, from Manthey and Bry, CADE-9 (Springer, 1988).
|
|
462 |
meson_tac cannot report who killed Agatha. *)
|
|
463 |
goal HOL.thy "lives(agatha) & lives(butler) & lives(charles) & \
|
|
464 |
\ (killed agatha agatha | killed butler agatha | killed charles agatha) & \
|
|
465 |
\ (!x y. killed x y --> hates x y & ~richer x y) & \
|
|
466 |
\ (!x. hates agatha x --> ~hates charles x) & \
|
|
467 |
\ (hates agatha agatha & hates agatha charles) & \
|
|
468 |
\ (!x. lives(x) & ~richer x agatha --> hates butler x) & \
|
|
469 |
\ (!x. hates agatha x --> hates butler x) & \
|
|
470 |
\ (!x. ~hates x agatha | ~hates x butler | ~hates x charles) --> \
|
|
471 |
\ (? x. killed x agatha)";
|
|
472 |
by (safe_meson_tac 1);
|
|
473 |
result();
|
|
474 |
|
|
475 |
writeln"Problem 57";
|
|
476 |
goal HOL.thy
|
|
477 |
"P (f a b) (f b c) & P (f b c) (f a c) & \
|
|
478 |
\ (! x y z. P x y & P y z --> P x z) --> P (f a b) (f a c)";
|
|
479 |
by (safe_meson_tac 1);
|
|
480 |
result();
|
|
481 |
|
|
482 |
writeln"Problem 58";
|
|
483 |
(* Challenge found on info-hol *)
|
|
484 |
goal HOL.thy
|
|
485 |
"! P Q R x. ? v w. ! y z. P(x) & Q(y) --> (P(v) | R(w)) & (R(z) --> Q(v))";
|
|
486 |
by (safe_meson_tac 1);
|
|
487 |
result();
|
|
488 |
|
|
489 |
writeln"Problem 59";
|
|
490 |
goal HOL.thy "(! x. P(x) = (~P(f(x)))) --> (? x. P(x) & ~P(f(x)))";
|
|
491 |
by (safe_meson_tac 1);
|
|
492 |
result();
|
|
493 |
|
|
494 |
writeln"Problem 60";
|
|
495 |
goal HOL.thy "! x. P x (f x) = (? y. (! z. P z y --> P z (f x)) & P x y)";
|
|
496 |
by (safe_meson_tac 1);
|
|
497 |
result();
|
|
498 |
|
|
499 |
writeln"Reached end of file.";
|
|
500 |
|
|
501 |
(*26 August 1992: loaded in 277 secs. New Jersey v 75*)
|