author | wenzelm |
Sat, 27 Nov 2010 14:32:08 +0100 | |
changeset 40742 | dc6439c0b8b1 |
parent 40137 | 9eabcb1bfe50 |
child 40924 | a9be7f26b4e6 |
permissions | -rw-r--r-- |
39184
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
1 |
theory List_Examples |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
2 |
imports Main "Predicate_Compile_Quickcheck" "Code_Prolog" |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
3 |
begin |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
4 |
|
39463 | 5 |
setup {* Context.theory_map (Quickcheck.add_generator ("prolog", Code_Prolog.quickcheck)) *} |
39184
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
6 |
|
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
7 |
setup {* Code_Prolog.map_code_options (K |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
8 |
{ensure_groundness = true, |
39800 | 9 |
limit_globally = NONE, |
39184
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
10 |
limited_types = [(@{typ nat}, 2), (@{typ "nat list"}, 4)], |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
11 |
limited_predicates = [(["appendP"], 4), (["revP"], 4)], |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
12 |
replacing = |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
13 |
[(("appendP", "limited_appendP"), "quickcheck"), |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
14 |
(("revP", "limited_revP"), "quickcheck"), |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
15 |
(("appendP", "limited_appendP"), "lim_revP")], |
39463 | 16 |
manual_reorder = []}) *} |
39184
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
17 |
|
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
18 |
lemma "(xs :: nat list) = ys @ ys --> rev xs = xs" |
40137
9eabcb1bfe50
changing test parameters in examples to get to a result within the global timelimit
bulwahn
parents:
39800
diff
changeset
|
19 |
quickcheck[generator = code, iterations = 10000] |
39184
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
20 |
quickcheck[generator = predicate_compile_wo_ff, iterations = 1, expect = counterexample] |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
21 |
quickcheck[generator = prolog, expect = counterexample] |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
22 |
oops |
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
23 |
|
71f3f194b962
adding a List example (challenge from Tobias) for counterexample search
bulwahn
parents:
diff
changeset
|
24 |
end |