src/HOL/Mutabelle/mutabelle_extra.ML
changeset 41491 a2ad5b824051
parent 41409 0bc364f772ef
child 41755 404d94506599
equal deleted inserted replaced
41490:0f1e411a1448 41491:a2ad5b824051
   397              |> filter_out is_forbidden_mutant
   397              |> filter_out is_forbidden_mutant
   398     val mutants =
   398     val mutants =
   399       if exec then
   399       if exec then
   400         let
   400         let
   401           val _ = Output.urgent_message ("BEFORE PARTITION OF " ^
   401           val _ = Output.urgent_message ("BEFORE PARTITION OF " ^
   402                             Int.toString (length mutants) ^ " MUTANTS")
   402                             string_of_int (length mutants) ^ " MUTANTS")
   403           val (execs, noexecs) = List.partition (is_executable_term thy) (take_random (20 * max_mutants) mutants)
   403           val (execs, noexecs) = List.partition (is_executable_term thy) (take_random (20 * max_mutants) mutants)
   404           val _ = tracing ("AFTER PARTITION (" ^ Int.toString (length execs) ^
   404           val _ = tracing ("AFTER PARTITION (" ^ string_of_int (length execs) ^
   405                            " vs " ^ Int.toString (length noexecs) ^ ")")
   405                            " vs " ^ string_of_int (length noexecs) ^ ")")
   406         in
   406         in
   407           execs @ take_random (Int.max (0, max_mutants - length execs)) noexecs
   407           execs @ take_random (Int.max (0, max_mutants - length execs)) noexecs
   408         end
   408         end
   409       else
   409       else
   410         mutants
   410         mutants
   466     (theoryfile_string_of_mutant_subentry thy thm_name) mutant_subentries) ^ "\n"
   466     (theoryfile_string_of_mutant_subentry thy thm_name) mutant_subentries) ^ "\n"
   467 
   467 
   468 (* subentry -> string *)
   468 (* subentry -> string *)
   469 fun string_for_subentry (mtd_name, genuine_cex, potential_cex, no_cex, donno,
   469 fun string_for_subentry (mtd_name, genuine_cex, potential_cex, no_cex, donno,
   470                          timeout, error) =
   470                          timeout, error) =
   471   "    " ^ mtd_name ^ ": " ^ Int.toString genuine_cex ^ "+ " ^
   471   "    " ^ mtd_name ^ ": " ^ string_of_int genuine_cex ^ "+ " ^
   472   Int.toString potential_cex ^ "= " ^ Int.toString no_cex ^ "- " ^
   472   string_of_int potential_cex ^ "= " ^ string_of_int no_cex ^ "- " ^
   473   Int.toString donno ^ "? " ^ Int.toString timeout ^ "T " ^
   473   string_of_int donno ^ "? " ^ string_of_int timeout ^ "T " ^
   474   Int.toString error ^ "!"
   474   string_of_int error ^ "!"
   475 
   475 
   476 (* entry -> string *)
   476 (* entry -> string *)
   477 fun string_for_entry (thm_name, exec, subentries) =
   477 fun string_for_entry (thm_name, exec, subentries) =
   478   thm_name ^ " " ^ (if exec then "[exe]" else "[noexe]") ^ ":\n" ^
   478   thm_name ^ " " ^ (if exec then "[exe]" else "[noexe]") ^ ":\n" ^
   479   cat_lines (map string_for_subentry subentries) ^ "\n"
   479   cat_lines (map string_for_subentry subentries) ^ "\n"