author | haftmann |
Tue, 23 Feb 2010 10:11:12 +0100 | |
changeset 35315 | fbdc860d87a3 |
parent 34120 | f9920a3ddf50 |
child 35416 | d8d7d1b785af |
permissions | -rw-r--r-- |
14350 | 1 |
(* Title: HOL/ex/Refute_Examples.thy |
2 |
Author: Tjark Weber |
|
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
3 |
Copyright 2003-2007 |
32968 | 4 |
|
5 |
See HOL/Refute.thy for help. |
|
14350 | 6 |
*) |
7 |
||
8 |
header {* Examples for the 'refute' command *} |
|
9 |
||
15297 | 10 |
theory Refute_Examples imports Main |
11 |
begin |
|
14350 | 12 |
|
18774 | 13 |
refute_params [satsolver="dpll"] |
14 |
||
14350 | 15 |
lemma "P \<and> Q" |
16 |
apply (rule conjI) |
|
17 |
refute 1 -- {* refutes @{term "P"} *} |
|
18 |
refute 2 -- {* refutes @{term "Q"} *} |
|
19 |
refute -- {* equivalent to 'refute 1' *} |
|
14455 | 20 |
-- {* here 'refute 3' would cause an exception, since we only have 2 subgoals *} |
14465 | 21 |
refute [maxsize=5] -- {* we can override parameters ... *} |
22 |
refute [satsolver="dpll"] 2 -- {* ... and specify a subgoal at the same time *} |
|
14350 | 23 |
oops |
24 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
25 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
26 |
|
23219 | 27 |
subsection {* Examples and Test Cases *} |
14350 | 28 |
|
23219 | 29 |
subsubsection {* Propositional logic *} |
14350 | 30 |
|
31 |
lemma "True" |
|
32 |
refute |
|
33 |
apply auto |
|
34 |
done |
|
35 |
||
36 |
lemma "False" |
|
37 |
refute |
|
38 |
oops |
|
39 |
||
40 |
lemma "P" |
|
41 |
refute |
|
42 |
oops |
|
43 |
||
44 |
lemma "~ P" |
|
45 |
refute |
|
46 |
oops |
|
47 |
||
48 |
lemma "P & Q" |
|
49 |
refute |
|
50 |
oops |
|
51 |
||
52 |
lemma "P | Q" |
|
53 |
refute |
|
54 |
oops |
|
55 |
||
56 |
lemma "P \<longrightarrow> Q" |
|
57 |
refute |
|
58 |
oops |
|
59 |
||
60 |
lemma "(P::bool) = Q" |
|
61 |
refute |
|
62 |
oops |
|
63 |
||
64 |
lemma "(P | Q) \<longrightarrow> (P & Q)" |
|
65 |
refute |
|
66 |
oops |
|
67 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
68 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
69 |
|
23219 | 70 |
subsubsection {* Predicate logic *} |
14350 | 71 |
|
14455 | 72 |
lemma "P x y z" |
14350 | 73 |
refute |
74 |
oops |
|
75 |
||
76 |
lemma "P x y \<longrightarrow> P y x" |
|
77 |
refute |
|
78 |
oops |
|
79 |
||
14455 | 80 |
lemma "P (f (f x)) \<longrightarrow> P x \<longrightarrow> P (f x)" |
81 |
refute |
|
82 |
oops |
|
83 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
84 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
85 |
|
23219 | 86 |
subsubsection {* Equality *} |
14350 | 87 |
|
88 |
lemma "P = True" |
|
89 |
refute |
|
90 |
oops |
|
91 |
||
92 |
lemma "P = False" |
|
93 |
refute |
|
94 |
oops |
|
95 |
||
96 |
lemma "x = y" |
|
97 |
refute |
|
98 |
oops |
|
99 |
||
100 |
lemma "f x = g x" |
|
101 |
refute |
|
102 |
oops |
|
103 |
||
104 |
lemma "(f::'a\<Rightarrow>'b) = g" |
|
105 |
refute |
|
106 |
oops |
|
107 |
||
108 |
lemma "(f::('d\<Rightarrow>'d)\<Rightarrow>('c\<Rightarrow>'d)) = g" |
|
109 |
refute |
|
110 |
oops |
|
111 |
||
112 |
lemma "distinct [a,b]" |
|
14809 | 113 |
refute |
14350 | 114 |
apply simp |
115 |
refute |
|
116 |
oops |
|
117 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
118 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
119 |
|
23219 | 120 |
subsubsection {* First-Order Logic *} |
14350 | 121 |
|
122 |
lemma "\<exists>x. P x" |
|
123 |
refute |
|
124 |
oops |
|
125 |
||
126 |
lemma "\<forall>x. P x" |
|
127 |
refute |
|
128 |
oops |
|
129 |
||
130 |
lemma "EX! x. P x" |
|
131 |
refute |
|
132 |
oops |
|
133 |
||
134 |
lemma "Ex P" |
|
135 |
refute |
|
136 |
oops |
|
137 |
||
138 |
lemma "All P" |
|
139 |
refute |
|
140 |
oops |
|
141 |
||
142 |
lemma "Ex1 P" |
|
143 |
refute |
|
144 |
oops |
|
145 |
||
146 |
lemma "(\<exists>x. P x) \<longrightarrow> (\<forall>x. P x)" |
|
147 |
refute |
|
148 |
oops |
|
149 |
||
150 |
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>y. \<forall>x. P x y)" |
|
151 |
refute |
|
152 |
oops |
|
153 |
||
154 |
lemma "(\<exists>x. P x) \<longrightarrow> (EX! x. P x)" |
|
155 |
refute |
|
156 |
oops |
|
157 |
||
158 |
text {* A true statement (also testing names of free and bound variables being identical) *} |
|
159 |
||
160 |
lemma "(\<forall>x y. P x y \<longrightarrow> P y x) \<longrightarrow> (\<forall>x. P x y) \<longrightarrow> P y x" |
|
18774 | 161 |
refute [maxsize=4] |
14350 | 162 |
apply fast |
163 |
done |
|
164 |
||
18789 | 165 |
text {* "A type has at most 4 elements." *} |
14350 | 166 |
|
18789 | 167 |
lemma "a=b | a=c | a=d | a=e | b=c | b=d | b=e | c=d | c=e | d=e" |
14455 | 168 |
refute |
169 |
oops |
|
170 |
||
18789 | 171 |
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 | 172 |
refute |
14350 | 173 |
oops |
174 |
||
175 |
text {* "Every reflexive and symmetric relation is transitive." *} |
|
176 |
||
177 |
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 | 178 |
refute |
14350 | 179 |
oops |
180 |
||
14465 | 181 |
text {* The "Drinker's theorem" ... *} |
14350 | 182 |
|
183 |
lemma "\<exists>x. f x = g x \<longrightarrow> f = g" |
|
14809 | 184 |
refute [maxsize=4] |
14350 | 185 |
apply (auto simp add: ext) |
186 |
done |
|
187 |
||
14465 | 188 |
text {* ... and an incorrect version of it *} |
14350 | 189 |
|
190 |
lemma "(\<exists>x. f x = g x) \<longrightarrow> f = g" |
|
191 |
refute |
|
192 |
oops |
|
193 |
||
194 |
text {* "Every function has a fixed point." *} |
|
195 |
||
196 |
lemma "\<exists>x. f x = x" |
|
197 |
refute |
|
198 |
oops |
|
199 |
||
200 |
text {* "Function composition is commutative." *} |
|
201 |
||
202 |
lemma "f (g x) = g (f x)" |
|
203 |
refute |
|
204 |
oops |
|
205 |
||
206 |
text {* "Two functions that are equivalent wrt.\ the same predicate 'P' are equal." *} |
|
207 |
||
208 |
lemma "((P::('a\<Rightarrow>'b)\<Rightarrow>bool) f = P g) \<longrightarrow> (f x = g x)" |
|
209 |
refute |
|
210 |
oops |
|
211 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
212 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
213 |
|
23219 | 214 |
subsubsection {* Higher-Order Logic *} |
14350 | 215 |
|
216 |
lemma "\<exists>P. P" |
|
217 |
refute |
|
218 |
apply auto |
|
219 |
done |
|
220 |
||
221 |
lemma "\<forall>P. P" |
|
222 |
refute |
|
223 |
oops |
|
224 |
||
225 |
lemma "EX! P. P" |
|
226 |
refute |
|
227 |
apply auto |
|
228 |
done |
|
229 |
||
230 |
lemma "EX! P. P x" |
|
231 |
refute |
|
232 |
oops |
|
233 |
||
234 |
lemma "P Q | Q x" |
|
235 |
refute |
|
236 |
oops |
|
237 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
238 |
lemma "x \<noteq> All" |
14455 | 239 |
refute |
240 |
oops |
|
241 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
242 |
lemma "x \<noteq> Ex" |
14455 | 243 |
refute |
244 |
oops |
|
245 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
246 |
lemma "x \<noteq> Ex1" |
14455 | 247 |
refute |
248 |
oops |
|
249 |
||
14350 | 250 |
text {* "The transitive closure 'T' of an arbitrary relation 'P' is non-empty." *} |
251 |
||
252 |
constdefs |
|
253 |
"trans" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" |
|
254 |
"trans P == (ALL x y z. P x y \<longrightarrow> P y z \<longrightarrow> P x z)" |
|
255 |
"subset" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" |
|
256 |
"subset P Q == (ALL x y. P x y \<longrightarrow> Q x y)" |
|
257 |
"trans_closure" :: "('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> ('a \<Rightarrow> 'a \<Rightarrow> bool) \<Rightarrow> bool" |
|
258 |
"trans_closure P Q == (subset Q P) & (trans P) & (ALL R. subset Q R \<longrightarrow> trans R \<longrightarrow> subset P R)" |
|
259 |
||
260 |
lemma "trans_closure T P \<longrightarrow> (\<exists>x y. T x y)" |
|
261 |
refute |
|
262 |
oops |
|
263 |
||
264 |
text {* "The union of transitive closures is equal to the transitive closure of unions." *} |
|
265 |
||
266 |
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) |
|
267 |
\<longrightarrow> trans_closure TP P |
|
268 |
\<longrightarrow> trans_closure TR R |
|
269 |
\<longrightarrow> (T x y = (TP x y | TR x y))" |
|
16910 | 270 |
refute |
14350 | 271 |
oops |
272 |
||
273 |
text {* "Every surjective function is invertible." *} |
|
274 |
||
275 |
lemma "(\<forall>y. \<exists>x. y = f x) \<longrightarrow> (\<exists>g. \<forall>x. g (f x) = x)" |
|
276 |
refute |
|
277 |
oops |
|
278 |
||
279 |
text {* "Every invertible function is surjective." *} |
|
280 |
||
281 |
lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)" |
|
282 |
refute |
|
283 |
oops |
|
284 |
||
285 |
text {* Every point is a fixed point of some function. *} |
|
286 |
||
287 |
lemma "\<exists>f. f x = x" |
|
14809 | 288 |
refute [maxsize=4] |
14350 | 289 |
apply (rule_tac x="\<lambda>x. x" in exI) |
290 |
apply simp |
|
291 |
done |
|
292 |
||
14465 | 293 |
text {* Axiom of Choice: first an incorrect version ... *} |
14350 | 294 |
|
295 |
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (EX!f. \<forall>x. P x (f x))" |
|
296 |
refute |
|
297 |
oops |
|
298 |
||
14465 | 299 |
text {* ... and now two correct ones *} |
14350 | 300 |
|
301 |
lemma "(\<forall>x. \<exists>y. P x y) \<longrightarrow> (\<exists>f. \<forall>x. P x (f x))" |
|
14809 | 302 |
refute [maxsize=4] |
14350 | 303 |
apply (simp add: choice) |
304 |
done |
|
305 |
||
306 |
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
|
307 |
refute [maxsize=2] |
14350 | 308 |
apply auto |
309 |
apply (simp add: ex1_implies_ex choice) |
|
310 |
apply (fast intro: ext) |
|
311 |
done |
|
312 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
313 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
314 |
|
23219 | 315 |
subsubsection {* Meta-logic *} |
14350 | 316 |
|
317 |
lemma "!!x. P x" |
|
318 |
refute |
|
319 |
oops |
|
320 |
||
321 |
lemma "f x == g x" |
|
322 |
refute |
|
323 |
oops |
|
324 |
||
325 |
lemma "P \<Longrightarrow> Q" |
|
326 |
refute |
|
327 |
oops |
|
328 |
||
329 |
lemma "\<lbrakk> P; Q; R \<rbrakk> \<Longrightarrow> S" |
|
330 |
refute |
|
331 |
oops |
|
332 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
333 |
lemma "(x == all) \<Longrightarrow> False" |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
334 |
refute |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
335 |
oops |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
336 |
|
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
337 |
lemma "(x == (op ==)) \<Longrightarrow> False" |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
338 |
refute |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
339 |
oops |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
340 |
|
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
341 |
lemma "(x == (op \<Longrightarrow>)) \<Longrightarrow> False" |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
342 |
refute |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
343 |
oops |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
344 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
345 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
346 |
|
23219 | 347 |
subsubsection {* Schematic variables *} |
14350 | 348 |
|
349 |
lemma "?P" |
|
350 |
refute |
|
351 |
apply auto |
|
352 |
done |
|
353 |
||
354 |
lemma "x = ?y" |
|
355 |
refute |
|
356 |
apply auto |
|
357 |
done |
|
358 |
||
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
359 |
(******************************************************************************) |
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
360 |
|
23219 | 361 |
subsubsection {* Abstractions *} |
14350 | 362 |
|
363 |
lemma "(\<lambda>x. x) = (\<lambda>x. y)" |
|
364 |
refute |
|
365 |
oops |
|
366 |
||
367 |
lemma "(\<lambda>f. f x) = (\<lambda>f. True)" |
|
368 |
refute |
|
369 |
oops |
|
370 |
||
371 |
lemma "(\<lambda>x. x) = (\<lambda>y. y)" |
|
372 |
refute |
|
373 |
apply simp |
|
374 |
done |
|
375 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
376 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
377 |
|
23219 | 378 |
subsubsection {* Sets *} |
14350 | 379 |
|
380 |
lemma "P (A::'a set)" |
|
381 |
refute |
|
382 |
oops |
|
383 |
||
384 |
lemma "P (A::'a set set)" |
|
385 |
refute |
|
386 |
oops |
|
387 |
||
388 |
lemma "{x. P x} = {y. P y}" |
|
14489 | 389 |
refute |
14350 | 390 |
apply simp |
391 |
done |
|
392 |
||
393 |
lemma "x : {x. P x}" |
|
394 |
refute |
|
395 |
oops |
|
396 |
||
14455 | 397 |
lemma "P op:" |
398 |
refute |
|
399 |
oops |
|
400 |
||
401 |
lemma "P (op: x)" |
|
402 |
refute |
|
403 |
oops |
|
404 |
||
405 |
lemma "P Collect" |
|
406 |
refute |
|
407 |
oops |
|
408 |
||
14350 | 409 |
lemma "A Un B = A Int B" |
410 |
refute |
|
411 |
oops |
|
412 |
||
413 |
lemma "(A Int B) Un C = (A Un C) Int B" |
|
414 |
refute |
|
415 |
oops |
|
416 |
||
417 |
lemma "Ball A P \<longrightarrow> Bex A P" |
|
14455 | 418 |
refute |
419 |
oops |
|
420 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
421 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
422 |
|
28524 | 423 |
subsubsection {* undefined *} |
14455 | 424 |
|
28524 | 425 |
lemma "undefined" |
14455 | 426 |
refute |
427 |
oops |
|
428 |
||
28524 | 429 |
lemma "P undefined" |
14455 | 430 |
refute |
431 |
oops |
|
432 |
||
28524 | 433 |
lemma "undefined x" |
14455 | 434 |
refute |
435 |
oops |
|
436 |
||
28524 | 437 |
lemma "undefined undefined" |
14455 | 438 |
refute |
439 |
oops |
|
440 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
441 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
442 |
|
23219 | 443 |
subsubsection {* The *} |
14455 | 444 |
|
445 |
lemma "The P" |
|
446 |
refute |
|
447 |
oops |
|
448 |
||
449 |
lemma "P The" |
|
14350 | 450 |
refute |
451 |
oops |
|
452 |
||
14455 | 453 |
lemma "P (The P)" |
454 |
refute |
|
455 |
oops |
|
456 |
||
457 |
lemma "(THE x. x=y) = z" |
|
458 |
refute |
|
459 |
oops |
|
460 |
||
461 |
lemma "Ex P \<longrightarrow> P (The P)" |
|
14489 | 462 |
refute |
14455 | 463 |
oops |
464 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
465 |
(*****************************************************************************) |
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
466 |
|
23219 | 467 |
subsubsection {* Eps *} |
14455 | 468 |
|
469 |
lemma "Eps P" |
|
470 |
refute |
|
471 |
oops |
|
472 |
||
473 |
lemma "P Eps" |
|
474 |
refute |
|
475 |
oops |
|
476 |
||
477 |
lemma "P (Eps P)" |
|
478 |
refute |
|
479 |
oops |
|
480 |
||
481 |
lemma "(SOME x. x=y) = z" |
|
482 |
refute |
|
483 |
oops |
|
484 |
||
485 |
lemma "Ex P \<longrightarrow> P (Eps P)" |
|
14489 | 486 |
refute [maxsize=3] |
14455 | 487 |
apply (auto simp add: someI) |
488 |
done |
|
489 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
490 |
(*****************************************************************************) |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
491 |
|
23219 | 492 |
subsubsection {* Subtypes (typedef), typedecl *} |
14809 | 493 |
|
15161 | 494 |
text {* A completely unspecified non-empty subset of @{typ "'a"}: *} |
495 |
||
28524 | 496 |
typedef 'a myTdef = "insert (undefined::'a) (undefined::'a set)" |
14809 | 497 |
by auto |
498 |
||
499 |
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
|
500 |
refute |
14809 | 501 |
oops |
502 |
||
503 |
typedecl myTdecl |
|
504 |
||
505 |
typedef 'a T_bij = "{(f::'a\<Rightarrow>'a). \<forall>y. \<exists>!x. f x = y}" |
|
506 |
by auto |
|
507 |
||
508 |
lemma "P (f::(myTdecl myTdef) T_bij)" |
|
509 |
refute |
|
510 |
oops |
|
511 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
512 |
(*****************************************************************************) |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
513 |
|
23219 | 514 |
subsubsection {* Inductive datatypes *} |
14350 | 515 |
|
21502 | 516 |
text {* With @{text quick_and_dirty} set, the datatype package does |
517 |
not generate certain axioms for recursion operators. Without these |
|
518 |
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
|
519 |
|
23219 | 520 |
text {* unit *} |
14350 | 521 |
|
522 |
lemma "P (x::unit)" |
|
523 |
refute |
|
524 |
oops |
|
525 |
||
526 |
lemma "\<forall>x::unit. P x" |
|
527 |
refute |
|
528 |
oops |
|
529 |
||
530 |
lemma "P ()" |
|
531 |
refute |
|
532 |
oops |
|
533 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
534 |
lemma "unit_rec u x = u" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
535 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
536 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
537 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
538 |
|
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
|
539 |
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
|
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 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
543 |
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
|
544 |
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
|
545 |
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
|
546 |
|
23219 | 547 |
text {* option *} |
14455 | 548 |
|
549 |
lemma "P (x::'a option)" |
|
550 |
refute |
|
551 |
oops |
|
552 |
||
553 |
lemma "\<forall>x::'a option. P x" |
|
554 |
refute |
|
555 |
oops |
|
556 |
||
14809 | 557 |
lemma "P None" |
558 |
refute |
|
559 |
oops |
|
560 |
||
14455 | 561 |
lemma "P (Some x)" |
562 |
refute |
|
563 |
oops |
|
564 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
565 |
lemma "option_rec n s None = n" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
566 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
567 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
568 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
569 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
570 |
lemma "option_rec n s (Some x) = s x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
571 |
refute [maxsize=4] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
572 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
573 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
574 |
|
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
|
575 |
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
|
576 |
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
|
577 |
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
|
578 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
579 |
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
|
580 |
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
|
581 |
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
|
582 |
|
23219 | 583 |
text {* * *} |
14350 | 584 |
|
585 |
lemma "P (x::'a*'b)" |
|
14455 | 586 |
refute |
14350 | 587 |
oops |
588 |
||
589 |
lemma "\<forall>x::'a*'b. P x" |
|
14455 | 590 |
refute |
14350 | 591 |
oops |
592 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
593 |
lemma "P (x, y)" |
14455 | 594 |
refute |
14350 | 595 |
oops |
596 |
||
597 |
lemma "P (fst x)" |
|
14455 | 598 |
refute |
14350 | 599 |
oops |
600 |
||
601 |
lemma "P (snd x)" |
|
14455 | 602 |
refute |
603 |
oops |
|
604 |
||
605 |
lemma "P Pair" |
|
606 |
refute |
|
14350 | 607 |
oops |
608 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
609 |
lemma "prod_rec p (a, b) = p a b" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
610 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
611 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
612 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
613 |
|
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
|
614 |
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
|
615 |
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
|
616 |
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
|
617 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
618 |
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
|
619 |
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
|
620 |
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
|
621 |
|
23219 | 622 |
text {* + *} |
14350 | 623 |
|
624 |
lemma "P (x::'a+'b)" |
|
14455 | 625 |
refute |
14350 | 626 |
oops |
627 |
||
628 |
lemma "\<forall>x::'a+'b. P x" |
|
14455 | 629 |
refute |
14350 | 630 |
oops |
631 |
||
632 |
lemma "P (Inl x)" |
|
14455 | 633 |
refute |
14350 | 634 |
oops |
635 |
||
636 |
lemma "P (Inr x)" |
|
14455 | 637 |
refute |
638 |
oops |
|
639 |
||
640 |
lemma "P Inl" |
|
641 |
refute |
|
14350 | 642 |
oops |
643 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
644 |
lemma "sum_rec l r (Inl x) = l x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
645 |
refute [maxsize=3] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
646 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
647 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
648 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
649 |
lemma "sum_rec l r (Inr x) = r x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
650 |
refute [maxsize=3] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
651 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
652 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
653 |
|
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
|
654 |
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
|
655 |
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
|
656 |
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
|
657 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
658 |
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
|
659 |
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
|
660 |
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
|
661 |
|
23219 | 662 |
text {* Non-recursive datatypes *} |
14350 | 663 |
|
14455 | 664 |
datatype T1 = A | B |
14350 | 665 |
|
666 |
lemma "P (x::T1)" |
|
667 |
refute |
|
668 |
oops |
|
669 |
||
670 |
lemma "\<forall>x::T1. P x" |
|
671 |
refute |
|
672 |
oops |
|
673 |
||
14455 | 674 |
lemma "P A" |
14350 | 675 |
refute |
676 |
oops |
|
677 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
678 |
lemma "P B" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
679 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
680 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
681 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
682 |
lemma "T1_rec a b A = a" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
683 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
684 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
685 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
686 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
687 |
lemma "T1_rec a b B = b" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
688 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
689 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
690 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
691 |
|
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
|
692 |
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
|
693 |
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
|
694 |
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
|
695 |
|
f08e2d83681e
major code change: 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 |
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
|
697 |
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
|
698 |
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
|
699 |
|
14455 | 700 |
datatype 'a T2 = C T1 | D 'a |
701 |
||
702 |
lemma "P (x::'a T2)" |
|
14350 | 703 |
refute |
704 |
oops |
|
705 |
||
14455 | 706 |
lemma "\<forall>x::'a T2. P x" |
14350 | 707 |
refute |
708 |
oops |
|
709 |
||
14455 | 710 |
lemma "P D" |
14350 | 711 |
refute |
712 |
oops |
|
713 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
714 |
lemma "T2_rec c d (C x) = c x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
715 |
refute [maxsize=4] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
716 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
717 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
718 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
719 |
lemma "T2_rec c d (D x) = d x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
720 |
refute [maxsize=4] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
721 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
722 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
723 |
|
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
|
724 |
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
|
725 |
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
|
726 |
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
|
727 |
|
f08e2d83681e
major code change: 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 |
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
|
729 |
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
|
730 |
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
|
731 |
|
14455 | 732 |
datatype ('a,'b) T3 = E "'a \<Rightarrow> 'b" |
733 |
||
14809 | 734 |
lemma "P (x::('a,'b) T3)" |
735 |
refute |
|
736 |
oops |
|
737 |
||
738 |
lemma "\<forall>x::('a,'b) T3. P x" |
|
739 |
refute |
|
740 |
oops |
|
741 |
||
14455 | 742 |
lemma "P E" |
743 |
refute |
|
14350 | 744 |
oops |
745 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
746 |
lemma "T3_rec e (E x) = e x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
747 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
748 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
749 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
750 |
|
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
|
751 |
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
|
752 |
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
|
753 |
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
|
754 |
|
f08e2d83681e
major code change: 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 |
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
|
756 |
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
|
757 |
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
|
758 |
|
23219 | 759 |
text {* Recursive datatypes *} |
14350 | 760 |
|
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
|
761 |
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
|
762 |
|
14809 | 763 |
lemma "P (x::nat)" |
764 |
refute |
|
765 |
oops |
|
14350 | 766 |
|
14809 | 767 |
lemma "\<forall>x::nat. P x" |
768 |
refute |
|
14350 | 769 |
oops |
770 |
||
14809 | 771 |
lemma "P (Suc 0)" |
772 |
refute |
|
14350 | 773 |
oops |
774 |
||
14809 | 775 |
lemma "P Suc" |
776 |
refute -- {* @{term "Suc"} is a partial function (regardless of the size |
|
777 |
of the model), hence @{term "P Suc"} is undefined, hence no |
|
778 |
model will be found *} |
|
14350 | 779 |
oops |
780 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
781 |
lemma "nat_rec zero suc 0 = zero" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
782 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
783 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
784 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
785 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
786 |
lemma "nat_rec zero suc (Suc x) = suc x (nat_rec zero suc x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
787 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
788 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
789 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
790 |
|
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
|
791 |
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
|
792 |
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
|
793 |
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
|
794 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
795 |
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
|
796 |
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
|
797 |
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
|
798 |
|
f08e2d83681e
major code change: 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 |
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
|
800 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
801 |
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
|
802 |
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
|
803 |
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
|
804 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
805 |
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
|
806 |
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
|
807 |
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
|
808 |
|
f08e2d83681e
major code change: 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 |
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
|
810 |
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
|
811 |
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
|
812 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
813 |
lemma "list_rec nil cons [] = nil" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
814 |
refute [maxsize=3] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
815 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
816 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
817 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
818 |
lemma "list_rec nil cons (x#xs) = cons x xs (list_rec nil cons xs)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
819 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
820 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
821 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
822 |
|
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
|
823 |
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
|
824 |
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
|
825 |
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
|
826 |
|
f08e2d83681e
major code change: 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 |
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
|
828 |
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
|
829 |
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
|
830 |
|
f08e2d83681e
major code change: 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 |
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
|
832 |
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
|
833 |
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
|
834 |
|
f08e2d83681e
major code change: 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 |
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
|
836 |
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
|
837 |
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
|
838 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
839 |
datatype BitList = BitListNil | Bit0 BitList | Bit1 BitList |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
840 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
841 |
lemma "P (x::BitList)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
842 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
843 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
844 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
845 |
lemma "\<forall>x::BitList. P x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
846 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
847 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
848 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
849 |
lemma "P (Bit0 (Bit1 BitListNil))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
850 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
851 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
852 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
853 |
lemma "BitList_rec nil bit0 bit1 BitListNil = nil" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
854 |
refute [maxsize=4] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
855 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
856 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
857 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
858 |
lemma "BitList_rec nil bit0 bit1 (Bit0 xs) = bit0 xs (BitList_rec nil bit0 bit1 xs)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
859 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
860 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
861 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
862 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
863 |
lemma "BitList_rec nil bit0 bit1 (Bit1 xs) = bit1 xs (BitList_rec nil bit0 bit1 xs)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
864 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
865 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
866 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
867 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
868 |
lemma "P (BitList_rec nil bit0 bit1 x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
869 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
870 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
871 |
|
14350 | 872 |
datatype 'a BinTree = Leaf 'a | Node "'a BinTree" "'a BinTree" |
873 |
||
874 |
lemma "P (x::'a BinTree)" |
|
14809 | 875 |
refute |
14350 | 876 |
oops |
877 |
||
878 |
lemma "\<forall>x::'a BinTree. P x" |
|
14809 | 879 |
refute |
880 |
oops |
|
881 |
||
882 |
lemma "P (Node (Leaf x) (Leaf y))" |
|
883 |
refute |
|
14350 | 884 |
oops |
885 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
886 |
lemma "BinTree_rec l n (Leaf x) = l x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
887 |
refute [maxsize=1] (* The "maxsize=1" tests are a bit pointless: for some formulae |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
888 |
below, refute will find no countermodel simply because this |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
889 |
size makes involved terms undefined. Unfortunately, any |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
890 |
larger size already takes too long. *) |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
891 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
892 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
893 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
894 |
lemma "BinTree_rec l n (Node x y) = n x y (BinTree_rec l n x) (BinTree_rec l n y)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
895 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
896 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
897 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
898 |
|
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
|
899 |
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
|
900 |
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
|
901 |
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
|
902 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
903 |
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
|
904 |
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
|
905 |
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
|
906 |
|
23219 | 907 |
text {* Mutually recursive datatypes *} |
14350 | 908 |
|
909 |
datatype 'a aexp = Number 'a | ITE "'a bexp" "'a aexp" "'a aexp" |
|
910 |
and 'a bexp = Equal "'a aexp" "'a aexp" |
|
911 |
||
912 |
lemma "P (x::'a aexp)" |
|
14809 | 913 |
refute |
14350 | 914 |
oops |
915 |
||
916 |
lemma "\<forall>x::'a aexp. P x" |
|
14809 | 917 |
refute |
14350 | 918 |
oops |
919 |
||
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
|
920 |
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
|
921 |
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
|
922 |
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
|
923 |
|
14350 | 924 |
lemma "P (x::'a bexp)" |
14809 | 925 |
refute |
14350 | 926 |
oops |
927 |
||
928 |
lemma "\<forall>x::'a bexp. P x" |
|
14809 | 929 |
refute |
14350 | 930 |
oops |
931 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
932 |
lemma "aexp_bexp_rec_1 number ite equal (Number x) = number x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
933 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
934 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
935 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
936 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
937 |
lemma "aexp_bexp_rec_1 number ite equal (ITE x y z) = ite x y z (aexp_bexp_rec_2 number ite equal x) (aexp_bexp_rec_1 number ite equal y) (aexp_bexp_rec_1 number ite equal z)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
938 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
939 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
940 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
941 |
|
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
|
942 |
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
|
943 |
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
|
944 |
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
|
945 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
946 |
lemma "P (case x of Number a \<Rightarrow> number a | ITE b a1 a2 \<Rightarrow> ite b a1 a2)" |
14809 | 947 |
refute |
14350 | 948 |
oops |
949 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
950 |
lemma "aexp_bexp_rec_2 number ite equal (Equal x y) = equal x y (aexp_bexp_rec_1 number ite equal x) (aexp_bexp_rec_1 number ite equal y)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
951 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
952 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
953 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
954 |
|
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
|
955 |
lemma "P (aexp_bexp_rec_2 number ite equal x)" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
956 |
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
|
957 |
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
|
958 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
959 |
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
|
960 |
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
|
961 |
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
|
962 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
963 |
datatype X = A | B X | C Y |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
964 |
and Y = D X | E Y | F |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
965 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
966 |
lemma "P (x::X)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
967 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
968 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
969 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
970 |
lemma "P (y::Y)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
971 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
972 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
973 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
974 |
lemma "P (B (B A))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
975 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
976 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
977 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
978 |
lemma "P (B (C F))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
979 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
980 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
981 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
982 |
lemma "P (C (D A))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
983 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
984 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
985 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
986 |
lemma "P (C (E F))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
987 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
988 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
989 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
990 |
lemma "P (D (B A))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
991 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
992 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
993 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
994 |
lemma "P (D (C F))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
995 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
996 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
997 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
998 |
lemma "P (E (D A))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
999 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1000 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1001 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1002 |
lemma "P (E (E F))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1003 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1004 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1005 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1006 |
lemma "P (C (D (C F)))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1007 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1008 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1009 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1010 |
lemma "X_Y_rec_1 a b c d e f A = a" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1011 |
refute [maxsize=3] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1012 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1013 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1014 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1015 |
lemma "X_Y_rec_1 a b c d e f (B x) = b x (X_Y_rec_1 a b c d e f x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1016 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1017 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1018 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1019 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1020 |
lemma "X_Y_rec_1 a b c d e f (C y) = c y (X_Y_rec_2 a b c d e f y)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1021 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1022 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1023 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1024 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1025 |
lemma "X_Y_rec_2 a b c d e f (D x) = d x (X_Y_rec_1 a b c d e f x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1026 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1027 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1028 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1029 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1030 |
lemma "X_Y_rec_2 a b c d e f (E y) = e y (X_Y_rec_2 a b c d e f y)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1031 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1032 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1033 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1034 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1035 |
lemma "X_Y_rec_2 a b c d e f F = f" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1036 |
refute [maxsize=3] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1037 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1038 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1039 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1040 |
lemma "P (X_Y_rec_1 a b c d e f x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1041 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1042 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1043 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1044 |
lemma "P (X_Y_rec_2 a b c d e f y)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1045 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1046 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1047 |
|
23219 | 1048 |
text {* Other datatype examples *} |
14350 | 1049 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1050 |
text {* Indirect recursion is implemented via mutual recursion. *} |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1051 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1052 |
datatype XOpt = CX "XOpt option" | DX "bool \<Rightarrow> XOpt option" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1053 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1054 |
lemma "P (x::XOpt)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1055 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1056 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1057 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1058 |
lemma "P (CX None)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1059 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1060 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1061 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1062 |
lemma "P (CX (Some (CX None)))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1063 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1064 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1065 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1066 |
lemma "XOpt_rec_1 cx dx n1 s1 n2 s2 (CX x) = cx x (XOpt_rec_2 cx dx n1 s1 n2 s2 x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1067 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1068 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1069 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1070 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1071 |
lemma "XOpt_rec_1 cx dx n1 s1 n2 s2 (DX x) = dx x (\<lambda>b. XOpt_rec_3 cx dx n1 s1 n2 s2 (x b))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1072 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1073 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1074 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1075 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1076 |
lemma "XOpt_rec_2 cx dx n1 s1 n2 s2 None = n1" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1077 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1078 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1079 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1080 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1081 |
lemma "XOpt_rec_2 cx dx n1 s1 n2 s2 (Some x) = s1 x (XOpt_rec_1 cx dx n1 s1 n2 s2 x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1082 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1083 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1084 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1085 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1086 |
lemma "XOpt_rec_3 cx dx n1 s1 n2 s2 None = n2" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1087 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1088 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1089 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1090 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1091 |
lemma "XOpt_rec_3 cx dx n1 s1 n2 s2 (Some x) = s2 x (XOpt_rec_1 cx dx n1 s1 n2 s2 x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1092 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1093 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1094 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1095 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1096 |
lemma "P (XOpt_rec_1 cx dx n1 s1 n2 s2 x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1097 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1098 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1099 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1100 |
lemma "P (XOpt_rec_2 cx dx n1 s1 n2 s2 x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1101 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1102 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1103 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1104 |
lemma "P (XOpt_rec_3 cx dx n1 s1 n2 s2 x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1105 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1106 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1107 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1108 |
datatype 'a YOpt = CY "('a \<Rightarrow> 'a YOpt) option" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1109 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1110 |
lemma "P (x::'a YOpt)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1111 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1112 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1113 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1114 |
lemma "P (CY None)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1115 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1116 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1117 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1118 |
lemma "P (CY (Some (\<lambda>a. CY None)))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1119 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1120 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1121 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1122 |
lemma "YOpt_rec_1 cy n s (CY x) = cy x (YOpt_rec_2 cy n s x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1123 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1124 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1125 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1126 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1127 |
lemma "YOpt_rec_2 cy n s None = n" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1128 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1129 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1130 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1131 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1132 |
lemma "YOpt_rec_2 cy n s (Some x) = s x (\<lambda>a. YOpt_rec_1 cy n s (x a))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1133 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1134 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1135 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1136 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1137 |
lemma "P (YOpt_rec_1 cy n s x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1138 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1139 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1140 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1141 |
lemma "P (YOpt_rec_2 cy n s x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1142 |
refute |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1143 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1144 |
|
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
|
1145 |
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
|
1146 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1147 |
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
|
1148 |
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
|
1149 |
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
|
1150 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1151 |
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
|
1152 |
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
|
1153 |
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
|
1154 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1155 |
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
|
1156 |
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
|
1157 |
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
|
1158 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1159 |
lemma "Trie_rec_1 tr nil cons (TR x) = tr x (Trie_rec_2 tr nil cons x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1160 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1161 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1162 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1163 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1164 |
lemma "Trie_rec_2 tr nil cons [] = nil" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1165 |
refute [maxsize=3] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1166 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1167 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1168 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1169 |
lemma "Trie_rec_2 tr nil cons (x#xs) = cons x xs (Trie_rec_1 tr nil cons x) (Trie_rec_2 tr nil cons xs)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1170 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1171 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1172 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1173 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1174 |
lemma "P (Trie_rec_1 tr nil cons x)" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1175 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1176 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1177 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1178 |
lemma "P (Trie_rec_2 tr nil cons 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
|
1179 |
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
|
1180 |
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
|
1181 |
|
14809 | 1182 |
datatype InfTree = Leaf | Node "nat \<Rightarrow> InfTree" |
14350 | 1183 |
|
1184 |
lemma "P (x::InfTree)" |
|
14809 | 1185 |
refute |
14350 | 1186 |
oops |
1187 |
||
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
|
1188 |
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
|
1189 |
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
|
1190 |
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
|
1191 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1192 |
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
|
1193 |
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
|
1194 |
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
|
1195 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1196 |
lemma "InfTree_rec leaf node Leaf = leaf" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1197 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1198 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1199 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1200 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1201 |
lemma "InfTree_rec leaf node (Node x) = node x (\<lambda>n. InfTree_rec leaf node (x n))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1202 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1203 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1204 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1205 |
|
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
|
1206 |
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
|
1207 |
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
|
1208 |
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
|
1209 |
|
14350 | 1210 |
datatype 'a lambda = Var 'a | App "'a lambda" "'a lambda" | Lam "'a \<Rightarrow> 'a lambda" |
1211 |
||
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
|
1212 |
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
|
1213 |
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
|
1214 |
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
|
1215 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1216 |
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
|
1217 |
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
|
1218 |
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
|
1219 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1220 |
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
|
1221 |
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
|
1222 |
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
|
1223 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1224 |
lemma "lambda_rec var app lam (Var x) = var x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1225 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1226 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1227 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1228 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1229 |
lemma "lambda_rec var app lam (App x y) = app x y (lambda_rec var app lam x) (lambda_rec var app lam y)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1230 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1231 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1232 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1233 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1234 |
lemma "lambda_rec var app lam (Lam x) = lam x (\<lambda>a. lambda_rec var app lam (x a))" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1235 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1236 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1237 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1238 |
|
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
|
1239 |
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
|
1240 |
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
|
1241 |
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
|
1242 |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1243 |
text {* Taken from "Inductive datatypes in HOL", p.8: *} |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1244 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1245 |
datatype ('a, 'b) T = C "'a \<Rightarrow> bool" | D "'b list" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1246 |
datatype 'c U = E "('c, 'c U) T" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1247 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1248 |
lemma "P (x::'c U)" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1249 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1250 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1251 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1252 |
lemma "\<forall>x::'c U. P x" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1253 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1254 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1255 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1256 |
lemma "P (E (C (\<lambda>a. True)))" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1257 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1258 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1259 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1260 |
lemma "U_rec_1 e c d nil cons (E x) = e x (U_rec_2 e c d nil cons x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1261 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1262 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1263 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1264 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1265 |
lemma "U_rec_2 e c d nil cons (C x) = c x" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1266 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1267 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1268 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1269 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1270 |
lemma "U_rec_2 e c d nil cons (D x) = d x (U_rec_3 e c d nil cons x)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1271 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1272 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1273 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1274 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1275 |
lemma "U_rec_3 e c d nil cons [] = nil" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1276 |
refute [maxsize=2] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1277 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1278 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1279 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1280 |
lemma "U_rec_3 e c d nil cons (x#xs) = cons x xs (U_rec_1 e c d nil cons x) (U_rec_3 e c d nil cons xs)" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1281 |
refute [maxsize=1] |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1282 |
apply simp |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1283 |
done |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1284 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1285 |
lemma "P (U_rec_1 e c d nil cons x)" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1286 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1287 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1288 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1289 |
lemma "P (U_rec_2 e c d nil cons x)" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1290 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1291 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1292 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1293 |
lemma "P (U_rec_3 e c d nil cons x)" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1294 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1295 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1296 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1297 |
(*****************************************************************************) |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1298 |
|
23219 | 1299 |
subsubsection {* Records *} |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1300 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1301 |
(*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
|
1302 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1303 |
record ('a, 'b) point = |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1304 |
xpos :: 'a |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1305 |
ypos :: 'b |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1306 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1307 |
lemma "(x::('a, 'b) point) = y" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1308 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1309 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1310 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1311 |
record ('a, 'b, 'c) extpoint = "('a, 'b) point" + |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1312 |
ext :: 'c |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1313 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1314 |
lemma "(x::('a, 'b, 'c) extpoint) = y" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1315 |
refute |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1316 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1317 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1318 |
(*****************************************************************************) |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1319 |
|
23219 | 1320 |
subsubsection {* Inductively defined sets *} |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1321 |
|
23778 | 1322 |
inductive_set arbitrarySet :: "'a set" |
1323 |
where |
|
28524 | 1324 |
"undefined : arbitrarySet" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1325 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1326 |
lemma "x : arbitrarySet" |
16050 | 1327 |
refute |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1328 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1329 |
|
23778 | 1330 |
inductive_set evenCard :: "'a set set" |
1331 |
where |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1332 |
"{} : evenCard" |
23778 | 1333 |
| "\<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
|
1334 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1335 |
lemma "S : evenCard" |
16050 | 1336 |
refute |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1337 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1338 |
|
23778 | 1339 |
inductive_set |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1340 |
even :: "nat set" |
23778 | 1341 |
and odd :: "nat set" |
1342 |
where |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1343 |
"0 : even" |
23778 | 1344 |
| "n : even \<Longrightarrow> Suc n : odd" |
1345 |
| "n : odd \<Longrightarrow> Suc n : even" |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1346 |
|
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1347 |
lemma "n : odd" |
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1348 |
(*refute*) (* TODO: there seems to be an issue here with undefined terms |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1349 |
because of the recursive datatype "nat" *) |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1350 |
oops |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1351 |
|
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1352 |
consts f :: "'a \<Rightarrow> 'a" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1353 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1354 |
inductive_set |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1355 |
a_even :: "'a set" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1356 |
and a_odd :: "'a set" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1357 |
where |
28524 | 1358 |
"undefined : a_even" |
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1359 |
| "x : a_even \<Longrightarrow> f x : a_odd" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1360 |
| "x : a_odd \<Longrightarrow> f x : a_even" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1361 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1362 |
lemma "x : a_odd" |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1363 |
refute -- {* finds a model of size 2, as expected *} |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1364 |
oops |
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1365 |
|
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1366 |
(*****************************************************************************) |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1367 |
|
23219 | 1368 |
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
|
1369 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1370 |
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
|
1371 |
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
|
1372 |
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
|
1373 |
|
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1374 |
lemma "finite x" |
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1375 |
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
|
1376 |
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
|
1377 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1378 |
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
|
1379 |
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
|
1380 |
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
|
1381 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1382 |
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
|
1383 |
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
|
1384 |
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
|
1385 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1386 |
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
|
1387 |
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
|
1388 |
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
|
1389 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1390 |
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
|
1391 |
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
|
1392 |
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
|
1393 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1394 |
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
|
1395 |
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
|
1396 |
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
|
1397 |
|
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
1398 |
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
|
1399 |
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
|
1400 |
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
|
1401 |
|
21985
acfb13e8819e
constants are unfolded, universal quantifiers are stripped, some minor changes
webertj
parents:
21559
diff
changeset
|
1402 |
lemma "xs @ ys = ys @ xs" |
15767
8ed9fcc004fe
support for recursion over mutually recursive IDTs
webertj
parents:
15547
diff
changeset
|
1403 |
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
|
1404 |
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
|
1405 |
|
16050 | 1406 |
lemma "f (lfp f) = lfp f" |
1407 |
refute |
|
1408 |
oops |
|
1409 |
||
1410 |
lemma "f (gfp f) = gfp f" |
|
1411 |
refute |
|
1412 |
oops |
|
1413 |
||
1414 |
lemma "lfp f = gfp f" |
|
1415 |
refute |
|
1416 |
oops |
|
1417 |
||
25014
b711b0af178e
significant code overhaul, bugfix for inductive data types
webertj
parents:
24447
diff
changeset
|
1418 |
(*****************************************************************************) |
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
|
1419 |
|
35315 | 1420 |
subsubsection {* 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
|
1421 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1422 |
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
|
1423 |
|
35315 | 1424 |
class classA |
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
|
1425 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1426 |
lemma "P (x::'a::classA)" |
14809 | 1427 |
refute |
1428 |
oops |
|
1429 |
||
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
|
1430 |
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
|
1431 |
|
35315 | 1432 |
class classC = |
1433 |
assumes classC_ax: "\<exists>x y. x \<noteq> 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
|
1434 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1435 |
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
|
1436 |
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
|
1437 |
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
|
1438 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1439 |
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
|
1440 |
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
|
1441 |
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
|
1442 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1443 |
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
|
1444 |
|
35315 | 1445 |
class classD = |
1446 |
fixes classD_const :: "'a \<Rightarrow> 'a" |
|
1447 |
assumes classD_ax: "classD_const (classD_const x) = classD_const 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
|
1448 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1449 |
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
|
1450 |
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
|
1451 |
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
|
1452 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1453 |
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
|
1454 |
|
35315 | 1455 |
class classE = classC + classD |
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
|
1456 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1457 |
lemma "P (x::'a::classE)" |
14809 | 1458 |
refute |
1459 |
oops |
|
1460 |
||
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
|
1461 |
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
|
1462 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1463 |
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
|
1464 |
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
|
1465 |
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
|
1466 |
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
|
1467 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1468 |
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
|
1469 |
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
|
1470 |
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
|
1471 |
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
|
1472 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1473 |
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
|
1474 |
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
|
1475 |
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
|
1476 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1477 |
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
|
1478 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1479 |
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
|
1480 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1481 |
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
|
1482 |
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
|
1483 |
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
|
1484 |
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
|
1485 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1486 |
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
|
1487 |
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
|
1488 |
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
|
1489 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1490 |
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
|
1491 |
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
|
1492 |
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
|
1493 |
|
f08e2d83681e
major code change: refute can now handle recursion and axiomatic type classes; 3-valued logic with two kinds of equality; some bugfixes
webertj
parents:
15297
diff
changeset
|
1494 |
lemma "P (inverse (p::'a\<times>'b))" |
14809 | 1495 |
refute |
14350 | 1496 |
oops |
1497 |
||
34120
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1498 |
text {* Structured proofs *} |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1499 |
|
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1500 |
lemma "x = y" |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1501 |
proof cases |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1502 |
assume "x = y" |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1503 |
show ?thesis |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1504 |
refute |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1505 |
refute [no_assms] |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1506 |
refute [no_assms = false] |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1507 |
oops |
f9920a3ddf50
added "no_assms" option to Refute, and include structured proof assumptions by default;
blanchet
parents:
32968
diff
changeset
|
1508 |
|
18774 | 1509 |
refute_params [satsolver="auto"] |
1510 |
||
14350 | 1511 |
end |