src/HOL/Tools/Sledgehammer/sledgehammer_prover_atp.ML
changeset 62826 eb94e570c1a4
parent 62735 23de054397e5
child 63692 1bc4bc2c9fd1
equal deleted inserted replaced
62825:e6e80a8bf624 62826:eb94e570c1a4
   248                    else
   248                    else
   249                      I))
   249                      I))
   250               * 0.001
   250               * 0.001
   251               |> seconds
   251               |> seconds
   252             val generous_slice_timeout =
   252             val generous_slice_timeout =
   253               if mode = MaSh then one_day else Time.+ (slice_timeout, atp_timeout_slack)
   253               if mode = MaSh then one_day else slice_timeout + atp_timeout_slack
   254             val _ =
   254             val _ =
   255               if debug then
   255               if debug then
   256                 quote name ^ " slice #" ^ string_of_int (slice + 1) ^
   256                 quote name ^ " slice #" ^ string_of_int (slice + 1) ^
   257                 " with " ^ string_of_int num_facts ^ " fact" ^
   257                 " with " ^ string_of_int num_facts ^ " fact" ^
   258                 plural_s num_facts ^ " for " ^ string_of_time slice_timeout ^ "..."
   258                 plural_s num_facts ^ " for " ^ string_of_time slice_timeout ^ "..."
   326           end
   326           end
   327 
   327 
   328         val timer = Timer.startRealTimer ()
   328         val timer = Timer.startRealTimer ()
   329 
   329 
   330         fun maybe_run_slice slice (result as (cache, (_, run_time0, _, _, SOME _), _)) =
   330         fun maybe_run_slice slice (result as (cache, (_, run_time0, _, _, SOME _), _)) =
   331             let val time_left = Time.- (timeout, Timer.checkRealTimer timer) in
   331             let val time_left = timeout - Timer.checkRealTimer timer in
   332               if Time.<= (time_left, Time.zeroTime) then
   332               if time_left <= Time.zeroTime then
   333                 result
   333                 result
   334               else
   334               else
   335                 run_slice time_left cache slice
   335                 run_slice time_left cache slice
   336                 |> (fn (cache, (output, run_time, used_from, atp_proof, outcome),
   336                 |> (fn (cache, (output, run_time, used_from, atp_proof, outcome),
   337                         format_type_enc) =>
   337                         format_type_enc) =>
   338                   (cache, (output, Time.+ (run_time0, run_time), used_from, atp_proof, outcome),
   338                   (cache, (output, run_time0 + run_time, used_from, atp_proof, outcome),
   339                    format_type_enc))
   339                    format_type_enc))
   340             end
   340             end
   341           | maybe_run_slice _ result = result
   341           | maybe_run_slice _ result = result
   342       in
   342       in
   343         ((NONE, ([], Symtab.empty, [], Symtab.empty,NONE)),
   343         ((NONE, ([], Symtab.empty, [], Symtab.empty,NONE)),