author | wenzelm |
Tue, 28 Aug 2007 11:25:32 +0200 | |
changeset 24447 | fbd6d7cbf6dd |
parent 23778 | 18f426a137a9 |
child 25014 | b711b0af178e |
permissions | -rw-r--r-- |
14350 | 1 |
(* Title: HOL/ex/Refute_Examples.thy |
2 |
ID: $Id$ |
|
3 |
Author: Tjark Weber |
|
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
4 |
Copyright 2003-2007 |
14350 | 5 |
*) |
6 |
||
7 |
(* See 'HOL/Refute.thy' for help. *) |
|
8 |
||
9 |
header {* Examples for the 'refute' command *} |
|
10 |
||
15297 | 11 |
theory Refute_Examples imports Main |
12 |
begin |
|
14350 | 13 |
|
18774 | 14 |
refute_params [satsolver="dpll"] |
15 |
||
14350 | 16 |
lemma "P \<and> Q" |
17 |
apply (rule conjI) |
|
18 |
refute 1 -- {* refutes @{term "P"} *} |
|
19 |
refute 2 -- {* refutes @{term "Q"} *} |
|
20 |
refute -- {* equivalent to 'refute 1' *} |
|
14455 | 21 |
-- {* here 'refute 3' would cause an exception, since we only have 2 subgoals *} |
14465 | 22 |
refute [maxsize=5] -- {* we can override parameters ... *} |
23 |
refute [satsolver="dpll"] 2 -- {* ... and specify a subgoal at the same time *} |
|
14350 | 24 |
oops |
25 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
26 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
27 |
|
23219 | 28 |
subsection {* Examples and Test Cases *} |
14350 | 29 |
|
23219 | 30 |
subsubsection {* Propositional logic *} |
14350 | 31 |
|
32 |
lemma "True" |
|
33 |
refute |
|
34 |
apply auto |
|
35 |
done |
|
36 |
||
37 |
lemma "False" |
|
38 |
refute |
|
39 |
oops |
|
40 |
||
41 |
lemma "P" |
|
42 |
refute |
|
43 |
oops |
|
44 |
||
45 |
lemma "~ P" |
|
46 |
refute |
|
47 |
oops |
|
48 |
||
49 |
lemma "P & Q" |
|
50 |
refute |
|
51 |
oops |
|
52 |
||
53 |
lemma "P | Q" |
|
54 |
refute |
|
55 |
oops |
|
56 |
||
57 |
lemma "P \<longrightarrow> Q" |
|
58 |
refute |
|
59 |
oops |
|
60 |
||
61 |
lemma "(P::bool) = Q" |
|
62 |
refute |
|
63 |
oops |
|
64 |
||
65 |
lemma "(P | Q) \<longrightarrow> (P & Q)" |
|
66 |
refute |
|
67 |
oops |
|
68 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
69 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
70 |
|
23219 | 71 |
subsubsection {* Predicate logic *} |
14350 | 72 |
|
14455 | 73 |
lemma "P x y z" |
14350 | 74 |
refute |
75 |
oops |
|
76 |
||
77 |
lemma "P x y \<longrightarrow> P y x" |
|
78 |
refute |
|
79 |
oops |
|
80 |
||
14455 | 81 |
lemma "P (f (f x)) \<longrightarrow> P x \<longrightarrow> P (f x)" |
82 |
refute |
|
83 |
oops |
|
84 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
85 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
86 |
|
23219 | 87 |
subsubsection {* Equality *} |
14350 | 88 |
|
89 |
lemma "P = True" |
|
90 |
refute |
|
91 |
oops |
|
92 |
||
93 |
lemma "P = False" |
|
94 |
refute |
|
95 |
oops |
|
96 |
||
97 |
lemma "x = y" |
|
98 |
refute |
|
99 |
oops |
|
100 |
||
101 |
lemma "f x = g x" |
|
102 |
refute |
|
103 |
oops |
|
104 |
||
105 |
lemma "(f::'a\<Rightarrow>'b) = g" |
|
106 |
refute |
|
107 |
oops |
|
108 |
||
109 |
lemma "(f::('d\<Rightarrow>'d)\<Rightarrow>('c\<Rightarrow>'d)) = g" |
|
110 |
refute |
|
111 |
oops |
|
112 |
||
113 |
lemma "distinct [a,b]" |
|
14809 | 114 |
refute |
14350 | 115 |
apply simp |
116 |
refute |
|
117 |
oops |
|
118 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
119 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
120 |
|
23219 | 121 |
subsubsection {* First-Order Logic *} |
14350 | 122 |
|
123 |
lemma "\<exists>x. P x" |
|
124 |
refute |
|
125 |
oops |
|
126 |
||
127 |
lemma "\<forall>x. P x" |
|
128 |
refute |
|
129 |
oops |
|
130 |
||
131 |
lemma "EX! x. P x" |
|
132 |
refute |
|
133 |
oops |
|
134 |
||
135 |
lemma "Ex P" |
|
136 |
refute |
|
137 |
oops |
|
138 |
||
139 |
lemma "All P" |
|
140 |
refute |
|
141 |
oops |
|
142 |
||
143 |
lemma "Ex1 P" |
|
144 |
refute |
|
145 |
oops |
|
146 |
||
147 |
lemma "(\<exists>x. P x) \<longrightarrow> (\<forall>x. P x)" |
|
148 |
refute |
|
149 |
oops |
|
150 |
||
151 |
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>y. \<forall>x. P x y)" |
|
152 |
refute |
|
153 |
oops |
|
154 |
||
155 |
lemma "(\<exists>x. P x) \<longrightarrow> (EX! x. P x)" |
|
156 |
refute |
|
157 |
oops |
|
158 |
||
159 |
text {* A true statement (also testing names of free and bound variables being identical) *} |
|
160 |
||
161 |
lemma "(\<forall>x y. P x y \<longrightarrow> P y x) \<longrightarrow> (\<forall>x. P x y) \<longrightarrow> P y x" |
|
18774 | 162 |
refute [maxsize=4] |
14350 | 163 |
apply fast |
164 |
done |
|
165 |
||
18789 | 166 |
text {* "A type has at most 4 elements." *} |
14350 | 167 |
|
18789 | 168 |
lemma "a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e" |
14455 | 169 |
refute |
170 |
oops |
|
171 |
||
18789 | 172 |
lemma "\<forall>a b c d e. a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e" |
21559 | 173 |
refute |
14350 | 174 |
oops |
175 |
||
176 |
text {* "Every reflexive and symmetric relation is transitive." *} |
|
177 |
||
178 |
lemma "\<lbrakk> \<forall>x. P x x; \<forall>x y. P x y \<longrightarrow> P y x \<rbrakk> \<Longrightarrow> P x y \<longrightarrow> P y z \<longrightarrow> P x z" |
|
14489 | 179 |
refute |
14350 | 180 |
oops |
181 |
||
14465 | 182 |
text {* The "Drinker's theorem" ... *} |
14350 | 183 |
|
184 |
lemma "\<exists>x. f x = g x \<longrightarrow> f = g" |
|
14809 | 185 |
refute [maxsize=4] |
14350 | 186 |
apply (auto simp add: ext) |
187 |
done |
|
188 |
||
14465 | 189 |
text {* ... and an incorrect version of it *} |
14350 | 190 |
|
191 |
lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g" |
|
192 |
refute |
|
193 |
oops |
|
194 |
||
195 |
text {* "Every function has a fixed point." *} |
|
196 |
||
197 |
lemma "\<exists>x. f x = x" |
|
198 |
refute |
|
199 |
oops |
|
200 |
||
201 |
text {* "Function composition is commutative." *} |
|
202 |
||
203 |
lemma "f (g x) = g (f x)" |
|
204 |
refute |
|
205 |
oops |
|
206 |
||
207 |
text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *} |
|
208 |
||
209 |
lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)" |
|
210 |
refute |
|
211 |
oops |
|
212 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
213 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
214 |
|
23219 | 215 |
subsubsection {* Higher-Order Logic *} |
14350 | 216 |
|
217 |
lemma "\<exists>P. P" |
|
218 |
refute |
|
219 |
apply auto |
|
220 |
done |
|
221 |
||
222 |
lemma "\<forall>P. P" |
|
223 |
refute |
|
224 |
oops |
|
225 |
||
226 |
lemma "EX! P. P" |
|
227 |
refute |
|
228 |
apply auto |
|
229 |
done |
|
230 |
||
231 |
lemma "EX! P. P x" |
|
232 |
refute |
|
233 |
oops |
|
234 |
||
235 |
lemma "P Q | Q x" |
|
236 |
refute |
|
237 |
oops |
|
238 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
239 |
lemma "x \<noteq> All" |
14455 | 240 |
refute |
241 |
oops |
|
242 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
243 |
lemma "x \<noteq> Ex" |
14455 | 244 |
refute |
245 |
oops |
|
246 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
247 |
lemma "x \<noteq> Ex1" |
14455 | 248 |
refute |
249 |
oops |
|
250 |
||
14350 | 251 |
text {* "The transitive closure 'T' of an arbitrary relation 'P' is non-empty." *} |
252 |
||
253 |
constdefs |
|
254 |
"trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" |
|
255 |
"trans P == (ALL x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z)" |
|
256 |
"subset" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" |
|
257 |
"subset P Q == (ALL x y. P x y \<longrightarrow> Q x y)" |
|
258 |
"trans_closure" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" |
|
259 |
"trans_closure P Q == (subset Q P) & (trans P) & (ALL R. subset Q R \<longrightarrow> trans R \<longrightarrow> subset P R)" |
|
260 |
||
261 |
lemma "trans_closure T P \<longrightarrow> (\<exists>x y. T x y)" |
|
262 |
refute |
|
263 |
oops |
|
264 |
||
265 |
text {* "The union of transitive closures is equal to the transitive closure of unions." *} |
|
266 |
||
267 |
lemma "(\<forall>x y. (P x y | R x y) \<longrightarrow> T x y) \<longrightarrow> trans T \<longrightarrow> (\<forall>Q. (\<forall>x y. (P x y | R x y) \<longrightarrow> Q x y) \<longrightarrow> trans Q \<longrightarrow> subset T Q) |
|
268 |
\<longrightarrow> trans_closure TP P |
|
269 |
\<longrightarrow> trans_closure TR R |
|
270 |
\<longrightarrow> (T x y = (TP x y | TR x y))" |
|
16910 | 271 |
refute |
14350 | 272 |
oops |
273 |
||
274 |
text {* "Every surjective function is invertible." *} |
|
275 |
||
276 |
lemma "(\<forall>y. \<exists>x. y = f x) \<longrightarrow> (\<exists>g. \<forall>x. g (f x) = x)" |
|
277 |
refute |
|
278 |
oops |
|
279 |
||
280 |
text {* "Every invertible function is surjective." *} |
|
281 |
||
282 |
lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)" |
|
283 |
refute |
|
284 |
oops |
|
285 |
||
286 |
text {* Every point is a fixed point of some function. *} |
|
287 |
||
288 |
lemma "\<exists>f. f x = x" |
|
14809 | 289 |
refute [maxsize=4] |
14350 | 290 |
apply (rule_tac x="\<lambda>x. x" in exI) |
291 |
apply simp |
|
292 |
done |
|
293 |
||
14465 | 294 |
text {* Axiom of Choice: first an incorrect version ... *} |
14350 | 295 |
|
296 |
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))" |
|
297 |
refute |
|
298 |
oops |
|
299 |
||
14465 | 300 |
text {* ... and now two correct ones *} |
14350 | 301 |
|
302 |
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>f. \<forall>x. P x (f x))" |
|
14809 | 303 |
refute [maxsize=4] |
14350 | 304 |
apply (simp add: choice) |
305 |
done |
|
306 |
||
307 |
lemma "(\<forall>x. EX!y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))" |
|
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
308 |
refute [maxsize=2] |
14350 | 309 |
apply auto |
310 |
apply (simp add: ex1_implies_ex choice) |
|
311 |
apply (fast intro: ext) |
|
312 |
done |
|
313 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
314 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
315 |
|
23219 | 316 |
subsubsection {* Meta-logic *} |
14350 | 317 |
|
318 |
lemma "!!x. P x" |
|
319 |
refute |
|
320 |
oops |
|
321 |
||
322 |
lemma "f x == g x" |
|
323 |
refute |
|
324 |
oops |
|
325 |
||
326 |
lemma "P \<Longrightarrow> Q" |
|
327 |
refute |
|
328 |
oops |
|
329 |
||
330 |
lemma "\<lbrakk> P; Q; R \<rbrakk> \<Longrightarrow> S" |
|
331 |
refute |
|
332 |
oops |
|
333 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
334 |
lemma "(x == all) \<Longrightarrow> False" |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
335 |
refute |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
336 |
oops |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
337 |
|
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
338 |
lemma "(x == (op ==)) \<Longrightarrow> False" |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
339 |
refute |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
340 |
oops |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
341 |
|
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
342 |
lemma "(x == (op \<Longrightarrow>)) \<Longrightarrow> False" |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
343 |
refute |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
344 |
oops |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
345 |
|
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
346 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
347 |
|
23219 | 348 |
subsubsection {* Schematic variables *} |
14350 | 349 |
|
350 |
lemma "?P" |
|
351 |
refute |
|
352 |
apply auto |
|
353 |
done |
|
354 |
||
355 |
lemma "x = ?y" |
|
356 |
refute |
|
357 |
apply auto |
|
358 |
done |
|
359 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
360 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
361 |
|
23219 | 362 |
subsubsection {* Abstractions *} |
14350 | 363 |
|
364 |
lemma "(\<lambda>x. x) = (\<lambda>x. y)" |
|
365 |
refute |
|
366 |
oops |
|
367 |
||
368 |
lemma "(\<lambda>f. f x) = (\<lambda>f. True)" |
|
369 |
refute |
|
370 |
oops |
|
371 |
||
372 |
lemma "(\<lambda>x. x) = (\<lambda>y. y)" |
|
373 |
refute |
|
374 |
apply simp |
|
375 |
done |
|
376 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
377 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
378 |
|
23219 | 379 |
subsubsection {* Sets *} |
14350 | 380 |
|
381 |
lemma "P (A::'a set)" |
|
382 |
refute |
|
383 |
oops |
|
384 |
||
385 |
lemma "P (A::'a set set)" |
|
386 |
refute |
|
387 |
oops |
|
388 |
||
389 |
lemma "{x. P x} = {y. P y}" |
|
14489 | 390 |
refute |
14350 | 391 |
apply simp |
392 |
done |
|
393 |
||
394 |
lemma "x : {x. P x}" |
|
395 |
refute |
|
396 |
oops |
|
397 |
||
14455 | 398 |
lemma "P op:" |
399 |
refute |
|
400 |
oops |
|
401 |
||
402 |
lemma "P (op: x)" |
|
403 |
refute |
|
404 |
oops |
|
405 |
||
406 |
lemma "P Collect" |
|
407 |
refute |
|
408 |
oops |
|
409 |
||
14350 | 410 |
lemma "A Un B = A Int B" |
411 |
refute |
|
412 |
oops |
|
413 |
||
414 |
lemma "(A Int B) Un C = (A Un C) Int B" |
|
415 |
refute |
|
416 |
oops |
|
417 |
||
418 |
lemma "Ball A P \<longrightarrow> Bex A P" |
|
14455 | 419 |
refute |
420 |
oops |
|
421 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
422 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
423 |
|
23219 | 424 |
subsubsection {* arbitrary *} |
14455 | 425 |
|
426 |
lemma "arbitrary" |
|
427 |
refute |
|
428 |
oops |
|
429 |
||
430 |
lemma "P arbitrary" |
|
431 |
refute |
|
432 |
oops |
|
433 |
||
434 |
lemma "arbitrary x" |
|
435 |
refute |
|
436 |
oops |
|
437 |
||
438 |
lemma "arbitrary arbitrary" |
|
439 |
refute |
|
440 |
oops |
|
441 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
442 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
443 |
|
23219 | 444 |
subsubsection {* The *} |
14455 | 445 |
|
446 |
lemma "The P" |
|
447 |
refute |
|
448 |
oops |
|
449 |
||
450 |
lemma "P The" |
|
14350 | 451 |
refute |
452 |
oops |
|
453 |
||
14455 | 454 |
lemma "P (The P)" |
455 |
refute |
|
456 |
oops |
|
457 |
||
458 |
lemma "(THE x. x=y) = z" |
|
459 |
refute |
|
460 |
oops |
|
461 |
||
462 |
lemma "Ex P \<longrightarrow> P (The P)" |
|
14489 | 463 |
refute |
14455 | 464 |
oops |
465 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
466 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
467 |
|
23219 | 468 |
subsubsection {* Eps *} |
14455 | 469 |
|
470 |
lemma "Eps P" |
|
471 |
refute |
|
472 |
oops |
|
473 |
||
474 |
lemma "P Eps" |
|
475 |
refute |
|
476 |
oops |
|
477 |
||
478 |
lemma "P (Eps P)" |
|
479 |
refute |
|
480 |
oops |
|
481 |
||
482 |
lemma "(SOME x. x=y) = z" |
|
483 |
refute |
|
484 |
oops |
|
485 |
||
486 |
lemma "Ex P \<longrightarrow> P (Eps P)" |
|
14489 | 487 |
refute [maxsize=3] |
14455 | 488 |
apply (auto simp add: someI) |
489 |
done |
|
490 |
||
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
491 |
(******************************************************************************) |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
492 |
|
23219 | 493 |
subsubsection {* Subtypes (typedef), typedecl *} |
14809 | 494 |
|
15161 | 495 |
text {* A completely unspecified non-empty subset of @{typ "'a"}: *} |
496 |
||
14809 | 497 |
typedef 'a myTdef = "insert (arbitrary::'a) (arbitrary::'a set)" |
498 |
by auto |
|
499 |
||
500 |
lemma "(x::'a myTdef) = y" |
|
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
501 |
refute |
14809 | 502 |
oops |
503 |
||
504 |
typedecl myTdecl |
|
505 |
||
506 |
typedef 'a T_bij = "{(f::'a\<Rightarrow>'a). \<forall>y. \<exists>!x. f x = y}" |
|
507 |
by auto |
|
508 |
||
509 |
lemma "P (f::(myTdecl myTdef) T_bij)" |
|
510 |
refute |
|
511 |
oops |
|
512 |
||
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
513 |
(******************************************************************************) |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
514 |
|
23219 | 515 |
subsubsection {* Inductive datatypes *} |
14350 | 516 |
|
21502 | 517 |
text {* With @{text quick_and_dirty} set, the datatype package does |
518 |
not generate certain axioms for recursion operators. Without these |
|
519 |
axioms, refute may find spurious countermodels. *} |
|
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
520 |
|
23219 | 521 |
text {* unit *} |
14350 | 522 |
|
523 |
lemma "P (x::unit)" |
|
524 |
refute |
|
525 |
oops |
|
526 |
||
527 |
lemma "\<forall>x::unit. P x" |
|
528 |
refute |
|
529 |
oops |
|
530 |
||
531 |
lemma "P ()" |
|
532 |
refute |
|
533 |
oops |
|
534 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
535 |
lemma "P (unit_rec u x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
536 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
537 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
538 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
539 |
lemma "P (case x of () \<Rightarrow> u)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
540 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
541 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
542 |
|
23219 | 543 |
text {* option *} |
14455 | 544 |
|
545 |
lemma "P (x::'a option)" |
|
546 |
refute |
|
547 |
oops |
|
548 |
||
549 |
lemma "\<forall>x::'a option. P x" |
|
550 |
refute |
|
551 |
oops |
|
552 |
||
14809 | 553 |
lemma "P None" |
554 |
refute |
|
555 |
oops |
|
556 |
||
14455 | 557 |
lemma "P (Some x)" |
558 |
refute |
|
559 |
oops |
|
560 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
561 |
lemma "P (option_rec n s x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
562 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
563 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
564 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
565 |
lemma "P (case x of None \<Rightarrow> n | Some u \<Rightarrow> s u)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
566 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
567 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
568 |
|
23219 | 569 |
text {* * *} |
14350 | 570 |
|
571 |
lemma "P (x::'a*'b)" |
|
14455 | 572 |
refute |
14350 | 573 |
oops |
574 |
||
575 |
lemma "\<forall>x::'a*'b. P x" |
|
14455 | 576 |
refute |
14350 | 577 |
oops |
578 |
||
579 |
lemma "P (x,y)" |
|
14455 | 580 |
refute |
14350 | 581 |
oops |
582 |
||
583 |
lemma "P (fst x)" |
|
14455 | 584 |
refute |
14350 | 585 |
oops |
586 |
||
587 |
lemma "P (snd x)" |
|
14455 | 588 |
refute |
589 |
oops |
|
590 |
||
591 |
lemma "P Pair" |
|
592 |
refute |
|
14350 | 593 |
oops |
594 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
595 |
lemma "P (prod_rec p x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
596 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
597 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
598 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
599 |
lemma "P (case x of Pair a b \<Rightarrow> p a b)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
600 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
601 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
602 |
|
23219 | 603 |
text {* + *} |
14350 | 604 |
|
605 |
lemma "P (x::'a+'b)" |
|
14455 | 606 |
refute |
14350 | 607 |
oops |
608 |
||
609 |
lemma "\<forall>x::'a+'b. P x" |
|
14455 | 610 |
refute |
14350 | 611 |
oops |
612 |
||
613 |
lemma "P (Inl x)" |
|
14455 | 614 |
refute |
14350 | 615 |
oops |
616 |
||
617 |
lemma "P (Inr x)" |
|
14455 | 618 |
refute |
619 |
oops |
|
620 |
||
621 |
lemma "P Inl" |
|
622 |
refute |
|
14350 | 623 |
oops |
624 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
625 |
lemma "P (sum_rec l r x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
626 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
627 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
628 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
629 |
lemma "P (case x of Inl a \<Rightarrow> l a | Inr b \<Rightarrow> r b)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
630 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
631 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
632 |
|
23219 | 633 |
text {* Non-recursive datatypes *} |
14350 | 634 |
|
14455 | 635 |
datatype T1 = A | B |
14350 | 636 |
|
637 |
lemma "P (x::T1)" |
|
638 |
refute |
|
639 |
oops |
|
640 |
||
641 |
lemma "\<forall>x::T1. P x" |
|
642 |
refute |
|
643 |
oops |
|
644 |
||
14455 | 645 |
lemma "P A" |
14350 | 646 |
refute |
647 |
oops |
|
648 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
649 |
lemma "P (T1_rec a b x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
650 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
651 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
652 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
653 |
lemma "P (case x of A \<Rightarrow> a | B \<Rightarrow> b)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
654 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
655 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
656 |
|
14455 | 657 |
datatype 'a T2 = C T1 | D 'a |
658 |
||
659 |
lemma "P (x::'a T2)" |
|
14350 | 660 |
refute |
661 |
oops |
|
662 |
||
14455 | 663 |
lemma "\<forall>x::'a T2. P x" |
14350 | 664 |
refute |
665 |
oops |
|
666 |
||
14455 | 667 |
lemma "P D" |
14350 | 668 |
refute |
669 |
oops |
|
670 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
671 |
lemma "P (T2_rec c d x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
672 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
673 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
674 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
675 |
lemma "P (case x of C u \<Rightarrow> c u | D v \<Rightarrow> d v)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
676 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
677 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
678 |
|
14455 | 679 |
datatype ('a,'b) T3 = E "'a \<Rightarrow> 'b" |
680 |
||
14809 | 681 |
lemma "P (x::('a,'b) T3)" |
682 |
refute |
|
683 |
oops |
|
684 |
||
685 |
lemma "\<forall>x::('a,'b) T3. P x" |
|
686 |
refute |
|
687 |
oops |
|
688 |
||
14455 | 689 |
lemma "P E" |
690 |
refute |
|
14350 | 691 |
oops |
692 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
693 |
lemma "P (T3_rec e x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
694 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
695 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
696 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
697 |
lemma "P (case x of E f \<Rightarrow> e f)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
698 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
699 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
700 |
|
23219 | 701 |
text {* Recursive datatypes *} |
14350 | 702 |
|
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
703 |
text {* nat *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
704 |
|
14809 | 705 |
lemma "P (x::nat)" |
706 |
refute |
|
707 |
oops |
|
14350 | 708 |
|
14809 | 709 |
lemma "\<forall>x::nat. P x" |
710 |
refute |
|
14350 | 711 |
oops |
712 |
||
14809 | 713 |
lemma "P (Suc 0)" |
714 |
refute |
|
14350 | 715 |
oops |
716 |
||
14809 | 717 |
lemma "P Suc" |
718 |
refute -- {* @{term "Suc"} is a partial function (regardless of the size |
|
719 |
of the model), hence @{term "P Suc"} is undefined, hence no |
|
720 |
model will be found *} |
|
14350 | 721 |
oops |
722 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
723 |
lemma "P (nat_rec zero suc x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
724 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
725 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
726 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
727 |
lemma "P (case x of 0 \<Rightarrow> zero | Suc n \<Rightarrow> suc n)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
728 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
729 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
730 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
731 |
text {* 'a list *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
732 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
733 |
lemma "P (xs::'a list)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
734 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
735 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
736 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
737 |
lemma "\<forall>xs::'a list. P xs" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
738 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
739 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
740 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
741 |
lemma "P [x, y]" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
742 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
743 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
744 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
745 |
lemma "P (list_rec nil cons xs)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
746 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
747 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
748 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
749 |
lemma "P (case x of Nil \<Rightarrow> nil | Cons a b \<Rightarrow> cons a b)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
750 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
751 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
752 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
753 |
lemma "(xs::'a list) = ys" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
754 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
755 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
756 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
757 |
lemma "a # xs = b # xs" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
758 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
759 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
760 |
|
14350 | 761 |
datatype 'a BinTree = Leaf 'a | Node "'a BinTree" "'a BinTree" |
762 |
||
763 |
lemma "P (x::'a BinTree)" |
|
14809 | 764 |
refute |
14350 | 765 |
oops |
766 |
||
767 |
lemma "\<forall>x::'a BinTree. P x" |
|
14809 | 768 |
refute |
769 |
oops |
|
770 |
||
771 |
lemma "P (Node (Leaf x) (Leaf y))" |
|
772 |
refute |
|
14350 | 773 |
oops |
774 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
775 |
lemma "P (BinTree_rec l n x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
776 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
777 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
778 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
779 |
lemma "P (case x of Leaf a \<Rightarrow> l a | Node a b \<Rightarrow> n a b)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
780 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
781 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
782 |
|
23219 | 783 |
text {* Mutually recursive datatypes *} |
14350 | 784 |
|
785 |
datatype 'a aexp = Number 'a | ITE "'a bexp" "'a aexp" "'a aexp" |
|
786 |
and 'a bexp = Equal "'a aexp" "'a aexp" |
|
787 |
||
788 |
lemma "P (x::'a aexp)" |
|
14809 | 789 |
refute |
14350 | 790 |
oops |
791 |
||
792 |
lemma "\<forall>x::'a aexp. P x" |
|
14809 | 793 |
refute |
14350 | 794 |
oops |
795 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
796 |
lemma "P (ITE (Equal (Number x) (Number y)) (Number x) (Number y))" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
797 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
798 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
799 |
|
14350 | 800 |
lemma "P (x::'a bexp)" |
14809 | 801 |
refute |
14350 | 802 |
oops |
803 |
||
804 |
lemma "\<forall>x::'a bexp. P x" |
|
14809 | 805 |
refute |
14350 | 806 |
oops |
807 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
808 |
lemma "P (aexp_bexp_rec_1 number ite equal x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
809 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
810 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
811 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
812 |
lemma "P (case x of Number a \<Rightarrow> number a | ITE b a1 a2 \<Rightarrow> ite b a1 a2)" |
14809 | 813 |
refute |
14350 | 814 |
oops |
815 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
816 |
lemma "P (aexp_bexp_rec_2 number ite equal x)" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
817 |
refute |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
818 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
819 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
820 |
lemma "P (case x of Equal a1 a2 \<Rightarrow> equal a1 a2)" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
821 |
refute |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
822 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
823 |
|
23219 | 824 |
text {* Other datatype examples *} |
14350 | 825 |
|
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
826 |
datatype Trie = TR "Trie list" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
827 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
828 |
lemma "P (x::Trie)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
829 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
830 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
831 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
832 |
lemma "\<forall>x::Trie. P x" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
833 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
834 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
835 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
836 |
lemma "P (TR [TR []])" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
837 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
838 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
839 |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
840 |
lemma "P (Trie_rec_1 a b c x)" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
841 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
842 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
843 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
844 |
lemma "P (Trie_rec_2 a b c x)" |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
845 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
846 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
847 |
|
14809 | 848 |
datatype InfTree = Leaf | Node "nat \<Rightarrow> InfTree" |
14350 | 849 |
|
850 |
lemma "P (x::InfTree)" |
|
14809 | 851 |
refute |
14350 | 852 |
oops |
853 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
854 |
lemma "\<forall>x::InfTree. P x" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
855 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
856 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
857 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
858 |
lemma "P (Node (\<lambda>n. Leaf))" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
859 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
860 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
861 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
862 |
lemma "P (InfTree_rec leaf node x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
863 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
864 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
865 |
|
14350 | 866 |
datatype 'a lambda = Var 'a | App "'a lambda" "'a lambda" | Lam "'a \<Rightarrow> 'a lambda" |
867 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
868 |
lemma "P (x::'a lambda)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
869 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
870 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
871 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
872 |
lemma "\<forall>x::'a lambda. P x" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
873 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
874 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
875 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
876 |
lemma "P (Lam (\<lambda>a. Var a))" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
877 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
878 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
879 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
880 |
lemma "P (lambda_rec v a l x)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
881 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
882 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
883 |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
884 |
text {* Taken from "Inductive datatypes in HOL", p.8: *} |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
885 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
886 |
datatype ('a, 'b) T = C "'a \<Rightarrow> bool" | D "'b list" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
887 |
datatype 'c U = E "('c, 'c U) T" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
888 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
889 |
lemma "P (x::'c U)" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
890 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
891 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
892 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
893 |
lemma "\<forall>x::'c U. P x" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
894 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
895 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
896 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
897 |
lemma "P (E (C (\<lambda>a. True)))" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
898 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
899 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
900 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
901 |
lemma "P (U_rec_1 e f g h i x)" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
902 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
903 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
904 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
905 |
lemma "P (U_rec_2 e f g h i x)" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
906 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
907 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
908 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
909 |
lemma "P (U_rec_3 e f g h i x)" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
910 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
911 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
912 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
913 |
(******************************************************************************) |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
914 |
|
23219 | 915 |
subsubsection {* Records *} |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
916 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
917 |
(*TODO: make use of pair types, rather than typedef, for record types*) |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
918 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
919 |
record ('a, 'b) point = |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
920 |
xpos :: 'a |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
921 |
ypos :: 'b |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
922 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
923 |
lemma "(x::('a, 'b) point) = y" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
924 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
925 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
926 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
927 |
record ('a, 'b, 'c) extpoint = "('a, 'b) point" + |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
928 |
ext :: 'c |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
929 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
930 |
lemma "(x::('a, 'b, 'c) extpoint) = y" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
931 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
932 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
933 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
934 |
(******************************************************************************) |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
935 |
|
23219 | 936 |
subsubsection {* Inductively defined sets *} |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
937 |
|
23778 | 938 |
inductive_set arbitrarySet :: "'a set" |
939 |
where |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
940 |
"arbitrary : arbitrarySet" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
941 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
942 |
lemma "x : arbitrarySet" |
16050 | 943 |
refute |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
944 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
945 |
|
23778 | 946 |
inductive_set evenCard :: "'a set set" |
947 |
where |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
948 |
"{} : evenCard" |
23778 | 949 |
| "\<lbrakk> S : evenCard; x \<notin> S; y \<notin> S; x \<noteq> y \<rbrakk> \<Longrightarrow> S \<union> {x, y} : evenCard" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
950 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
951 |
lemma "S : evenCard" |
16050 | 952 |
refute |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
953 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
954 |
|
23778 | 955 |
inductive_set |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
956 |
even :: "nat set" |
23778 | 957 |
and odd :: "nat set" |
958 |
where |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
959 |
"0 : even" |
23778 | 960 |
| "n : even \<Longrightarrow> Suc n : odd" |
961 |
| "n : odd \<Longrightarrow> Suc n : even" |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
962 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
963 |
lemma "n : odd" |
16050 | 964 |
(*refute*) -- {* unfortunately, this little example already takes too long *} |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
965 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
966 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
967 |
(******************************************************************************) |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
968 |
|
23219 | 969 |
subsubsection {* Examples involving special functions *} |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
970 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
971 |
lemma "card x = 0" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
972 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
973 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
974 |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
975 |
lemma "finite x" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
976 |
refute -- {* no finite countermodel exists *} |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
977 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
978 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
979 |
lemma "(x::nat) + y = 0" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
980 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
981 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
982 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
983 |
lemma "(x::nat) = x + x" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
984 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
985 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
986 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
987 |
lemma "(x::nat) - y + y = x" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
988 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
989 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
990 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
991 |
lemma "(x::nat) = x * x" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
992 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
993 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
994 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
995 |
lemma "(x::nat) < x + y" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
996 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
997 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
998 |
|
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
999 |
lemma "xs @ [] = ys @ []" |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1000 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1001 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1002 |
|
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
1003 |
lemma "xs @ ys = ys @ xs" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1004 |
refute |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1005 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1006 |
|
16050 | 1007 |
lemma "f (lfp f) = lfp f" |
1008 |
refute |
|
1009 |
oops |
|
1010 |
||
1011 |
lemma "f (gfp f) = gfp f" |
|
1012 |
refute |
|
1013 |
oops |
|
1014 |
||
1015 |
lemma "lfp f = gfp f" |
|
1016 |
refute |
|
1017 |
oops |
|
1018 |
||
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1019 |
(******************************************************************************) |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1020 |
|
23219 | 1021 |
subsubsection {* Axiomatic type classes and overloading *} |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1022 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1023 |
text {* A type class without axioms: *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1024 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1025 |
axclass classA |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1026 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1027 |
lemma "P (x::'a::classA)" |
14809 | 1028 |
refute |
1029 |
oops |
|
1030 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
1031 |
text {* The axiom of this type class does not contain any type variables: *} |
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1032 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1033 |
axclass classB |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1034 |
classB_ax: "P | ~ P" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1035 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1036 |
lemma "P (x::'a::classB)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1037 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1038 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1039 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1040 |
text {* An axiom with a type variable (denoting types which have at least two elements): *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1041 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1042 |
axclass classC < type |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1043 |
classC_ax: "\<exists>x y. x \<noteq> y" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1044 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1045 |
lemma "P (x::'a::classC)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1046 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1047 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1048 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1049 |
lemma "\<exists>x y. (x::'a::classC) \<noteq> y" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1050 |
refute -- {* no countermodel exists *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1051 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1052 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1053 |
text {* A type class for which a constant is defined: *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1054 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1055 |
consts |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1056 |
classD_const :: "'a \<Rightarrow> 'a" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1057 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1058 |
axclass classD < type |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1059 |
classD_ax: "classD_const (classD_const x) = classD_const x" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1060 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1061 |
lemma "P (x::'a::classD)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1062 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1063 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1064 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1065 |
text {* A type class with multiple superclasses: *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1066 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1067 |
axclass classE < classC, classD |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1068 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1069 |
lemma "P (x::'a::classE)" |
14809 | 1070 |
refute |
1071 |
oops |
|
1072 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1073 |
lemma "P (x::'a::{classB, classE})" |
14809 | 1074 |
refute |
1075 |
oops |
|
1076 |
||
15547
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1077 |
text {* OFCLASS: *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1078 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1079 |
lemma "OFCLASS('a::type, type_class)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1080 |
refute -- {* no countermodel exists *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1081 |
apply intro_classes |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1082 |
done |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1083 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1084 |
lemma "OFCLASS('a::classC, type_class)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1085 |
refute -- {* no countermodel exists *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1086 |
apply intro_classes |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1087 |
done |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1088 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1089 |
lemma "OFCLASS('a, classB_class)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1090 |
refute -- {* no countermodel exists *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1091 |
apply intro_classes |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1092 |
apply simp |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1093 |
done |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1094 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1095 |
lemma "OFCLASS('a::type, classC_class)" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1096 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1097 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1098 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1099 |
text {* Overloading: *} |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1100 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1101 |
consts inverse :: "'a \<Rightarrow> 'a" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1102 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1103 |
defs (overloaded) |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1104 |
inverse_bool: "inverse (b::bool) == ~ b" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1105 |
inverse_set : "inverse (S::'a set) == -S" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1106 |
inverse_pair: "inverse p == (inverse (fst p), inverse (snd p))" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1107 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1108 |
lemma "inverse b" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1109 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1110 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1111 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1112 |
lemma "P (inverse (S::'a set))" |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1113 |
refute |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1114 |
oops |
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1115 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1116 |
lemma "P (inverse (p::'a\<times>'b))" |
14809 | 1117 |
refute |
14350 | 1118 |
oops |
1119 |
||
18774 | 1120 |
refute_params [satsolver="auto"] |
1121 |
||
14350 | 1122 |
end |