migration from code_(const|type|class|instance) to code_printing and from code_module to code_identifier
1 (* Author: Lukas Bulwahn, TU Muenchen *)
3 header {* A simple counterexample generator performing exhaustive testing *}
5 theory Quickcheck_Exhaustive
6 imports Quickcheck_Random
7 keywords "quickcheck_generator" :: thy_decl
10 subsection {* basic operations for exhaustive generators *}
12 definition orelse :: "'a option => 'a option => 'a option" (infixr "orelse" 55)
14 [code_unfold]: "x orelse y = (case x of Some x' => Some x' | None => y)"
16 subsection {* exhaustive generator type classes *}
18 class exhaustive = term_of +
19 fixes exhaustive :: "('a \<Rightarrow> (bool * term list) option) \<Rightarrow> natural \<Rightarrow> (bool * term list) option"
21 class full_exhaustive = term_of +
22 fixes full_exhaustive :: "('a * (unit => term) \<Rightarrow> (bool * term list) option) \<Rightarrow> natural \<Rightarrow> (bool * term list) option"
24 instantiation natural :: full_exhaustive
27 function full_exhaustive_natural' :: "(natural * (unit => term) => (bool * term list) option) => natural => natural => (bool * term list) option"
28 where "full_exhaustive_natural' f d i =
30 else (f (i, %_. Code_Evaluation.term_of i)) orelse (full_exhaustive_natural' f d (i + 1)))"
31 by pat_completeness auto
34 by (relation "measure (%(_, d, i). nat_of_natural (d + 1 - i))")
35 (auto simp add: less_natural_def)
37 definition "full_exhaustive f d = full_exhaustive_natural' f d 0"
43 instantiation natural :: exhaustive
46 function exhaustive_natural' :: "(natural => (bool * term list) option) => natural => natural => (bool * term list) option"
47 where "exhaustive_natural' f d i =
49 else (f i orelse exhaustive_natural' f d (i + 1)))"
50 by pat_completeness auto
53 by (relation "measure (%(_, d, i). nat_of_natural (d + 1 - i))")
54 (auto simp add: less_natural_def)
56 definition "exhaustive f d = exhaustive_natural' f d 0"
62 instantiation integer :: exhaustive
65 function exhaustive_integer' :: "(integer => (bool * term list) option) => integer => integer => (bool * term list) option"
66 where "exhaustive_integer' f d i = (if d < i then None else (f i orelse exhaustive_integer' f d (i + 1)))"
67 by pat_completeness auto
70 by (relation "measure (%(_, d, i). nat_of_integer (d + 1 - i))")
71 (auto simp add: less_integer_def nat_of_integer_def)
73 definition "exhaustive f d = exhaustive_integer' f (integer_of_natural d) (- (integer_of_natural d))"
79 instantiation integer :: full_exhaustive
82 function full_exhaustive_integer' :: "(integer * (unit => term) => (bool * term list) option) => integer => integer => (bool * term list) option"
83 where "full_exhaustive_integer' f d i = (if d < i then None else (case f (i, %_. Code_Evaluation.term_of i) of Some t => Some t | None => full_exhaustive_integer' f d (i + 1)))"
84 by pat_completeness auto
87 by (relation "measure (%(_, d, i). nat_of_integer (d + 1 - i))")
88 (auto simp add: less_integer_def nat_of_integer_def)
90 definition "full_exhaustive f d = full_exhaustive_integer' f (integer_of_natural d) (- (integer_of_natural d))"
96 instantiation nat :: exhaustive
99 definition "exhaustive f d = exhaustive (%x. f (nat_of_natural x)) d"
105 instantiation nat :: full_exhaustive
108 definition "full_exhaustive f d = full_exhaustive (%(x, xt). f (nat_of_natural x, %_. Code_Evaluation.term_of (nat_of_natural x))) d"
114 instantiation int :: exhaustive
117 function exhaustive_int' :: "(int => (bool * term list) option) => int => int => (bool * term list) option"
118 where "exhaustive_int' f d i = (if d < i then None else (f i orelse exhaustive_int' f d (i + 1)))"
119 by pat_completeness auto
122 by (relation "measure (%(_, d, i). nat (d + 1 - i))") auto
124 definition "exhaustive f d = exhaustive_int' f (int_of_integer (integer_of_natural d))
125 (- (int_of_integer (integer_of_natural d)))"
131 instantiation int :: full_exhaustive
134 function full_exhaustive_int' :: "(int * (unit => term) => (bool * term list) option) => int => int => (bool * term list) option"
135 where "full_exhaustive_int' f d i = (if d < i then None else (case f (i, %_. Code_Evaluation.term_of i) of Some t => Some t | None => full_exhaustive_int' f d (i + 1)))"
136 by pat_completeness auto
139 by (relation "measure (%(_, d, i). nat (d + 1 - i))") auto
141 definition "full_exhaustive f d = full_exhaustive_int' f (int_of_integer (integer_of_natural d))
142 (- (int_of_integer (integer_of_natural d)))"
148 instantiation prod :: (exhaustive, exhaustive) exhaustive
152 "exhaustive f d = exhaustive (%x. exhaustive (%y. f ((x, y))) d) d"
158 definition (in term_syntax) [code_unfold]: "valtermify_pair x y = Code_Evaluation.valtermify (Pair :: 'a :: typerep => 'b :: typerep => 'a * 'b) {\<cdot>} x {\<cdot>} y"
160 instantiation prod :: (full_exhaustive, full_exhaustive) full_exhaustive
164 "full_exhaustive f d = full_exhaustive (%x. full_exhaustive (%y. f (valtermify_pair x y)) d) d"
170 instantiation set :: (exhaustive) exhaustive
175 "exhaustive_set f i = (if i = 0 then None else (f {} orelse exhaustive_set (%A. f A orelse exhaustive (%x. if x \<in> A then None else f (insert x A)) (i - 1)) (i - 1)))"
181 instantiation set :: (full_exhaustive) full_exhaustive
184 fun full_exhaustive_set
186 "full_exhaustive_set f i = (if i = 0 then None else (f valterm_emptyset orelse full_exhaustive_set (%A. f A orelse Quickcheck_Exhaustive.full_exhaustive (%x. if fst x \<in> fst A then None else f (valtermify_insert x A)) (i - 1)) (i - 1)))"
192 instantiation "fun" :: ("{equal, exhaustive}", exhaustive) exhaustive
195 fun exhaustive_fun' :: "(('a => 'b) => (bool * term list) option) => natural => natural => (bool * term list) option"
197 "exhaustive_fun' f i d = (exhaustive (%b. f (%_. b)) d)
198 orelse (if i > 1 then
199 exhaustive_fun' (%g. exhaustive (%a. exhaustive (%b.
200 f (g(a := b))) d) d) (i - 1) d else None)"
202 definition exhaustive_fun :: "(('a => 'b) => (bool * term list) option) => natural => (bool * term list) option"
204 "exhaustive_fun f d = exhaustive_fun' f d d"
210 definition [code_unfold]: "valtermify_absdummy = (%(v, t). (%_::'a. v, %u::unit. Code_Evaluation.Abs (STR ''x'') (Typerep.typerep TYPE('a::typerep)) (t ())))"
212 definition (in term_syntax) [code_unfold]: "valtermify_fun_upd g a b = Code_Evaluation.valtermify (fun_upd :: ('a :: typerep => 'b :: typerep) => 'a => 'b => 'a => 'b) {\<cdot>} g {\<cdot>} a {\<cdot>} b"
214 instantiation "fun" :: ("{equal, full_exhaustive}", full_exhaustive) full_exhaustive
217 fun full_exhaustive_fun' :: "(('a => 'b) * (unit => term) => (bool * term list) option) => natural => natural => (bool * term list) option"
219 "full_exhaustive_fun' f i d = (full_exhaustive (%v. f (valtermify_absdummy v)) d)
220 orelse (if i > 1 then
221 full_exhaustive_fun' (%g. full_exhaustive (%a. full_exhaustive (%b.
222 f (valtermify_fun_upd g a b)) d) d) (i - 1) d else None)"
224 definition full_exhaustive_fun :: "(('a => 'b) * (unit => term) => (bool * term list) option) => natural => (bool * term list) option"
226 "full_exhaustive_fun f d = full_exhaustive_fun' f d d"
232 subsubsection {* A smarter enumeration scheme for functions over finite datatypes *}
234 class check_all = enum + term_of +
235 fixes check_all :: "('a * (unit \<Rightarrow> term) \<Rightarrow> (bool * term list) option) \<Rightarrow> (bool * term list) option"
236 fixes enum_term_of :: "'a itself \<Rightarrow> unit \<Rightarrow> term list"
238 fun check_all_n_lists :: "(('a :: check_all) list * (unit \<Rightarrow> term list) \<Rightarrow> (bool * term list) option) \<Rightarrow> natural \<Rightarrow> (bool * term list) option"
240 "check_all_n_lists f n =
241 (if n = 0 then f ([], (%_. [])) else check_all (%(x, xt). check_all_n_lists (%(xs, xst). f ((x # xs), (%_. (xt () # xst ())))) (n - 1)))"
243 definition (in term_syntax) [code_unfold]: "termify_fun_upd g a b = (Code_Evaluation.termify (fun_upd :: ('a :: typerep => 'b :: typerep) => 'a => 'b => 'a => 'b) <\<cdot>> g <\<cdot>> a <\<cdot>> b)"
245 definition mk_map_term :: " (unit \<Rightarrow> typerep) \<Rightarrow> (unit \<Rightarrow> typerep) \<Rightarrow> (unit \<Rightarrow> term list) \<Rightarrow> (unit \<Rightarrow> term list) \<Rightarrow> unit \<Rightarrow> term"
247 "mk_map_term T1 T2 domm rng =
250 update_term = (%g (a, b).
251 Code_Evaluation.App (Code_Evaluation.App (Code_Evaluation.App
252 (Code_Evaluation.Const (STR ''Fun.fun_upd'')
253 (Typerep.Typerep (STR ''fun'') [Typerep.Typerep (STR ''fun'') [T1, T2],
254 Typerep.Typerep (STR ''fun'') [T1,
255 Typerep.Typerep (STR ''fun'') [T2, Typerep.Typerep (STR ''fun'') [T1, T2]]]]))
258 List.foldl update_term (Code_Evaluation.Abs (STR ''x'') T1 (Code_Evaluation.Const (STR ''HOL.undefined'') T2)) (zip (domm ()) (rng ())))"
260 instantiation "fun" :: ("{equal, check_all}", check_all) check_all
266 mk_term = mk_map_term (%_. Typerep.typerep (TYPE('a))) (%_. Typerep.typerep (TYPE('b))) (enum_term_of (TYPE('a)));
267 enum = (Enum.enum :: 'a list)
268 in check_all_n_lists (\<lambda>(ys, yst). f (the o map_of (zip enum ys), mk_term yst)) (natural_of_nat (length enum)))"
270 definition enum_term_of_fun :: "('a => 'b) itself => unit => term list"
272 "enum_term_of_fun = (%_ _. let
273 enum_term_of_a = enum_term_of (TYPE('a));
274 mk_term = mk_map_term (%_. Typerep.typerep (TYPE('a))) (%_. Typerep.typerep (TYPE('b))) enum_term_of_a
275 in map (%ys. mk_term (%_. ys) ()) (List.n_lists (length (enum_term_of_a ())) (enum_term_of (TYPE('b)) ())))"
281 fun (in term_syntax) check_all_subsets :: "(('a :: typerep) set * (unit => term) => (bool * term list) option) => ('a * (unit => term)) list => (bool * term list) option"
283 "check_all_subsets f [] = f valterm_emptyset"
284 | "check_all_subsets f (x # xs) = check_all_subsets (%s. case f s of Some ts => Some ts | None => f (valtermify_insert x s)) xs"
287 definition (in term_syntax) [code_unfold]: "term_emptyset = Code_Evaluation.termify ({} :: ('a :: typerep) set)"
288 definition (in term_syntax) [code_unfold]: "termify_insert x s = Code_Evaluation.termify (insert :: ('a::typerep) => 'a set => 'a set) <\<cdot>> x <\<cdot>> s"
290 definition (in term_syntax) setify :: "('a::typerep) itself => term list => term"
292 "setify T ts = foldr (termify_insert T) ts (term_emptyset T)"
294 instantiation set :: (check_all) check_all
299 check_all_subsets f (zip (Enum.enum :: 'a list) (map (%a. %u :: unit. a) (Quickcheck_Exhaustive.enum_term_of (TYPE ('a)) ())))"
301 definition enum_term_of_set :: "'a set itself => unit => term list"
303 "enum_term_of_set _ _ = map (setify (TYPE('a))) (sublists (Quickcheck_Exhaustive.enum_term_of (TYPE('a)) ()))"
309 instantiation unit :: check_all
313 "check_all f = f (Code_Evaluation.valtermify ())"
315 definition enum_term_of_unit :: "unit itself => unit => term list"
317 "enum_term_of_unit = (%_ _. [Code_Evaluation.term_of ()])"
324 instantiation bool :: check_all
328 "check_all f = (case f (Code_Evaluation.valtermify False) of Some x' \<Rightarrow> Some x' | None \<Rightarrow> f (Code_Evaluation.valtermify True))"
330 definition enum_term_of_bool :: "bool itself => unit => term list"
332 "enum_term_of_bool = (%_ _. map Code_Evaluation.term_of (Enum.enum :: bool list))"
338 definition (in term_syntax) [code_unfold]: "termify_pair x y = Code_Evaluation.termify (Pair :: 'a :: typerep => 'b :: typerep => 'a * 'b) <\<cdot>> x <\<cdot>> y"
340 instantiation prod :: (check_all, check_all) check_all
344 "check_all f = check_all (%x. check_all (%y. f (valtermify_pair x y)))"
346 definition enum_term_of_prod :: "('a * 'b) itself => unit => term list"
348 "enum_term_of_prod = (%_ _. map (%(x, y). termify_pair TYPE('a) TYPE('b) x y)
349 (List.product (enum_term_of (TYPE('a)) ()) (enum_term_of (TYPE('b)) ())))"
355 definition (in term_syntax) [code_unfold]: "valtermify_Inl x = Code_Evaluation.valtermify (Inl :: 'a :: typerep => 'a + 'b :: typerep) {\<cdot>} x"
356 definition (in term_syntax) [code_unfold]: "valtermify_Inr x = Code_Evaluation.valtermify (Inr :: 'b :: typerep => 'a ::typerep + 'b) {\<cdot>} x"
358 instantiation sum :: (check_all, check_all) check_all
362 "check_all f = check_all (%a. f (valtermify_Inl a)) orelse check_all (%b. f (valtermify_Inr b))"
364 definition enum_term_of_sum :: "('a + 'b) itself => unit => term list"
366 "enum_term_of_sum = (%_ _.
368 T1 = (Typerep.typerep (TYPE('a)));
369 T2 = (Typerep.typerep (TYPE('b)))
371 map (Code_Evaluation.App (Code_Evaluation.Const (STR ''Sum_Type.Inl'')
372 (Typerep.Typerep (STR ''fun'') [T1, Typerep.Typerep (STR ''Sum_Type.sum'') [T1, T2]])))
373 (enum_term_of (TYPE('a)) ()) @
374 map (Code_Evaluation.App (Code_Evaluation.Const (STR ''Sum_Type.Inr'')
375 (Typerep.Typerep (STR ''fun'') [T2, Typerep.Typerep (STR ''Sum_Type.sum'') [T1, T2]])))
376 (enum_term_of (TYPE('b)) ()))"
382 instantiation nibble :: check_all
387 f (Code_Evaluation.valtermify Nibble0) orelse
388 f (Code_Evaluation.valtermify Nibble1) orelse
389 f (Code_Evaluation.valtermify Nibble2) orelse
390 f (Code_Evaluation.valtermify Nibble3) orelse
391 f (Code_Evaluation.valtermify Nibble4) orelse
392 f (Code_Evaluation.valtermify Nibble5) orelse
393 f (Code_Evaluation.valtermify Nibble6) orelse
394 f (Code_Evaluation.valtermify Nibble7) orelse
395 f (Code_Evaluation.valtermify Nibble8) orelse
396 f (Code_Evaluation.valtermify Nibble9) orelse
397 f (Code_Evaluation.valtermify NibbleA) orelse
398 f (Code_Evaluation.valtermify NibbleB) orelse
399 f (Code_Evaluation.valtermify NibbleC) orelse
400 f (Code_Evaluation.valtermify NibbleD) orelse
401 f (Code_Evaluation.valtermify NibbleE) orelse
402 f (Code_Evaluation.valtermify NibbleF)"
404 definition enum_term_of_nibble :: "nibble itself => unit => term list"
406 "enum_term_of_nibble = (%_ _. map Code_Evaluation.term_of (Enum.enum :: nibble list))"
413 instantiation char :: check_all
417 "check_all f = check_all (%(x, t1). check_all (%(y, t2). f (Char x y, %_. Code_Evaluation.App (Code_Evaluation.App (Code_Evaluation.term_of Char) (t1 ())) (t2 ()))))"
419 definition enum_term_of_char :: "char itself => unit => term list"
421 "enum_term_of_char = (%_ _. map Code_Evaluation.term_of (Enum.enum :: char list))"
428 instantiation option :: (check_all) check_all
432 "check_all f = f (Code_Evaluation.valtermify (None :: 'a option)) orelse check_all (%(x, t). f (Some x, %_. Code_Evaluation.App
433 (Code_Evaluation.Const (STR ''Option.option.Some'')
434 (Typerep.Typerep (STR ''fun'') [Typerep.typerep TYPE('a), Typerep.Typerep (STR ''Option.option'') [Typerep.typerep TYPE('a)]])) (t ())))"
436 definition enum_term_of_option :: "'a option itself => unit => term list"
438 "enum_term_of_option = (% _ _. (Code_Evaluation.term_of (None :: 'a option)) # (map (Code_Evaluation.App (Code_Evaluation.Const (STR ''Option.option.Some'')
439 (Typerep.Typerep (STR ''fun'') [Typerep.typerep TYPE('a), Typerep.Typerep (STR ''Option.option'') [Typerep.typerep TYPE('a)]]))) (enum_term_of (TYPE('a)) ())))"
446 instantiation Enum.finite_1 :: check_all
450 "check_all f = f (Code_Evaluation.valtermify Enum.finite_1.a\<^isub>1)"
452 definition enum_term_of_finite_1 :: "Enum.finite_1 itself => unit => term list"
454 "enum_term_of_finite_1 = (%_ _. [Code_Evaluation.term_of Enum.finite_1.a\<^isub>1])"
460 instantiation Enum.finite_2 :: check_all
464 "check_all f = (f (Code_Evaluation.valtermify Enum.finite_2.a\<^isub>1)
465 orelse f (Code_Evaluation.valtermify Enum.finite_2.a\<^isub>2))"
467 definition enum_term_of_finite_2 :: "Enum.finite_2 itself => unit => term list"
469 "enum_term_of_finite_2 = (%_ _. map Code_Evaluation.term_of (Enum.enum :: Enum.finite_2 list))"
475 instantiation Enum.finite_3 :: check_all
479 "check_all f = (f (Code_Evaluation.valtermify Enum.finite_3.a\<^isub>1)
480 orelse f (Code_Evaluation.valtermify Enum.finite_3.a\<^isub>2)
481 orelse f (Code_Evaluation.valtermify Enum.finite_3.a\<^isub>3))"
483 definition enum_term_of_finite_3 :: "Enum.finite_3 itself => unit => term list"
485 "enum_term_of_finite_3 = (%_ _. map Code_Evaluation.term_of (Enum.enum :: Enum.finite_3 list))"
491 instantiation Enum.finite_4 :: check_all
495 "check_all f = (f (Code_Evaluation.valtermify Enum.finite_4.a\<^isub>1)
496 orelse f (Code_Evaluation.valtermify Enum.finite_4.a\<^isub>2)
497 orelse f (Code_Evaluation.valtermify Enum.finite_4.a\<^isub>3)
498 orelse f (Code_Evaluation.valtermify Enum.finite_4.a\<^isub>4))"
500 definition enum_term_of_finite_4 :: "Enum.finite_4 itself => unit => term list"
502 "enum_term_of_finite_4 = (%_ _. map Code_Evaluation.term_of (Enum.enum :: Enum.finite_4 list))"
508 subsection {* Bounded universal quantifiers *}
510 class bounded_forall =
511 fixes bounded_forall :: "('a \<Rightarrow> bool) \<Rightarrow> natural \<Rightarrow> bool"
513 subsection {* Fast exhaustive combinators *}
515 class fast_exhaustive = term_of +
516 fixes fast_exhaustive :: "('a \<Rightarrow> unit) \<Rightarrow> natural \<Rightarrow> unit"
518 axiomatization throw_Counterexample :: "term list => unit"
519 axiomatization catch_Counterexample :: "unit => term list option"
522 constant throw_Counterexample \<rightharpoonup>
523 (Quickcheck) "raise (Exhaustive'_Generators.Counterexample _)"
524 | constant catch_Counterexample \<rightharpoonup>
525 (Quickcheck) "(((_); NONE) handle Exhaustive'_Generators.Counterexample ts => SOME ts)"
527 subsection {* Continuation passing style functions as plus monad *}
529 type_synonym 'a cps = "('a => term list option) => term list option"
531 definition cps_empty :: "'a cps"
533 "cps_empty = (%cont. None)"
535 definition cps_single :: "'a => 'a cps"
537 "cps_single v = (%cont. cont v)"
539 definition cps_bind :: "'a cps => ('a => 'b cps) => 'b cps"
541 "cps_bind m f = (%cont. m (%a. (f a) cont))"
543 definition cps_plus :: "'a cps => 'a cps => 'a cps"
545 "cps_plus a b = (%c. case a c of None => b c | Some x => Some x)"
547 definition cps_if :: "bool => unit cps"
549 "cps_if b = (if b then cps_single () else cps_empty)"
551 definition cps_not :: "unit cps => unit cps"
553 "cps_not n = (%c. case n (%u. Some []) of None => c () | Some _ => None)"
555 type_synonym 'a pos_bound_cps = "('a => (bool * term list) option) => natural => (bool * term list) option"
557 definition pos_bound_cps_empty :: "'a pos_bound_cps"
559 "pos_bound_cps_empty = (%cont i. None)"
561 definition pos_bound_cps_single :: "'a => 'a pos_bound_cps"
563 "pos_bound_cps_single v = (%cont i. cont v)"
565 definition pos_bound_cps_bind :: "'a pos_bound_cps => ('a => 'b pos_bound_cps) => 'b pos_bound_cps"
567 "pos_bound_cps_bind m f = (%cont i. if i = 0 then None else (m (%a. (f a) cont i) (i - 1)))"
569 definition pos_bound_cps_plus :: "'a pos_bound_cps => 'a pos_bound_cps => 'a pos_bound_cps"
571 "pos_bound_cps_plus a b = (%c i. case a c i of None => b c i | Some x => Some x)"
573 definition pos_bound_cps_if :: "bool => unit pos_bound_cps"
575 "pos_bound_cps_if b = (if b then pos_bound_cps_single () else pos_bound_cps_empty)"
577 datatype 'a unknown = Unknown | Known 'a
578 datatype 'a three_valued = Unknown_value | Value 'a | No_value
580 type_synonym 'a neg_bound_cps = "('a unknown => term list three_valued) => natural => term list three_valued"
582 definition neg_bound_cps_empty :: "'a neg_bound_cps"
584 "neg_bound_cps_empty = (%cont i. No_value)"
586 definition neg_bound_cps_single :: "'a => 'a neg_bound_cps"
588 "neg_bound_cps_single v = (%cont i. cont (Known v))"
590 definition neg_bound_cps_bind :: "'a neg_bound_cps => ('a => 'b neg_bound_cps) => 'b neg_bound_cps"
592 "neg_bound_cps_bind m f = (%cont i. if i = 0 then cont Unknown else m (%a. case a of Unknown => cont Unknown | Known a' => f a' cont i) (i - 1))"
594 definition neg_bound_cps_plus :: "'a neg_bound_cps => 'a neg_bound_cps => 'a neg_bound_cps"
596 "neg_bound_cps_plus a b = (%c i. case a c i of No_value => b c i | Value x => Value x | Unknown_value => (case b c i of No_value => Unknown_value | Value x => Value x | Unknown_value => Unknown_value))"
598 definition neg_bound_cps_if :: "bool => unit neg_bound_cps"
600 "neg_bound_cps_if b = (if b then neg_bound_cps_single () else neg_bound_cps_empty)"
602 definition neg_bound_cps_not :: "unit pos_bound_cps => unit neg_bound_cps"
604 "neg_bound_cps_not n = (%c i. case n (%u. Some (True, [])) i of None => c (Known ()) | Some _ => No_value)"
606 definition pos_bound_cps_not :: "unit neg_bound_cps => unit pos_bound_cps"
608 "pos_bound_cps_not n = (%c i. case n (%u. Value []) i of No_value => c () | Value _ => None | Unknown_value => None)"
610 subsection {* Defining generators for any first-order data type *}
612 axiomatization unknown :: 'a
614 notation (output) unknown ("?")
616 ML_file "Tools/Quickcheck/exhaustive_generators.ML"
618 setup {* Exhaustive_Generators.setup *}
620 declare [[quickcheck_batch_tester = exhaustive]]
622 subsection {* Defining generators for abstract types *}
624 ML_file "Tools/Quickcheck/abstract_generators.ML"
626 hide_fact (open) orelse_def
627 no_notation orelse (infixr "orelse" 55)
631 exhaustive_integer'_def
632 exhaustive_natural'_def
634 hide_const valtermify_absdummy valtermify_fun_upd valterm_emptyset valtermify_insert valtermify_pair
635 valtermify_Inl valtermify_Inr
636 termify_fun_upd term_emptyset termify_insert termify_pair setify
639 exhaustive full_exhaustive
640 exhaustive_int' full_exhaustive_int'
641 exhaustive_integer' full_exhaustive_integer'
642 exhaustive_natural' full_exhaustive_natural'
643 throw_Counterexample catch_Counterexample
644 check_all enum_term_of
645 orelse unknown mk_map_term check_all_n_lists check_all_subsets
647 hide_type (open) cps pos_bound_cps neg_bound_cps unknown three_valued
648 hide_const (open) cps_empty cps_single cps_bind cps_plus cps_if cps_not
649 pos_bound_cps_empty pos_bound_cps_single pos_bound_cps_bind pos_bound_cps_plus pos_bound_cps_if pos_bound_cps_not
650 neg_bound_cps_empty neg_bound_cps_single neg_bound_cps_bind neg_bound_cps_plus neg_bound_cps_if neg_bound_cps_not
651 Unknown Known Unknown_value Value No_value