src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML
changeset 73383 6b104dc069de
parent 70586 57df8a85317a
child 73387 3b5196dac4c8
equal deleted inserted replaced
73382:2b1b7b58d0e7 73383:6b104dc069de
  1262 
  1262 
  1263 val learn_timeout_slack = 20.0
  1263 val learn_timeout_slack = 20.0
  1264 
  1264 
  1265 fun launch_thread timeout task =
  1265 fun launch_thread timeout task =
  1266   let
  1266   let
  1267     val hard_timeout = time_mult learn_timeout_slack timeout
  1267     val hard_timeout = Time.scale learn_timeout_slack timeout
  1268     val birth_time = Time.now ()
  1268     val birth_time = Time.now ()
  1269     val death_time = birth_time + hard_timeout
  1269     val death_time = birth_time + hard_timeout
  1270     val desc = ("Machine learner for Sledgehammer", "")
  1270     val desc = ("Machine learner for Sledgehammer", "")
  1271   in
  1271   in
  1272     Async_Manager_Legacy.thread MaShN birth_time death_time desc task
  1272     Async_Manager_Legacy.thread MaShN birth_time death_time desc task
  1544       val thy_name = Context.theory_name (Proof_Context.theory_of ctxt)
  1544       val thy_name = Context.theory_name (Proof_Context.theory_of ctxt)
  1545 
  1545 
  1546       fun maybe_launch_thread exact min_num_facts_to_learn =
  1546       fun maybe_launch_thread exact min_num_facts_to_learn =
  1547         if not (Async_Manager_Legacy.has_running_threads MaShN) andalso
  1547         if not (Async_Manager_Legacy.has_running_threads MaShN) andalso
  1548            Time.toSeconds timeout >= min_secs_for_learning then
  1548            Time.toSeconds timeout >= min_secs_for_learning then
  1549           let val timeout = time_mult learn_timeout_slack timeout in
  1549           let val timeout = Time.scale learn_timeout_slack timeout in
  1550             (if verbose then
  1550             (if verbose then
  1551                writeln ("Started MaShing through " ^
  1551                writeln ("Started MaShing through " ^
  1552                  (if exact then "" else "up to ") ^ string_of_int min_num_facts_to_learn ^
  1552                  (if exact then "" else "up to ") ^ string_of_int min_num_facts_to_learn ^
  1553                  " fact" ^ plural_s min_num_facts_to_learn ^ " in the background")
  1553                  " fact" ^ plural_s min_num_facts_to_learn ^ " in the background")
  1554              else
  1554              else