author | huffman |
Thu, 22 Sep 2011 12:55:19 -0700 | |
changeset 45049 | 13efaee97111 |
parent 43913 | 003f8c5f3e37 |
child 45970 | b6d0cff57d96 |
permissions | -rw-r--r-- |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
1 |
theory Context_Free_Grammar_Example |
41956 | 2 |
imports "~~/src/HOL/Library/Code_Prolog" |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
3 |
begin |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
4 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
5 |
declare mem_def[code_pred_inline] |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
6 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
7 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
8 |
subsection {* Alternative rules for length *} |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
9 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
10 |
definition size_list :: "'a list => nat" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
11 |
where "size_list = size" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
12 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
13 |
lemma size_list_simps: |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
14 |
"size_list [] = 0" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
15 |
"size_list (x # xs) = Suc (size_list xs)" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
16 |
by (auto simp add: size_list_def) |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
17 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
18 |
declare size_list_simps[code_pred_def] |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
19 |
declare size_list_def[symmetric, code_pred_inline] |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
20 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
21 |
|
43913 | 22 |
setup {* Context.theory_map (Quickcheck.add_tester ("prolog", (Code_Prolog.active, Code_Prolog.test_goals))) *} |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
23 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
24 |
datatype alphabet = a | b |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
25 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
26 |
inductive_set S\<^isub>1 and A\<^isub>1 and B\<^isub>1 where |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
27 |
"[] \<in> S\<^isub>1" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
28 |
| "w \<in> A\<^isub>1 \<Longrightarrow> b # w \<in> S\<^isub>1" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
29 |
| "w \<in> B\<^isub>1 \<Longrightarrow> a # w \<in> S\<^isub>1" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
30 |
| "w \<in> S\<^isub>1 \<Longrightarrow> a # w \<in> A\<^isub>1" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
31 |
| "w \<in> S\<^isub>1 \<Longrightarrow> b # w \<in> S\<^isub>1" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
32 |
| "\<lbrakk>v \<in> B\<^isub>1; v \<in> B\<^isub>1\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>1" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
33 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
34 |
lemma |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
35 |
"w \<in> S\<^isub>1 \<Longrightarrow> w = []" |
40924 | 36 |
quickcheck[tester = prolog, iterations=1, expect = counterexample] |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
37 |
oops |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
38 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
39 |
definition "filter_a = filter (\<lambda>x. x = a)" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
40 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
41 |
lemma [code_pred_def]: "filter_a [] = []" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
42 |
unfolding filter_a_def by simp |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
43 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
44 |
lemma [code_pred_def]: "filter_a (x#xs) = (if x = a then x # filter_a xs else filter_a xs)" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
45 |
unfolding filter_a_def by simp |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
46 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
47 |
declare filter_a_def[symmetric, code_pred_inline] |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
48 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
49 |
definition "filter_b = filter (\<lambda>x. x = b)" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
50 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
51 |
lemma [code_pred_def]: "filter_b [] = []" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
52 |
unfolding filter_b_def by simp |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
53 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
54 |
lemma [code_pred_def]: "filter_b (x#xs) = (if x = b then x # filter_b xs else filter_b xs)" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
55 |
unfolding filter_b_def by simp |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
56 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
57 |
declare filter_b_def[symmetric, code_pred_inline] |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
58 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
59 |
setup {* Code_Prolog.map_code_options (K |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
60 |
{ensure_groundness = true, |
39800 | 61 |
limit_globally = NONE, |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
62 |
limited_types = [], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
63 |
limited_predicates = [(["s1", "a1", "b1"], 2)], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
64 |
replacing = [(("s1", "limited_s1"), "quickcheck")], |
39463 | 65 |
manual_reorder = [(("quickcheck", 1), [0,2,1,4,3,5])]}) *} |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
66 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
67 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
68 |
theorem S\<^isub>1_sound: |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
69 |
"w \<in> S\<^isub>1 \<Longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]" |
40924 | 70 |
quickcheck[tester = prolog, iterations=1, expect = counterexample] |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
71 |
oops |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
72 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
73 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
74 |
inductive_set S\<^isub>2 and A\<^isub>2 and B\<^isub>2 where |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
75 |
"[] \<in> S\<^isub>2" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
76 |
| "w \<in> A\<^isub>2 \<Longrightarrow> b # w \<in> S\<^isub>2" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
77 |
| "w \<in> B\<^isub>2 \<Longrightarrow> a # w \<in> S\<^isub>2" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
78 |
| "w \<in> S\<^isub>2 \<Longrightarrow> a # w \<in> A\<^isub>2" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
79 |
| "w \<in> S\<^isub>2 \<Longrightarrow> b # w \<in> B\<^isub>2" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
80 |
| "\<lbrakk>v \<in> B\<^isub>2; v \<in> B\<^isub>2\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>2" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
81 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
82 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
83 |
setup {* Code_Prolog.map_code_options (K |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
84 |
{ensure_groundness = true, |
39800 | 85 |
limit_globally = NONE, |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
86 |
limited_types = [], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
87 |
limited_predicates = [(["s2", "a2", "b2"], 3)], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
88 |
replacing = [(("s2", "limited_s2"), "quickcheck")], |
39463 | 89 |
manual_reorder = [(("quickcheck", 1), [0,2,1,4,3,5])]}) *} |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
90 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
91 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
92 |
theorem S\<^isub>2_sound: |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
93 |
"w \<in> S\<^isub>2 \<longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]" |
40924 | 94 |
quickcheck[tester = prolog, iterations=1, expect = counterexample] |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
95 |
oops |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
96 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
97 |
inductive_set S\<^isub>3 and A\<^isub>3 and B\<^isub>3 where |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
98 |
"[] \<in> S\<^isub>3" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
99 |
| "w \<in> A\<^isub>3 \<Longrightarrow> b # w \<in> S\<^isub>3" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
100 |
| "w \<in> B\<^isub>3 \<Longrightarrow> a # w \<in> S\<^isub>3" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
101 |
| "w \<in> S\<^isub>3 \<Longrightarrow> a # w \<in> A\<^isub>3" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
102 |
| "w \<in> S\<^isub>3 \<Longrightarrow> b # w \<in> B\<^isub>3" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
103 |
| "\<lbrakk>v \<in> B\<^isub>3; w \<in> B\<^isub>3\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>3" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
104 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
105 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
106 |
setup {* Code_Prolog.map_code_options (K |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
107 |
{ensure_groundness = true, |
39800 | 108 |
limit_globally = NONE, |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
109 |
limited_types = [], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
110 |
limited_predicates = [(["s3", "a3", "b3"], 6)], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
111 |
replacing = [(("s3", "limited_s3"), "quickcheck")], |
39463 | 112 |
manual_reorder = [(("quickcheck", 1), [0,2,1,4,3,5])]}) *} |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
113 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
114 |
lemma S\<^isub>3_sound: |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
115 |
"w \<in> S\<^isub>3 \<longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]" |
40924 | 116 |
quickcheck[tester = prolog, iterations=1, size=1, expect = no_counterexample] |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
117 |
oops |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
118 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
119 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
120 |
(* |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
121 |
setup {* Code_Prolog.map_code_options (K |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
122 |
{ensure_groundness = true, |
39800 | 123 |
limit_globally = NONE, |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
124 |
limited_types = [], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
125 |
limited_predicates = [], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
126 |
replacing = [], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
127 |
manual_reorder = [], |
40301 | 128 |
timeout = seconds 10.0, |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
129 |
prolog_system = Code_Prolog.SWI_PROLOG}) *} |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
130 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
131 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
132 |
theorem S\<^isub>3_complete: |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
133 |
"length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b] \<longrightarrow> w \<in> S\<^isub>3" |
40924 | 134 |
quickcheck[tester = prolog, size=1, iterations=1] |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
135 |
oops |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
136 |
*) |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
137 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
138 |
inductive_set S\<^isub>4 and A\<^isub>4 and B\<^isub>4 where |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
139 |
"[] \<in> S\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
140 |
| "w \<in> A\<^isub>4 \<Longrightarrow> b # w \<in> S\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
141 |
| "w \<in> B\<^isub>4 \<Longrightarrow> a # w \<in> S\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
142 |
| "w \<in> S\<^isub>4 \<Longrightarrow> a # w \<in> A\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
143 |
| "\<lbrakk>v \<in> A\<^isub>4; w \<in> A\<^isub>4\<rbrakk> \<Longrightarrow> b # v @ w \<in> A\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
144 |
| "w \<in> S\<^isub>4 \<Longrightarrow> b # w \<in> B\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
145 |
| "\<lbrakk>v \<in> B\<^isub>4; w \<in> B\<^isub>4\<rbrakk> \<Longrightarrow> a # v @ w \<in> B\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
146 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
147 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
148 |
setup {* Code_Prolog.map_code_options (K |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
149 |
{ensure_groundness = true, |
39800 | 150 |
limit_globally = NONE, |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
151 |
limited_types = [], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
152 |
limited_predicates = [(["s4", "a4", "b4"], 6)], |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
153 |
replacing = [(("s4", "limited_s4"), "quickcheck")], |
39463 | 154 |
manual_reorder = [(("quickcheck", 1), [0,2,1,4,3,5])]}) *} |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
155 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
156 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
157 |
theorem S\<^isub>4_sound: |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
158 |
"w \<in> S\<^isub>4 \<longrightarrow> length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b]" |
40924 | 159 |
quickcheck[tester = prolog, size=1, iterations=1, expect = no_counterexample] |
38962
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
160 |
oops |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
161 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
162 |
(* |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
163 |
theorem S\<^isub>4_complete: |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
164 |
"length [x \<leftarrow> w. x = a] = length [x \<leftarrow> w. x = b] \<longrightarrow> w \<in> S\<^isub>4" |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
165 |
oops |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
166 |
*) |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
167 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
168 |
hide_const a b |
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
169 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
170 |
|
3917c2acaec4
adding further example for quickcheck with prolog code generation
bulwahn
parents:
diff
changeset
|
171 |
end |