src/HOL/Mutabelle/mutabelle.ML
changeset 36610 bafd82950e24
parent 35845 e5980f0ad025
child 36692 54b64d4ad524
equal deleted inserted replaced
36609:6ed6112f0a95 36610:bafd82950e24
   497 fun preprocess thy insts t = Object_Logic.atomize_term thy
   497 fun preprocess thy insts t = Object_Logic.atomize_term thy
   498  (map_types (inst_type insts) (freeze t));
   498  (map_types (inst_type insts) (freeze t));
   499 
   499 
   500 fun is_executable thy insts th =
   500 fun is_executable thy insts th =
   501  (Quickcheck.test_term
   501  (Quickcheck.test_term
   502     (ProofContext.init thy) false (SOME (!testgen_name)) 1 1 (preprocess thy insts (prop_of th));
   502     (ProofContext.init_global thy) false (SOME (!testgen_name)) 1 1 (preprocess thy insts (prop_of th));
   503   priority "executable"; true) handle ERROR s =>
   503   priority "executable"; true) handle ERROR s =>
   504     (priority ("not executable: " ^ s); false);
   504     (priority ("not executable: " ^ s); false);
   505 
   505 
   506 fun qc_recursive usedthy [] insts sz qciter acc = rev acc
   506 fun qc_recursive usedthy [] insts sz qciter acc = rev acc
   507  | qc_recursive usedthy (x::xs) insts sz qciter acc = qc_recursive usedthy xs insts sz qciter 
   507  | qc_recursive usedthy (x::xs) insts sz qciter acc = qc_recursive usedthy xs insts sz qciter 
   508      (priority ("qc_recursive: " ^ string_of_int (length xs)); ((x, pretty (the_default [] (Quickcheck.test_term
   508      (priority ("qc_recursive: " ^ string_of_int (length xs)); ((x, pretty (the_default [] (Quickcheck.test_term
   509        (ProofContext.init usedthy) false (SOME (!testgen_name)) sz qciter (preprocess usedthy insts x)))) :: acc))
   509        (ProofContext.init_global usedthy) false (SOME (!testgen_name)) sz qciter (preprocess usedthy insts x)))) :: acc))
   510           handle ERROR msg => (priority msg; qc_recursive usedthy xs insts sz qciter acc);
   510           handle ERROR msg => (priority msg; qc_recursive usedthy xs insts sz qciter acc);
   511 
   511 
   512 
   512 
   513 (*quickcheck-test the mutants created by function mutate with type-instantiation insts, 
   513 (*quickcheck-test the mutants created by function mutate with type-instantiation insts, 
   514 quickcheck-theory usedthy and qciter quickcheck-iterations *)
   514 quickcheck-theory usedthy and qciter quickcheck-iterations *)