src/HOL/Tools/Predicate_Compile/predicate_compile_quickcheck.ML
changeset 42361 23f352990944
parent 42159 234ec7011e5d
child 43886 bf068e758783
equal deleted inserted replaced
42360:da8817d01e7c 42361:23f352990944
   216   in (result, (description, Time.toMilliseconds cpu)) end
   216   in (result, (description, Time.toMilliseconds cpu)) end
   217 
   217 
   218 fun compile_term compilation options ctxt [(t, eval_terms)] =
   218 fun compile_term compilation options ctxt [(t, eval_terms)] =
   219   let
   219   let
   220     val t' = list_abs_free (Term.add_frees t [], t)
   220     val t' = list_abs_free (Term.add_frees t [], t)
   221     val thy = Theory.copy (ProofContext.theory_of ctxt)
   221     val thy = Theory.copy (Proof_Context.theory_of ctxt)
   222     val ((((full_constname, constT), vs'), intro), thy1) =
   222     val ((((full_constname, constT), vs'), intro), thy1) =
   223       Predicate_Compile_Aux.define_quickcheck_predicate t' thy
   223       Predicate_Compile_Aux.define_quickcheck_predicate t' thy
   224     val thy2 = Context.theory_map (Predicate_Compile_Alternative_Defs.add_thm intro) thy1
   224     val thy2 = Context.theory_map (Predicate_Compile_Alternative_Defs.add_thm intro) thy1
   225     val (thy3, preproc_time) = cpu_time "predicate preprocessing"
   225     val (thy3, preproc_time) = cpu_time "predicate preprocessing"
   226         (fn () => Predicate_Compile.preprocess options (Const (full_constname, constT)) thy2)
   226         (fn () => Predicate_Compile.preprocess options (Const (full_constname, constT)) thy2)
   236           (*| Depth_Limited_Random =>
   236           (*| Depth_Limited_Random =>
   237               Predicate_Compile_Core.add_depth_limited_random_equations options [full_constname] thy3*))
   237               Predicate_Compile_Core.add_depth_limited_random_equations options [full_constname] thy3*))
   238     (*val _ = Predicate_Compile_Core.print_all_modes compilation thy4*)
   238     (*val _ = Predicate_Compile_Core.print_all_modes compilation thy4*)
   239     val _ = Output.tracing ("Preprocessing time: " ^ string_of_int (snd preproc_time))
   239     val _ = Output.tracing ("Preprocessing time: " ^ string_of_int (snd preproc_time))
   240     val _ = Output.tracing ("Core compilation time: " ^ string_of_int (snd core_comp_time))
   240     val _ = Output.tracing ("Core compilation time: " ^ string_of_int (snd core_comp_time))
   241     val ctxt4 = ProofContext.init_global thy4
   241     val ctxt4 = Proof_Context.init_global thy4
   242     val modes = Core_Data.modes_of compilation ctxt4 full_constname
   242     val modes = Core_Data.modes_of compilation ctxt4 full_constname
   243     val output_mode = fold_rev (curry Fun) (map (K Output) (binder_types constT)) Bool
   243     val output_mode = fold_rev (curry Fun) (map (K Output) (binder_types constT)) Bool
   244     val prog =
   244     val prog =
   245       if member eq_mode modes output_mode then
   245       if member eq_mode modes output_mode then
   246         let
   246         let