author | wenzelm |
Fri, 13 May 2011 23:58:40 +0200 | |
changeset 42795 | 66fcc9882784 |
parent 42413 | 252ed2fc384d |
child 42959 | ee829022381d |
permissions | -rw-r--r-- |
33197 | 1 |
(* Title: HOL/Nitpick_Examples/Core_Nits.thy |
2 |
Author: Jasmin Blanchette, TU Muenchen |
|
35076
cc19e2aef17e
added hotel key card example for Nitpick, and renumber atoms in Nitpick's output for increased readability
blanchet
parents:
34126
diff
changeset
|
3 |
Copyright 2009, 2010 |
33197 | 4 |
|
5 |
Examples featuring Nitpick's functional core. |
|
6 |
*) |
|
7 |
||
8 |
header {* Examples Featuring Nitpick's Functional Core *} |
|
9 |
||
10 |
theory Core_Nits |
|
11 |
imports Main |
|
12 |
begin |
|
13 |
||
41278
8e1cde88aae6
added a timestamp to Nitpick in verbose mode for debugging purposes;
blanchet
parents:
40341
diff
changeset
|
14 |
nitpick_params [verbose, card = 1\<midarrow>6, unary_ints, max_potential = 0, |
42208
02513eb26eb7
raised timeouts further, for SML/NJ -- because of variations in machines/compilers, fixed timeouts can merely prevent non-termination, not enforce particular performance characteristics.
krauss
parents:
41278
diff
changeset
|
15 |
sat_solver = MiniSat_JNI, max_threads = 1, timeout = 240] |
34082
61b7aa37f4b7
make Nitpick "Core" test more conservative, to avoid problems on Larry's machine
blanchet
parents:
33199
diff
changeset
|
16 |
|
33197 | 17 |
subsection {* Curry in a Hurry *} |
18 |
||
19 |
lemma "(\<lambda>f x y. (curry o split) f x y) = (\<lambda>f x y. (\<lambda>x. x) f x y)" |
|
37704
c6161bee8486
adapt Nitpick to "prod_case" and "*" -> "sum" renaming;
blanchet
parents:
37590
diff
changeset
|
20 |
nitpick [card = 1\<midarrow>12, expect = none] |
33197 | 21 |
by auto |
22 |
||
23 |
lemma "(\<lambda>f p. (split o curry) f p) = (\<lambda>f p. (\<lambda>x. x) f p)" |
|
37704
c6161bee8486
adapt Nitpick to "prod_case" and "*" -> "sum" renaming;
blanchet
parents:
37590
diff
changeset
|
24 |
nitpick [card = 1\<midarrow>12, expect = none] |
33197 | 25 |
by auto |
26 |
||
27 |
lemma "split (curry f) = f" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
28 |
nitpick [card = 1\<midarrow>12, expect = none] |
33197 | 29 |
by auto |
30 |
||
31 |
lemma "curry (split f) = f" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
32 |
nitpick [card = 1\<midarrow>12, expect = none] |
33197 | 33 |
by auto |
34 |
||
35 |
lemma "split (\<lambda>x y. f (x, y)) = f" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
36 |
nitpick [card = 1\<midarrow>12, expect = none] |
33197 | 37 |
by auto |
38 |
||
39 |
subsection {* Representations *} |
|
40 |
||
41 |
lemma "\<exists>f. f = (\<lambda>x. x) \<and> f y = y" |
|
42 |
nitpick [expect = none] |
|
43 |
by auto |
|
44 |
||
45 |
lemma "(\<exists>g. \<forall>x. g (f x) = x) \<longrightarrow> (\<forall>y. \<exists>x. y = f x)" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
46 |
nitpick [card 'a = 25, card 'b = 24, expect = genuine] |
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
47 |
nitpick [card = 1\<midarrow>10, mono, expect = none] |
33197 | 48 |
oops |
49 |
||
50 |
lemma "\<exists>f. f = (\<lambda>x. x) \<and> f y \<noteq> y" |
|
51 |
nitpick [card = 1, expect = genuine] |
|
52 |
oops |
|
53 |
||
54 |
lemma "P (\<lambda>x. x)" |
|
55 |
nitpick [card = 1, expect = genuine] |
|
56 |
oops |
|
57 |
||
58 |
lemma "{(a\<Colon>'a\<times>'a, b\<Colon>'b)}^-1 = {(b, a)}" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
59 |
nitpick [card = 1\<midarrow>12, expect = none] |
33197 | 60 |
by auto |
61 |
||
62 |
lemma "fst (a, b) = a" |
|
63 |
nitpick [card = 1\<midarrow>20, expect = none] |
|
64 |
by auto |
|
65 |
||
66 |
lemma "\<exists>P. P = Id" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
67 |
nitpick [card = 1\<midarrow>20, expect = none] |
33197 | 68 |
by auto |
69 |
||
70 |
lemma "(a\<Colon>'a\<Rightarrow>'b, a) \<in> Id\<^sup>*" |
|
71 |
nitpick [card = 1\<midarrow>3, expect = none] |
|
72 |
by auto |
|
73 |
||
74 |
lemma "(a\<Colon>'a\<times>'a, a) \<in> Id\<^sup>* \<union> {(a, b)}\<^sup>*" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
75 |
nitpick [card = 1\<midarrow>4, expect = none] |
33197 | 76 |
by auto |
77 |
||
78 |
lemma "Id (a, a)" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
79 |
nitpick [card = 1\<midarrow>50, expect = none] |
33197 | 80 |
by (auto simp: Id_def Collect_def) |
81 |
||
82 |
lemma "Id ((a\<Colon>'a, b\<Colon>'a), (a, b))" |
|
34082
61b7aa37f4b7
make Nitpick "Core" test more conservative, to avoid problems on Larry's machine
blanchet
parents:
33199
diff
changeset
|
83 |
nitpick [card = 1\<midarrow>10, expect = none] |
33197 | 84 |
by (auto simp: Id_def Collect_def) |
85 |
||
86 |
lemma "UNIV (x\<Colon>'a\<times>'a)" |
|
87 |
nitpick [card = 1\<midarrow>50, expect = none] |
|
88 |
sorry |
|
89 |
||
90 |
lemma "{} = A - A" |
|
91 |
nitpick [card = 1\<midarrow>100, expect = none] |
|
92 |
by auto |
|
93 |
||
94 |
lemma "g = Let (A \<or> B)" |
|
95 |
nitpick [card = 1, expect = none] |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
96 |
nitpick [card = 12, expect = genuine] |
33197 | 97 |
oops |
98 |
||
99 |
lemma "(let a_or_b = A \<or> B in a_or_b \<or> \<not> a_or_b)" |
|
100 |
nitpick [expect = none] |
|
101 |
by auto |
|
102 |
||
103 |
lemma "A \<subseteq> B" |
|
104 |
nitpick [card = 100, expect = genuine] |
|
105 |
oops |
|
106 |
||
107 |
lemma "A = {b}" |
|
108 |
nitpick [card = 100, expect = genuine] |
|
109 |
oops |
|
110 |
||
111 |
lemma "{a, b} = {b}" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
112 |
nitpick [card = 50, expect = genuine] |
33197 | 113 |
oops |
114 |
||
115 |
lemma "(a\<Colon>'a\<times>'a, a\<Colon>'a\<times>'a) \<in> R" |
|
116 |
nitpick [card = 1, expect = genuine] |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
117 |
nitpick [card = 10, expect = genuine] |
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
118 |
nitpick [card = 5, dont_box, expect = genuine] |
33197 | 119 |
oops |
120 |
||
121 |
lemma "f (g\<Colon>'a\<Rightarrow>'a) = x" |
|
122 |
nitpick [card = 3, dont_box, expect = genuine] |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
123 |
nitpick [card = 8, expect = genuine] |
33197 | 124 |
oops |
125 |
||
126 |
lemma "f (a, b) = x" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
127 |
nitpick [card = 10, expect = genuine] |
33197 | 128 |
oops |
129 |
||
130 |
lemma "f (a, a) = f (c, d)" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
131 |
nitpick [card = 10, expect = genuine] |
33197 | 132 |
oops |
133 |
||
134 |
lemma "(x\<Colon>'a) = (\<lambda>a. \<lambda>b. \<lambda>c. if c then a else b) x x True" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
135 |
nitpick [card = 1\<midarrow>10, expect = none] |
33197 | 136 |
by auto |
137 |
||
138 |
lemma "\<exists>F. F a b = G a b" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
139 |
nitpick [card = 2, expect = none] |
33197 | 140 |
by auto |
141 |
||
142 |
lemma "f = split" |
|
143 |
nitpick [card = 2, expect = genuine] |
|
144 |
oops |
|
145 |
||
146 |
lemma "(A\<Colon>'a\<times>'a, B\<Colon>'a\<times>'a) \<in> R \<Longrightarrow> (A, B) \<in> R" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
147 |
nitpick [card = 15, expect = none] |
33197 | 148 |
by auto |
149 |
||
150 |
lemma "(A, B) \<in> R \<or> (\<exists>C. (A, C) \<in> R \<and> (C, B) \<in> R) \<Longrightarrow> |
|
151 |
A = B \<or> (A, B) \<in> R \<or> (\<exists>C. (A, C) \<in> R \<and> (C, B) \<in> R)" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
152 |
nitpick [card = 1\<midarrow>25, expect = none] |
33197 | 153 |
by auto |
154 |
||
155 |
lemma "f = (\<lambda>x\<Colon>'a\<times>'b. x)" |
|
156 |
nitpick [card = 8, expect = genuine] |
|
157 |
oops |
|
158 |
||
159 |
subsection {* Quantifiers *} |
|
160 |
||
161 |
lemma "x = y" |
|
162 |
nitpick [card 'a = 1, expect = none] |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
163 |
nitpick [card 'a = 100, expect = genuine] |
33197 | 164 |
oops |
165 |
||
166 |
lemma "\<forall>x. x = y" |
|
167 |
nitpick [card 'a = 1, expect = none] |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
168 |
nitpick [card 'a = 100, expect = genuine] |
33197 | 169 |
oops |
170 |
||
171 |
lemma "\<forall>x\<Colon>'a \<Rightarrow> bool. x = y" |
|
172 |
nitpick [card 'a = 1, expect = genuine] |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
173 |
nitpick [card 'a = 100, expect = genuine] |
33197 | 174 |
oops |
175 |
||
176 |
lemma "\<exists>x\<Colon>'a \<Rightarrow> bool. x = y" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
177 |
nitpick [card 'a = 1\<midarrow>15, expect = none] |
33197 | 178 |
by auto |
179 |
||
180 |
lemma "\<exists>x y\<Colon>'a \<Rightarrow> bool. x = y" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
181 |
nitpick [card = 1\<midarrow>15, expect = none] |
33197 | 182 |
by auto |
183 |
||
184 |
lemma "\<forall>x. \<exists>y. f x y = f x (g x)" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
185 |
nitpick [card = 1\<midarrow>4, expect = none] |
33197 | 186 |
by auto |
187 |
||
188 |
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. f u v w x = f u (g u) w (h u w)" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
189 |
nitpick [card = 1\<midarrow>4, expect = none] |
33197 | 190 |
by auto |
191 |
||
192 |
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. f u v w x = f u (g u w) w (h u)" |
|
193 |
nitpick [card = 3, expect = genuine] |
|
194 |
oops |
|
195 |
||
196 |
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. \<forall>y. \<exists>z. |
|
197 |
f u v w x y z = f u (g u) w (h u w) y (k u w y)" |
|
198 |
nitpick [card = 1\<midarrow>2, expect = none] |
|
199 |
sorry |
|
200 |
||
201 |
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. \<forall>y. \<exists>z. |
|
202 |
f u v w x y z = f u (g u) w (h u w y) y (k u w y)" |
|
203 |
nitpick [card = 1\<midarrow>2, expect = genuine] |
|
204 |
oops |
|
205 |
||
206 |
lemma "\<forall>u. \<exists>v. \<forall>w. \<exists>x. \<forall>y. \<exists>z. |
|
207 |
f u v w x y z = f u (g u w) w (h u w) y (k u w y)" |
|
208 |
nitpick [card = 1\<midarrow>2, expect = genuine] |
|
209 |
oops |
|
210 |
||
211 |
lemma "\<forall>u\<Colon>'a \<times> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<times> 'f. |
|
212 |
f u v w x = f u (g u) w (h u w)" |
|
213 |
nitpick [card = 1\<midarrow>2, expect = none] |
|
214 |
sorry |
|
215 |
||
216 |
lemma "\<forall>u\<Colon>'a \<times> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<times> 'f. |
|
217 |
f u v w x = f u (g u w) w (h u)" |
|
218 |
nitpick [card = 1\<midarrow>2, dont_box, expect = genuine] |
|
219 |
oops |
|
220 |
||
221 |
lemma "\<forall>u\<Colon>'a \<Rightarrow> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<Rightarrow> 'f. |
|
222 |
f u v w x = f u (g u) w (h u w)" |
|
223 |
nitpick [card = 1\<midarrow>2, dont_box, expect = none] |
|
224 |
sorry |
|
225 |
||
226 |
lemma "\<forall>u\<Colon>'a \<Rightarrow> 'b. \<exists>v\<Colon>'c. \<forall>w\<Colon>'d. \<exists>x\<Colon>'e \<Rightarrow> 'f. |
|
227 |
f u v w x = f u (g u w) w (h u)" |
|
228 |
nitpick [card = 1\<midarrow>2, dont_box, expect = genuine] |
|
229 |
oops |
|
230 |
||
231 |
lemma "\<forall>x. if (\<forall>y. x = y) then False else True" |
|
232 |
nitpick [card = 1, expect = genuine] |
|
233 |
nitpick [card = 2\<midarrow>5, expect = none] |
|
234 |
oops |
|
235 |
||
236 |
lemma "\<forall>x\<Colon>'a\<times>'b. if (\<forall>y. x = y) then False else True" |
|
237 |
nitpick [card = 1, expect = genuine] |
|
238 |
nitpick [card = 2, expect = none] |
|
239 |
oops |
|
240 |
||
241 |
lemma "\<forall>x. if (\<exists>y. x = y) then True else False" |
|
242 |
nitpick [expect = none] |
|
243 |
sorry |
|
244 |
||
245 |
lemma "(\<exists>x\<Colon>'a. \<forall>y. P x y) \<or> (\<exists>x\<Colon>'a \<times> 'a. \<forall>y. P y x)" |
|
246 |
nitpick [card 'a = 1, expect = genuine] |
|
247 |
oops |
|
248 |
||
249 |
lemma "\<exists>x. if x = y then (\<forall>y. y = x \<or> y \<noteq> x) |
|
250 |
else (\<forall>y. y = (x, x) \<or> y \<noteq> (x, x))" |
|
251 |
nitpick [expect = none] |
|
252 |
by auto |
|
253 |
||
254 |
lemma "\<exists>x. if x = y then (\<exists>y. y = x \<or> y \<noteq> x) |
|
255 |
else (\<exists>y. y = (x, x) \<or> y \<noteq> (x, x))" |
|
256 |
nitpick [expect = none] |
|
257 |
by auto |
|
258 |
||
259 |
lemma "let x = (\<forall>x. P x) in if x then x else \<not> x" |
|
260 |
nitpick [expect = none] |
|
261 |
by auto |
|
262 |
||
263 |
lemma "let x = (\<forall>x\<Colon>'a \<times> 'b. P x) in if x then x else \<not> x" |
|
264 |
nitpick [expect = none] |
|
265 |
by auto |
|
266 |
||
267 |
subsection {* Schematic Variables *} |
|
268 |
||
36319 | 269 |
schematic_lemma "x = ?x" |
33197 | 270 |
nitpick [expect = none] |
271 |
by auto |
|
272 |
||
36319 | 273 |
schematic_lemma "\<forall>x. x = ?x" |
33197 | 274 |
nitpick [expect = genuine] |
275 |
oops |
|
276 |
||
36319 | 277 |
schematic_lemma "\<exists>x. x = ?x" |
33197 | 278 |
nitpick [expect = none] |
279 |
by auto |
|
280 |
||
36319 | 281 |
schematic_lemma "\<exists>x\<Colon>'a \<Rightarrow> 'b. x = ?x" |
33197 | 282 |
nitpick [expect = none] |
283 |
by auto |
|
284 |
||
36319 | 285 |
schematic_lemma "\<forall>x. ?x = ?y" |
33197 | 286 |
nitpick [expect = none] |
287 |
by auto |
|
288 |
||
36319 | 289 |
schematic_lemma "\<exists>x. ?x = ?y" |
33197 | 290 |
nitpick [expect = none] |
291 |
by auto |
|
292 |
||
293 |
subsection {* Known Constants *} |
|
294 |
||
295 |
lemma "x \<equiv> all \<Longrightarrow> False" |
|
296 |
nitpick [card = 1, expect = genuine] |
|
297 |
nitpick [card = 1, box "('a \<Rightarrow> prop) \<Rightarrow> prop", expect = genuine] |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
298 |
nitpick [card = 6, expect = genuine] |
33197 | 299 |
oops |
300 |
||
301 |
lemma "\<And>x. f x y = f x y" |
|
302 |
nitpick [expect = none] |
|
303 |
oops |
|
304 |
||
305 |
lemma "\<And>x. f x y = f y x" |
|
306 |
nitpick [expect = genuine] |
|
307 |
oops |
|
308 |
||
309 |
lemma "all (\<lambda>x. Trueprop (f x y = f x y)) \<equiv> Trueprop True" |
|
310 |
nitpick [expect = none] |
|
311 |
by auto |
|
312 |
||
313 |
lemma "all (\<lambda>x. Trueprop (f x y = f x y)) \<equiv> Trueprop False" |
|
314 |
nitpick [expect = genuine] |
|
315 |
oops |
|
316 |
||
317 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> all P \<equiv> all (\<lambda>x. P (I x))" |
|
318 |
nitpick [expect = none] |
|
319 |
by auto |
|
320 |
||
321 |
lemma "x \<equiv> (op \<equiv>) \<Longrightarrow> False" |
|
322 |
nitpick [card = 1, expect = genuine] |
|
323 |
oops |
|
324 |
||
325 |
lemma "P x \<equiv> P x" |
|
326 |
nitpick [card = 1\<midarrow>10, expect = none] |
|
327 |
by auto |
|
328 |
||
329 |
lemma "P x \<equiv> Q x \<Longrightarrow> P x = Q x" |
|
330 |
nitpick [card = 1\<midarrow>10, expect = none] |
|
331 |
by auto |
|
332 |
||
333 |
lemma "P x = Q x \<Longrightarrow> P x \<equiv> Q x" |
|
334 |
nitpick [card = 1\<midarrow>10, expect = none] |
|
335 |
by auto |
|
336 |
||
337 |
lemma "x \<equiv> (op \<Longrightarrow>) \<Longrightarrow> False" |
|
338 |
nitpick [expect = genuine] |
|
339 |
oops |
|
340 |
||
341 |
lemma "I \<equiv> (\<lambda>x. x) \<Longrightarrow> (op \<Longrightarrow> x) \<equiv> (\<lambda>y. (op \<Longrightarrow> x (I y)))" |
|
342 |
nitpick [expect = none] |
|
343 |
by auto |
|
344 |
||
345 |
lemma "P x \<Longrightarrow> P x" |
|
346 |
nitpick [card = 1\<midarrow>10, expect = none] |
|
347 |
by auto |
|
348 |
||
349 |
lemma "True \<Longrightarrow> True" "False \<Longrightarrow> True" "False \<Longrightarrow> False" |
|
350 |
nitpick [expect = none] |
|
351 |
by auto |
|
352 |
||
353 |
lemma "True \<Longrightarrow> False" |
|
354 |
nitpick [expect = genuine] |
|
355 |
oops |
|
356 |
||
357 |
lemma "x = Not" |
|
358 |
nitpick [expect = genuine] |
|
359 |
oops |
|
360 |
||
361 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> Not = (\<lambda>x. Not (I x))" |
|
362 |
nitpick [expect = none] |
|
363 |
by auto |
|
364 |
||
365 |
lemma "x = True" |
|
366 |
nitpick [expect = genuine] |
|
367 |
oops |
|
368 |
||
369 |
lemma "x = False" |
|
370 |
nitpick [expect = genuine] |
|
371 |
oops |
|
372 |
||
373 |
lemma "x = undefined" |
|
374 |
nitpick [expect = genuine] |
|
375 |
oops |
|
376 |
||
377 |
lemma "(False, ()) = undefined \<Longrightarrow> ((), False) = undefined" |
|
378 |
nitpick [expect = genuine] |
|
379 |
oops |
|
380 |
||
381 |
lemma "undefined = undefined" |
|
382 |
nitpick [expect = none] |
|
383 |
by auto |
|
384 |
||
385 |
lemma "f undefined = f undefined" |
|
386 |
nitpick [expect = none] |
|
387 |
by auto |
|
388 |
||
389 |
lemma "f undefined = g undefined" |
|
390 |
nitpick [card = 33, expect = genuine] |
|
391 |
oops |
|
392 |
||
393 |
lemma "\<exists>!x. x = undefined" |
|
39221
70fd4a3c41ed
remove "minipick" (the toy version of Nitpick) and some tests;
blanchet
parents:
38185
diff
changeset
|
394 |
nitpick [card = 15, expect = none] |
33197 | 395 |
by auto |
396 |
||
397 |
lemma "x = All \<Longrightarrow> False" |
|
398 |
nitpick [card = 1, dont_box, expect = genuine] |
|
399 |
oops |
|
400 |
||
401 |
lemma "\<forall>x. f x y = f x y" |
|
402 |
nitpick [expect = none] |
|
403 |
oops |
|
404 |
||
405 |
lemma "\<forall>x. f x y = f y x" |
|
406 |
nitpick [expect = genuine] |
|
407 |
oops |
|
408 |
||
409 |
lemma "All (\<lambda>x. f x y = f x y) = True" |
|
410 |
nitpick [expect = none] |
|
411 |
by auto |
|
412 |
||
413 |
lemma "All (\<lambda>x. f x y = f x y) = False" |
|
414 |
nitpick [expect = genuine] |
|
415 |
oops |
|
416 |
||
417 |
lemma "x = Ex \<Longrightarrow> False" |
|
418 |
nitpick [card = 1, dont_box, expect = genuine] |
|
419 |
oops |
|
420 |
||
421 |
lemma "\<exists>x. f x y = f x y" |
|
422 |
nitpick [expect = none] |
|
423 |
oops |
|
424 |
||
425 |
lemma "\<exists>x. f x y = f y x" |
|
426 |
nitpick [expect = none] |
|
427 |
oops |
|
428 |
||
429 |
lemma "Ex (\<lambda>x. f x y = f x y) = True" |
|
430 |
nitpick [expect = none] |
|
431 |
by auto |
|
432 |
||
433 |
lemma "Ex (\<lambda>x. f x y = f y x) = True" |
|
434 |
nitpick [expect = none] |
|
435 |
by auto |
|
436 |
||
437 |
lemma "Ex (\<lambda>x. f x y = f x y) = False" |
|
438 |
nitpick [expect = genuine] |
|
439 |
oops |
|
440 |
||
441 |
lemma "Ex (\<lambda>x. f x y \<noteq> f x y) = False" |
|
442 |
nitpick [expect = none] |
|
443 |
by auto |
|
444 |
||
445 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> Ex P = Ex (\<lambda>x. P (I x))" |
|
446 |
nitpick [expect = none] |
|
447 |
by auto |
|
448 |
||
449 |
lemma "x = y \<Longrightarrow> y = x" |
|
450 |
nitpick [expect = none] |
|
451 |
by auto |
|
452 |
||
453 |
lemma "x = y \<Longrightarrow> f x = f y" |
|
454 |
nitpick [expect = none] |
|
455 |
by auto |
|
456 |
||
457 |
lemma "x = y \<and> y = z \<Longrightarrow> x = z" |
|
458 |
nitpick [expect = none] |
|
459 |
by auto |
|
460 |
||
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
461 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> (op \<and>) = (\<lambda>x. op \<and> (I x))" |
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
462 |
"I = (\<lambda>x. x) \<Longrightarrow> (op \<and>) = (\<lambda>x y. x \<and> (I y))" |
33197 | 463 |
nitpick [expect = none] |
464 |
by auto |
|
465 |
||
466 |
lemma "(a \<and> b) = (\<not> (\<not> a \<or> \<not> b))" |
|
467 |
nitpick [expect = none] |
|
468 |
by auto |
|
469 |
||
470 |
lemma "a \<and> b \<Longrightarrow> a" "a \<and> b \<Longrightarrow> b" |
|
471 |
nitpick [expect = none] |
|
472 |
by auto |
|
473 |
||
474 |
lemma "(op \<longrightarrow>) = (\<lambda>x. op\<longrightarrow> x)" "(op\<longrightarrow> ) = (\<lambda>x y. x \<longrightarrow> y)" |
|
475 |
nitpick [expect = none] |
|
476 |
by auto |
|
477 |
||
478 |
lemma "((if a then b else c) = d) = ((a \<longrightarrow> (b = d)) \<and> (\<not> a \<longrightarrow> (c = d)))" |
|
479 |
nitpick [expect = none] |
|
480 |
by auto |
|
481 |
||
482 |
lemma "(if a then b else c) = (THE d. (a \<longrightarrow> (d = b)) \<and> (\<not> a \<longrightarrow> (d = c)))" |
|
483 |
nitpick [expect = none] |
|
484 |
by auto |
|
485 |
||
486 |
lemma "fst (x, y) = x" |
|
487 |
nitpick [expect = none] |
|
488 |
by (simp add: fst_def) |
|
489 |
||
490 |
lemma "snd (x, y) = y" |
|
491 |
nitpick [expect = none] |
|
492 |
by (simp add: snd_def) |
|
493 |
||
494 |
lemma "fst (x\<Colon>'a\<Rightarrow>'b, y) = x" |
|
495 |
nitpick [expect = none] |
|
496 |
by (simp add: fst_def) |
|
497 |
||
498 |
lemma "snd (x\<Colon>'a\<Rightarrow>'b, y) = y" |
|
499 |
nitpick [expect = none] |
|
500 |
by (simp add: snd_def) |
|
501 |
||
502 |
lemma "fst (x, y\<Colon>'a\<Rightarrow>'b) = x" |
|
503 |
nitpick [expect = none] |
|
504 |
by (simp add: fst_def) |
|
505 |
||
506 |
lemma "snd (x, y\<Colon>'a\<Rightarrow>'b) = y" |
|
507 |
nitpick [expect = none] |
|
508 |
by (simp add: snd_def) |
|
509 |
||
510 |
lemma "fst (x\<Colon>'a\<times>'b, y) = x" |
|
511 |
nitpick [expect = none] |
|
512 |
by (simp add: fst_def) |
|
513 |
||
514 |
lemma "snd (x\<Colon>'a\<times>'b, y) = y" |
|
515 |
nitpick [expect = none] |
|
516 |
by (simp add: snd_def) |
|
517 |
||
518 |
lemma "fst (x, y\<Colon>'a\<times>'b) = x" |
|
519 |
nitpick [expect = none] |
|
520 |
by (simp add: fst_def) |
|
521 |
||
522 |
lemma "snd (x, y\<Colon>'a\<times>'b) = y" |
|
523 |
nitpick [expect = none] |
|
524 |
by (simp add: snd_def) |
|
525 |
||
526 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> fst = (\<lambda>x. fst (I x))" |
|
527 |
nitpick [expect = none] |
|
528 |
by auto |
|
529 |
||
530 |
lemma "fst (x, y) = snd (y, x)" |
|
531 |
nitpick [expect = none] |
|
532 |
by auto |
|
533 |
||
534 |
lemma "(x, x) \<in> Id" |
|
535 |
nitpick [expect = none] |
|
536 |
by auto |
|
537 |
||
538 |
lemma "(x, y) \<in> Id \<Longrightarrow> x = y" |
|
539 |
nitpick [expect = none] |
|
540 |
by auto |
|
541 |
||
542 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> Id = (\<lambda>x. Id (I x))" |
|
543 |
nitpick [expect = none] |
|
544 |
by auto |
|
545 |
||
546 |
lemma "{} = (\<lambda>x. False)" |
|
547 |
nitpick [expect = none] |
|
33199 | 548 |
by (metis Collect_def empty_def) |
33197 | 549 |
|
550 |
lemma "x \<in> {}" |
|
551 |
nitpick [expect = genuine] |
|
552 |
oops |
|
553 |
||
554 |
lemma "{a, b} = {b}" |
|
555 |
nitpick [expect = genuine] |
|
556 |
oops |
|
557 |
||
558 |
lemma "{a, b} \<noteq> {b}" |
|
559 |
nitpick [expect = genuine] |
|
560 |
oops |
|
561 |
||
562 |
lemma "{a} = {b}" |
|
563 |
nitpick [expect = genuine] |
|
564 |
oops |
|
565 |
||
566 |
lemma "{a} \<noteq> {b}" |
|
567 |
nitpick [expect = genuine] |
|
568 |
oops |
|
569 |
||
570 |
lemma "{a, b, c} = {c, b, a}" |
|
571 |
nitpick [expect = none] |
|
572 |
by auto |
|
573 |
||
574 |
lemma "UNIV = (\<lambda>x. True)" |
|
575 |
nitpick [expect = none] |
|
576 |
by (simp only: UNIV_def Collect_def) |
|
577 |
||
578 |
lemma "UNIV x = True" |
|
579 |
nitpick [expect = none] |
|
580 |
by (simp only: UNIV_def Collect_def) |
|
581 |
||
582 |
lemma "x \<notin> UNIV" |
|
583 |
nitpick [expect = genuine] |
|
584 |
oops |
|
585 |
||
586 |
lemma "op \<in> = (\<lambda>x P. P x)" |
|
587 |
nitpick [expect = none] |
|
588 |
apply (rule ext) |
|
589 |
apply (rule ext) |
|
590 |
by (simp add: mem_def) |
|
591 |
||
592 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<in> = (\<lambda>x. (op \<in> (I x)))" |
|
593 |
nitpick [expect = none] |
|
594 |
apply (rule ext) |
|
595 |
apply (rule ext) |
|
596 |
by (simp add: mem_def) |
|
597 |
||
598 |
lemma "P x = (x \<in> P)" |
|
599 |
nitpick [expect = none] |
|
600 |
by (simp add: mem_def) |
|
601 |
||
602 |
lemma "insert = (\<lambda>x y. insert x (y \<union> y))" |
|
603 |
nitpick [expect = none] |
|
604 |
by simp |
|
605 |
||
606 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> trancl = (\<lambda>x. trancl (I x))" |
|
607 |
nitpick [card = 1\<midarrow>2, expect = none] |
|
608 |
by auto |
|
609 |
||
610 |
lemma "rtrancl = (\<lambda>x. rtrancl x \<union> {(y, y)})" |
|
611 |
nitpick [card = 1\<midarrow>3, expect = none] |
|
612 |
apply (rule ext) |
|
613 |
by auto |
|
614 |
||
615 |
lemma "(x, x) \<in> rtrancl {(y, y)}" |
|
616 |
nitpick [expect = none] |
|
617 |
by auto |
|
618 |
||
619 |
lemma "((x, x), (x, x)) \<in> rtrancl {}" |
|
35284
9edc2bd6d2bd
enabled Nitpick's support for quotient types + shortened the Nitpick tests a bit
blanchet
parents:
35078
diff
changeset
|
620 |
nitpick [card = 1\<midarrow>5, expect = none] |
33197 | 621 |
by auto |
622 |
||
623 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<union> = (\<lambda>x. op \<union> (I x))" |
|
624 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
625 |
by auto |
|
626 |
||
627 |
lemma "a \<in> A \<Longrightarrow> a \<in> (A \<union> B)" "b \<in> B \<Longrightarrow> b \<in> (A \<union> B)" |
|
628 |
nitpick [expect = none] |
|
629 |
by auto |
|
630 |
||
631 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<inter> = (\<lambda>x. op \<inter> (I x))" |
|
632 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
633 |
by auto |
|
634 |
||
635 |
lemma "a \<notin> A \<Longrightarrow> a \<notin> (A \<inter> B)" "b \<notin> B \<Longrightarrow> b \<notin> (A \<inter> B)" |
|
636 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
637 |
by auto |
|
638 |
||
639 |
lemma "x \<in> ((A\<Colon>'a set) - B) \<longleftrightarrow> x \<in> A \<and> x \<notin> B" |
|
640 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
641 |
by auto |
|
642 |
||
643 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> op \<subset> = (\<lambda>x. op \<subset> (I x))" |
|
644 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
645 |
by auto |
|
646 |
||
647 |
lemma "A \<subset> B \<Longrightarrow> (\<forall>a \<in> A. a \<in> B) \<and> (\<exists>b \<in> B. b \<notin> A)" |
|
648 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
649 |
by auto |
|
650 |
||
651 |
lemma "A \<subseteq> B \<Longrightarrow> \<forall>a \<in> A. a \<in> B" |
|
652 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
653 |
by auto |
|
654 |
||
655 |
lemma "A \<subseteq> B \<Longrightarrow> A \<subset> B" |
|
656 |
nitpick [card = 5, expect = genuine] |
|
657 |
oops |
|
658 |
||
659 |
lemma "A \<subset> B \<Longrightarrow> A \<subseteq> B" |
|
660 |
nitpick [expect = none] |
|
661 |
by auto |
|
662 |
||
663 |
lemma "I = (\<lambda>x\<Colon>'a set. x) \<Longrightarrow> uminus = (\<lambda>x. uminus (I x))" |
|
34126 | 664 |
nitpick [card = 1\<midarrow>7, expect = none] |
33197 | 665 |
by auto |
666 |
||
667 |
lemma "A \<union> - A = UNIV" |
|
668 |
nitpick [expect = none] |
|
669 |
by auto |
|
670 |
||
671 |
lemma "A \<inter> - A = {}" |
|
672 |
nitpick [expect = none] |
|
673 |
by auto |
|
674 |
||
675 |
lemma "A = -(A\<Colon>'a set)" |
|
676 |
nitpick [card 'a = 10, expect = genuine] |
|
677 |
oops |
|
678 |
||
679 |
lemma "finite A" |
|
680 |
nitpick [expect = none] |
|
681 |
oops |
|
682 |
||
683 |
lemma "finite A \<Longrightarrow> finite B" |
|
684 |
nitpick [expect = none] |
|
685 |
oops |
|
686 |
||
687 |
lemma "All finite" |
|
688 |
nitpick [expect = none] |
|
689 |
oops |
|
690 |
||
691 |
subsection {* The and Eps *} |
|
692 |
||
693 |
lemma "x = The" |
|
694 |
nitpick [card = 5, expect = genuine] |
|
695 |
oops |
|
696 |
||
697 |
lemma "\<exists>x. x = The" |
|
698 |
nitpick [card = 1\<midarrow>3] |
|
699 |
by auto |
|
700 |
||
701 |
lemma "P x \<and> (\<forall>y. P y \<longrightarrow> y = x) \<longrightarrow> The P = x" |
|
702 |
nitpick [expect = none] |
|
703 |
by auto |
|
704 |
||
705 |
lemma "P x \<and> P y \<and> x \<noteq> y \<longrightarrow> The P = z" |
|
706 |
nitpick [expect = genuine] |
|
707 |
oops |
|
708 |
||
709 |
lemma "P x \<and> P y \<and> x \<noteq> y \<longrightarrow> The P = x \<or> The P = y" |
|
710 |
nitpick [card = 2, expect = none] |
|
711 |
nitpick [card = 3\<midarrow>5, expect = genuine] |
|
712 |
oops |
|
713 |
||
714 |
lemma "P x \<Longrightarrow> P (The P)" |
|
715 |
nitpick [card = 1\<midarrow>2, expect = none] |
|
716 |
nitpick [card = 8, expect = genuine] |
|
717 |
oops |
|
718 |
||
719 |
lemma "(\<forall>x. \<not> P x) \<longrightarrow> The P = y" |
|
720 |
nitpick [expect = genuine] |
|
721 |
oops |
|
722 |
||
723 |
lemma "I = (\<lambda>x. x) \<Longrightarrow> The = (\<lambda>x. The (I x))" |
|
724 |
nitpick [card = 1\<midarrow>5, expect = none] |
|
725 |
by auto |
|
726 |
||
727 |
lemma "x = Eps" |
|
728 |
nitpick [card = 5, expect = genuine] |
|
729 |
oops |
|
730 |
||
731 |
lemma "\<exists>x. x = Eps" |
|
732 |
nitpick [card = 1\<midarrow>3, expect = none] |
|
733 |
by auto |
|
734 |
||
735 |
lemma "P x \<and> (\<forall>y. P y \<longrightarrow> y = x) \<longrightarrow> Eps P = x" |
|
736 |
nitpick [expect = none] |
|
737 |
by auto |
|
738 |
||
739 |
lemma "P x \<and> P y \<and> x \<noteq> y \<longrightarrow> Eps P = z" |
|
740 |
nitpick [expect = genuine] |
|
741 |
apply auto |
|
742 |
oops |
|
743 |
||
744 |
lemma "P x \<Longrightarrow> P (Eps P)" |
|
745 |
nitpick [card = 1\<midarrow>8, expect = none] |
|
746 |
by (metis exE_some) |
|
747 |
||
748 |
lemma "\<forall>x. \<not> P x \<longrightarrow> Eps P = y" |
|
749 |
nitpick [expect = genuine] |
|
750 |
oops |
|
751 |
||
752 |
lemma "P (Eps P)" |
|
753 |
nitpick [expect = genuine] |
|
754 |
oops |
|
755 |
||
756 |
lemma "(P\<Colon>nat set) (Eps P)" |
|
757 |
nitpick [expect = genuine] |
|
758 |
oops |
|
759 |
||
760 |
lemma "\<not> P (Eps P)" |
|
761 |
nitpick [expect = genuine] |
|
762 |
oops |
|
763 |
||
764 |
lemma "\<not> (P\<Colon>nat set) (Eps P)" |
|
765 |
nitpick [expect = genuine] |
|
766 |
oops |
|
767 |
||
768 |
lemma "P \<noteq> {} \<Longrightarrow> P (Eps P)" |
|
769 |
nitpick [expect = none] |
|
770 |
sorry |
|
771 |
||
772 |
lemma "(P\<Colon>nat set) \<noteq> {} \<Longrightarrow> P (Eps P)" |
|
773 |
nitpick [expect = none] |
|
774 |
sorry |
|
775 |
||
776 |
lemma "P (The P)" |
|
777 |
nitpick [expect = genuine] |
|
778 |
oops |
|
779 |
||
780 |
lemma "(P\<Colon>nat set) (The P)" |
|
781 |
nitpick [expect = genuine] |
|
782 |
oops |
|
783 |
||
784 |
lemma "\<not> P (The P)" |
|
785 |
nitpick [expect = genuine] |
|
786 |
oops |
|
787 |
||
788 |
lemma "\<not> (P\<Colon>nat set) (The P)" |
|
789 |
nitpick [expect = genuine] |
|
790 |
oops |
|
791 |
||
792 |
lemma "The P \<noteq> x" |
|
793 |
nitpick [expect = genuine] |
|
794 |
oops |
|
795 |
||
796 |
lemma "The P \<noteq> (x\<Colon>nat)" |
|
797 |
nitpick [expect = genuine] |
|
798 |
oops |
|
799 |
||
800 |
lemma "P x \<Longrightarrow> P (The P)" |
|
801 |
nitpick [expect = genuine] |
|
802 |
oops |
|
803 |
||
804 |
lemma "P (x\<Colon>nat) \<Longrightarrow> P (The P)" |
|
805 |
nitpick [expect = genuine] |
|
806 |
oops |
|
807 |
||
808 |
lemma "P = {x} \<Longrightarrow> P (The P)" |
|
809 |
nitpick [expect = none] |
|
810 |
oops |
|
811 |
||
812 |
lemma "P = {x\<Colon>nat} \<Longrightarrow> P (The P)" |
|
813 |
nitpick [expect = none] |
|
814 |
oops |
|
815 |
||
816 |
consts Q :: 'a |
|
817 |
||
818 |
lemma "Q (Eps Q)" |
|
819 |
nitpick [expect = genuine] |
|
820 |
oops |
|
821 |
||
822 |
lemma "(Q\<Colon>nat set) (Eps Q)" |
|
35386
45a4e19d3ebd
more work on the new monotonicity stuff in Nitpick
blanchet
parents:
35284
diff
changeset
|
823 |
nitpick [expect = none] (* unfortunate *) |
33197 | 824 |
oops |
825 |
||
826 |
lemma "\<not> Q (Eps Q)" |
|
827 |
nitpick [expect = genuine] |
|
828 |
oops |
|
829 |
||
830 |
lemma "\<not> (Q\<Colon>nat set) (Eps Q)" |
|
831 |
nitpick [expect = genuine] |
|
832 |
oops |
|
833 |
||
834 |
lemma "(Q\<Colon>'a set) \<noteq> {} \<Longrightarrow> (Q\<Colon>'a set) (Eps Q)" |
|
835 |
nitpick [expect = none] |
|
836 |
sorry |
|
837 |
||
838 |
lemma "(Q\<Colon>nat set) \<noteq> {} \<Longrightarrow> (Q\<Colon>nat set) (Eps Q)" |
|
839 |
nitpick [expect = none] |
|
840 |
sorry |
|
841 |
||
842 |
lemma "Q (The Q)" |
|
843 |
nitpick [expect = genuine] |
|
844 |
oops |
|
845 |
||
846 |
lemma "(Q\<Colon>nat set) (The Q)" |
|
847 |
nitpick [expect = genuine] |
|
848 |
oops |
|
849 |
||
850 |
lemma "\<not> Q (The Q)" |
|
851 |
nitpick [expect = genuine] |
|
852 |
oops |
|
853 |
||
854 |
lemma "\<not> (Q\<Colon>nat set) (The Q)" |
|
855 |
nitpick [expect = genuine] |
|
856 |
oops |
|
857 |
||
858 |
lemma "The Q \<noteq> x" |
|
859 |
nitpick [expect = genuine] |
|
860 |
oops |
|
861 |
||
862 |
lemma "The Q \<noteq> (x\<Colon>nat)" |
|
863 |
nitpick [expect = genuine] |
|
864 |
oops |
|
865 |
||
866 |
lemma "Q x \<Longrightarrow> Q (The Q)" |
|
867 |
nitpick [expect = genuine] |
|
868 |
oops |
|
869 |
||
870 |
lemma "Q (x\<Colon>nat) \<Longrightarrow> Q (The Q)" |
|
871 |
nitpick [expect = genuine] |
|
872 |
oops |
|
873 |
||
874 |
lemma "Q = {x\<Colon>'a} \<Longrightarrow> (Q\<Colon>'a set) (The Q)" |
|
875 |
nitpick [expect = none] |
|
35386
45a4e19d3ebd
more work on the new monotonicity stuff in Nitpick
blanchet
parents:
35284
diff
changeset
|
876 |
sorry |
33197 | 877 |
|
878 |
lemma "Q = {x\<Colon>nat} \<Longrightarrow> (Q\<Colon>nat set) (The Q)" |
|
879 |
nitpick [expect = none] |
|
35386
45a4e19d3ebd
more work on the new monotonicity stuff in Nitpick
blanchet
parents:
35284
diff
changeset
|
880 |
sorry |
33197 | 881 |
|
39359 | 882 |
nitpick_params [max_potential = 1] |
37275 | 883 |
|
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
884 |
lemma "(THE j. j > Suc 2 \<and> j \<le> 3) \<noteq> 0" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
885 |
nitpick [card nat = 2, expect = potential] |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
886 |
nitpick [card nat = 6, expect = potential] (* unfortunate *) |
37270 | 887 |
oops |
888 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
889 |
lemma "(THE j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x \<noteq> 0" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
890 |
nitpick [card nat = 2, expect = potential] |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
891 |
nitpick [card nat = 6, expect = none] |
37270 | 892 |
sorry |
893 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
894 |
lemma "(THE j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x = 4" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
895 |
nitpick [card nat = 2, expect = potential] |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
896 |
nitpick [card nat = 6, expect = none] |
37270 | 897 |
sorry |
898 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
899 |
lemma "(THE j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
900 |
nitpick [card nat = 6, expect = genuine] |
37270 | 901 |
oops |
902 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
903 |
lemma "(THE j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4 \<or> x = 5" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
904 |
nitpick [card nat = 6, expect = genuine] |
37270 | 905 |
oops |
906 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
907 |
lemma "(SOME j. j > Suc 2 \<and> j \<le> 3) \<noteq> 0" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
908 |
nitpick [card nat = 2, expect = potential] |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
909 |
nitpick [card nat = 6, expect = genuine] |
37270 | 910 |
oops |
911 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
912 |
lemma "(SOME j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x \<noteq> 0" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
913 |
nitpick [card nat = 2, expect = potential] |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
914 |
nitpick [card nat = 6, expect = none] |
37270 | 915 |
oops |
916 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
917 |
lemma "(SOME j. j > Suc 2 \<and> j \<le> 4) = x \<Longrightarrow> x = 4" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
918 |
nitpick [card nat = 2, expect = potential] |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
919 |
nitpick [card nat = 6, expect = none] |
37270 | 920 |
sorry |
921 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
922 |
lemma "(SOME j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
923 |
nitpick [card nat = 6, expect = genuine] |
37270 | 924 |
oops |
925 |
||
37434
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
926 |
lemma "(SOME j. j > Suc 2 \<and> j \<le> 5) = x \<Longrightarrow> x = 4 \<or> x = 5" |
df936eadb642
make example run a bit faster (might help atbroy102)
blanchet
parents:
37275
diff
changeset
|
927 |
nitpick [card nat = 6, expect = none] |
37270 | 928 |
sorry |
929 |
||
39359 | 930 |
nitpick_params [max_potential = 0] |
37275 | 931 |
|
33197 | 932 |
subsection {* Destructors and Recursors *} |
933 |
||
934 |
lemma "(x\<Colon>'a) = (case True of True \<Rightarrow> x | False \<Rightarrow> x)" |
|
935 |
nitpick [card = 2, expect = none] |
|
936 |
by auto |
|
937 |
||
938 |
lemma "bool_rec x y True = x" |
|
939 |
nitpick [card = 2, expect = none] |
|
940 |
by auto |
|
941 |
||
942 |
lemma "bool_rec x y False = y" |
|
943 |
nitpick [card = 2, expect = none] |
|
944 |
by auto |
|
945 |
||
946 |
lemma "(x\<Colon>bool) = bool_rec x x True" |
|
947 |
nitpick [card = 2, expect = none] |
|
948 |
by auto |
|
949 |
||
950 |
lemma "x = (case (x, y) of (x', y') \<Rightarrow> x')" |
|
951 |
nitpick [expect = none] |
|
952 |
sorry |
|
953 |
||
954 |
end |