src/HOL/Tools/Quickcheck/narrowing_generators.ML
changeset 42028 bd6515e113b2
parent 42027 5e40c152c396
child 42039 cef738d55348
equal deleted inserted replaced
42027:5e40c152c396 42028:bd6515e113b2
   214   end
   214   end
   215 
   215 
   216 fun compile_generator_expr ctxt (t, eval_terms) size =
   216 fun compile_generator_expr ctxt (t, eval_terms) size =
   217   let
   217   let
   218     val thy = ProofContext.theory_of ctxt
   218     val thy = ProofContext.theory_of ctxt
   219     val t' = if Config.get ctxt finite_functions then finitize_functions t else t
   219     val t' = list_abs_free (Term.add_frees t [], t)
       
   220     val t'' = if Config.get ctxt finite_functions then finitize_functions t' else t'
   220     fun ensure_testable t =
   221     fun ensure_testable t =
   221       Const (@{const_name Quickcheck_Narrowing.ensure_testable}, fastype_of t --> fastype_of t) $ t
   222       Const (@{const_name Quickcheck_Narrowing.ensure_testable}, fastype_of t --> fastype_of t) $ t
   222     val result = dynamic_value_strict
   223     val result = dynamic_value_strict
   223       (Counterexample.get, Counterexample.put, "Narrowing_Generators.put_counterexample")
   224       (Counterexample.get, Counterexample.put, "Narrowing_Generators.put_counterexample")
   224       thy (Option.map o map) (ensure_testable t') [] size
   225       thy (Option.map o map) (ensure_testable t'') [] size
   225   in
   226   in
   226     (result, NONE)
   227     (result, NONE)
   227   end;
   228   end;
   228 
   229 
   229 
   230