src/HOL/Predicate_Compile_Examples/List_Examples.thy
author wenzelm
Sun, 28 Nov 2010 14:01:20 +0100
changeset 40781 ba5be5c3d477
parent 40137 9eabcb1bfe50
child 40924 a9be7f26b4e6
permissions -rw-r--r--
updated versions;

theory List_Examples
imports Main "Predicate_Compile_Quickcheck" "Code_Prolog"
begin

setup {* Context.theory_map (Quickcheck.add_generator ("prolog", Code_Prolog.quickcheck)) *}

setup {* Code_Prolog.map_code_options (K 
  {ensure_groundness = true,
   limit_globally = NONE,
   limited_types = [(@{typ nat}, 2), (@{typ "nat list"}, 4)],
   limited_predicates = [(["appendP"], 4), (["revP"], 4)],
   replacing =
     [(("appendP", "limited_appendP"), "quickcheck"),
      (("revP", "limited_revP"), "quickcheck"),
      (("appendP", "limited_appendP"), "lim_revP")],
   manual_reorder = []}) *}

lemma "(xs :: nat list) = ys @ ys --> rev xs = xs"
quickcheck[generator = code, iterations = 10000]
quickcheck[generator = predicate_compile_wo_ff, iterations = 1, expect = counterexample]
quickcheck[generator = prolog, expect = counterexample]
oops

end