author | wenzelm |
Fri, 05 Apr 2019 17:05:32 +0200 | |
changeset 70067 | 9b34dbeb1103 |
parent 63167 | 0909deb8059b |
child 74641 | 6f801e1073fa |
permissions | -rw-r--r-- |
33197 | 1 |
(* Title: HOL/Nitpick_Examples/Record_Nits.thy |
2 |
Author: Jasmin Blanchette, TU Muenchen |
|
45035 | 3 |
Copyright 2009-2011 |
33197 | 4 |
|
5 |
Examples featuring Nitpick applied to records. |
|
6 |
*) |
|
7 |
||
63167 | 8 |
section \<open>Examples Featuring Nitpick Applied to Records\<close> |
33197 | 9 |
|
10 |
theory Record_Nits |
|
11 |
imports Main |
|
12 |
begin |
|
13 |
||
55893
aed17a173d16
fixed handling of 'case_prod' and other 'case' functions for interpreted types
blanchet
parents:
54680
diff
changeset
|
14 |
nitpick_params [verbose, card = 1-6, max_potential = 0, |
54680
93f6d33a754e
reverted 86e0b402994c, which was accidentally qfinish'ed and pushed
blanchet
parents:
54633
diff
changeset
|
15 |
sat_solver = MiniSat_JNI, max_threads = 1, timeout = 240] |
34083
652719832159
make Nitpick tests more robust by specifying SAT solver, singlethreading (in Kodkod, not in Isabelle), and higher time limits
blanchet
parents:
33197
diff
changeset
|
16 |
|
33197 | 17 |
record point2d = |
18 |
xc :: int |
|
19 |
yc :: int |
|
20 |
||
21 |
lemma "\<lparr>xc = x, yc = y\<rparr> = p\<lparr>xc := x, yc := y\<rparr>" |
|
22 |
nitpick [expect = none] |
|
23 |
sorry |
|
24 |
||
25 |
lemma "\<lparr>xc = x, yc = y\<rparr> = p\<lparr>xc := x\<rparr>" |
|
26 |
nitpick [expect = genuine] |
|
27 |
oops |
|
28 |
||
29 |
lemma "p\<lparr>xc := x, yc := y\<rparr> \<noteq> p" |
|
30 |
nitpick [expect = genuine] |
|
31 |
oops |
|
32 |
||
33 |
lemma "p\<lparr>xc := x, yc := y\<rparr> = p" |
|
34 |
nitpick [expect = genuine] |
|
35 |
oops |
|
36 |
||
37 |
record point3d = point2d + |
|
38 |
zc :: int |
|
39 |
||
40 |
lemma "\<lparr>xc = x, yc = y, zc = z\<rparr> = p\<lparr>xc := x, yc := y, zc := z\<rparr>" |
|
41 |
nitpick [expect = none] |
|
42 |
sorry |
|
43 |
||
44 |
lemma "\<lparr>xc = x, yc = y, zc = z\<rparr> = p\<lparr>xc := x\<rparr>" |
|
45 |
nitpick [expect = genuine] |
|
46 |
oops |
|
47 |
||
48 |
lemma "\<lparr>xc = x, yc = y, zc = z\<rparr> = p\<lparr>zc := z\<rparr>" |
|
49 |
nitpick [expect = genuine] |
|
50 |
oops |
|
51 |
||
52 |
lemma "p\<lparr>xc := x, yc := y, zc := z\<rparr> \<noteq> p" |
|
53 |
nitpick [expect = genuine] |
|
54 |
oops |
|
55 |
||
56 |
lemma "p\<lparr>xc := x, yc := y, zc := z\<rparr> = p" |
|
57 |
nitpick [expect = genuine] |
|
58 |
oops |
|
59 |
||
60 |
record point4d = point3d + |
|
61 |
wc :: int |
|
62 |
||
63 |
lemma "\<lparr>xc = x, yc = y, zc = z, wc = w\<rparr> = p\<lparr>xc := x, yc := y, zc := z, wc := w\<rparr>" |
|
64 |
nitpick [expect = none] |
|
65 |
sorry |
|
66 |
||
67 |
lemma "\<lparr>xc = x, yc = y, zc = z, wc = w\<rparr> = p\<lparr>xc := x\<rparr>" |
|
68 |
nitpick [expect = genuine] |
|
69 |
oops |
|
70 |
||
71 |
lemma "\<lparr>xc = x, yc = y, zc = z, wc = w\<rparr> = p\<lparr>zc := z\<rparr>" |
|
72 |
nitpick [expect = genuine] |
|
73 |
oops |
|
74 |
||
75 |
lemma "\<lparr>xc = x, yc = y, zc = z, wc = w\<rparr> = p\<lparr>wc := w\<rparr>" |
|
76 |
nitpick [expect = genuine] |
|
77 |
oops |
|
78 |
||
79 |
lemma "p\<lparr>xc := x, yc := y, zc := z, wc := w\<rparr> \<noteq> p" |
|
80 |
nitpick [expect = genuine] |
|
81 |
oops |
|
82 |
||
83 |
lemma "p\<lparr>xc := x, yc := y, zc := z, wc := w\<rparr> = p" |
|
84 |
nitpick [expect = genuine] |
|
85 |
oops |
|
86 |
||
87 |
end |