src/HOL/Mirabelle/Tools/mirabelle_sledgehammer.ML
changeset 39341 d2b981a0429a
parent 39340 3998dc0bf82b
child 39363 1c4e38d635e1
equal deleted inserted replaced
39340:3998dc0bf82b 39341:d2b981a0429a
    39   nontriv_success: int,
    39   nontriv_success: int,
    40   proofs: int,
    40   proofs: int,
    41   time: int,
    41   time: int,
    42   timeout: int,
    42   timeout: int,
    43   lemmas: int * int * int,
    43   lemmas: int * int * int,
    44   posns: Position.T list
    44   posns: (Position.T * bool) list
    45   }
    45   }
    46 
    46 
    47 datatype min_data = MinData of {
    47 datatype min_data = MinData of {
    48   succs: int,
    48   succs: int,
    49   ab_ratios: int
    49   ab_ratios: int
   232   log ("Average time for failed sledgehammer calls (ATP): " ^
   232   log ("Average time for failed sledgehammer calls (ATP): " ^
   233     str3 (avg_time time_atp_fail (calls - success)))
   233     str3 (avg_time time_atp_fail (calls - success)))
   234   )
   234   )
   235 
   235 
   236 
   236 
   237 fun str_of_pos pos =
   237 fun str_of_pos (pos, triv) =
   238   let val str0 = string_of_int o the_default 0
   238   let val str0 = string_of_int o the_default 0
   239   in str0 (Position.line_of pos) ^ ":" ^ str0 (Position.column_of pos) end
   239   in
       
   240     str0 (Position.line_of pos) ^ ":" ^ str0 (Position.column_of pos) ^
       
   241     (if triv then "[T]" else "")
       
   242   end
   240 
   243 
   241 fun log_me_data log tag sh_calls (metis_calls, metis_success,
   244 fun log_me_data log tag sh_calls (metis_calls, metis_success,
   242      metis_nontriv_calls, metis_nontriv_success,
   245      metis_nontriv_calls, metis_nontriv_success,
   243      metis_proofs, metis_time, metis_timeout, (lemmas, lems_sos, lems_max),
   246      metis_proofs, metis_time, metis_timeout, (lemmas, lems_sos, lems_max),
   244     metis_posns) =
   247     metis_posns) =
   468     fun with_time (false, t) = "failed (" ^ string_of_int t ^ ")"
   471     fun with_time (false, t) = "failed (" ^ string_of_int t ^ ")"
   469       | with_time (true, t) = (change_data id (inc_metis_success m);
   472       | with_time (true, t) = (change_data id (inc_metis_success m);
   470           if trivial then () else change_data id (inc_metis_nontriv_success m);
   473           if trivial then () else change_data id (inc_metis_nontriv_success m);
   471           change_data id (inc_metis_lemmas m (length named_thms));
   474           change_data id (inc_metis_lemmas m (length named_thms));
   472           change_data id (inc_metis_time m t);
   475           change_data id (inc_metis_time m t);
   473           change_data id (inc_metis_posns m pos);
   476           change_data id (inc_metis_posns m (pos, trivial));
   474           if name = "proof" then change_data id (inc_metis_proofs m) else ();
   477           if name = "proof" then change_data id (inc_metis_proofs m) else ();
   475           "succeeded (" ^ string_of_int t ^ ")")
   478           "succeeded (" ^ string_of_int t ^ ")")
   476     fun timed_metis thms =
   479     fun timed_metis thms =
   477       (with_time (Mirabelle.cpu_time apply_metis thms), true)
   480       (with_time (Mirabelle.cpu_time apply_metis thms), true)
   478       handle TimeLimit.TimeOut => (change_data id (inc_metis_timeout m);
   481       handle TimeLimit.TimeOut => (change_data id (inc_metis_timeout m);