src/HOL/Tools/Sledgehammer/sledgehammer_isar.ML
changeset 53800 ac1ec5065316
parent 53764 eba0d1c069b8
child 54058 a60a00a2d0b0
equal deleted inserted replaced
53799:784223a8576e 53800:ac1ec5065316
    79 
    79 
    80 val default_default_params =
    80 val default_default_params =
    81   [("debug", "false"),
    81   [("debug", "false"),
    82    ("verbose", "false"),
    82    ("verbose", "false"),
    83    ("overlord", "false"),
    83    ("overlord", "false"),
       
    84    ("spy", "false"),
    84    ("blocking", "false"),
    85    ("blocking", "false"),
    85    ("type_enc", "smart"),
    86    ("type_enc", "smart"),
    86    ("strict", "false"),
    87    ("strict", "false"),
    87    ("lam_trans", "smart"),
    88    ("lam_trans", "smart"),
    88    ("uncurried_aliases", "smart"),
    89    ("uncurried_aliases", "smart"),
   106    ("isar_proof", ("isar_proofs", [])) (* legacy *)]
   107    ("isar_proof", ("isar_proofs", [])) (* legacy *)]
   107 val negated_alias_params =
   108 val negated_alias_params =
   108   [("no_debug", "debug"),
   109   [("no_debug", "debug"),
   109    ("quiet", "verbose"),
   110    ("quiet", "verbose"),
   110    ("no_overlord", "overlord"),
   111    ("no_overlord", "overlord"),
       
   112    ("dont_spy", "spy"),
   111    ("non_blocking", "blocking"),
   113    ("non_blocking", "blocking"),
   112    ("non_strict", "strict"),
   114    ("non_strict", "strict"),
   113    ("no_uncurried_aliases", "uncurried_aliases"),
   115    ("no_uncurried_aliases", "uncurried_aliases"),
   114    ("dont_learn", "learn"),
   116    ("dont_learn", "learn"),
   115    ("no_isar_proofs", "isar_proofs"),
   117    ("no_isar_proofs", "isar_proofs"),
   182 val implode_param = strip_spaces_except_between_idents o space_implode " "
   184 val implode_param = strip_spaces_except_between_idents o space_implode " "
   183 
   185 
   184 structure Data = Theory_Data
   186 structure Data = Theory_Data
   185 (
   187 (
   186   type T = raw_param list
   188   type T = raw_param list
   187   val empty = default_default_params |> map (apsnd single)
   189   val empty =
       
   190     default_default_params
       
   191     |> getenv "SLEDGEHAMMER_SPY" = "yes" ? AList.update (op =) ("spy", "true")
       
   192     |> map (apsnd single)
   188   val extend = I
   193   val extend = I
   189   fun merge data : T = AList.merge (op =) (K true) data
   194   fun merge data : T = AList.merge (op =) (K true) data
   190 )
   195 )
   191 
   196 
   192 fun avoid_too_many_threads _ _ [] = []
   197 fun avoid_too_many_threads _ _ [] = []
   276         SOME "smart" => NONE
   281         SOME "smart" => NONE
   277       | _ => SOME (lookup' name)
   282       | _ => SOME (lookup' name)
   278     val debug = mode <> Auto_Try andalso lookup_bool "debug"
   283     val debug = mode <> Auto_Try andalso lookup_bool "debug"
   279     val verbose = debug orelse (mode <> Auto_Try andalso lookup_bool "verbose")
   284     val verbose = debug orelse (mode <> Auto_Try andalso lookup_bool "verbose")
   280     val overlord = lookup_bool "overlord"
   285     val overlord = lookup_bool "overlord"
       
   286     val spy = lookup_bool "spy"
   281     val blocking =
   287     val blocking =
   282       Isabelle_Process.is_active () orelse mode <> Normal orelse debug orelse
   288       Isabelle_Process.is_active () orelse mode <> Normal orelse debug orelse
   283       lookup_bool "blocking"
   289       lookup_bool "blocking"
   284     val provers = lookup_string "provers" |> space_explode " "
   290     val provers = lookup_string "provers" |> space_explode " "
   285                   |> mode = Auto_Try ? single o hd
   291                   |> mode = Auto_Try ? single o hd
   309     val preplay_timeout =
   315     val preplay_timeout =
   310       if mode = Auto_Try then SOME Time.zeroTime
   316       if mode = Auto_Try then SOME Time.zeroTime
   311       else lookup_time "preplay_timeout"
   317       else lookup_time "preplay_timeout"
   312     val expect = lookup_string "expect"
   318     val expect = lookup_string "expect"
   313   in
   319   in
   314     {debug = debug, verbose = verbose, overlord = overlord, blocking = blocking,
   320     {debug = debug, verbose = verbose, overlord = overlord, spy = spy, blocking = blocking,
   315      provers = provers, type_enc = type_enc, strict = strict,
   321      provers = provers, type_enc = type_enc, strict = strict, lam_trans = lam_trans,
   316      lam_trans = lam_trans, uncurried_aliases = uncurried_aliases,
   322      uncurried_aliases = uncurried_aliases, learn = learn, fact_filter = fact_filter,
   317      learn = learn, fact_filter = fact_filter, max_facts = max_facts,
   323      max_facts = max_facts, fact_thresholds = fact_thresholds, max_mono_iters = max_mono_iters,
   318      fact_thresholds = fact_thresholds, max_mono_iters = max_mono_iters,
       
   319      max_new_mono_instances = max_new_mono_instances, isar_proofs = isar_proofs,
   324      max_new_mono_instances = max_new_mono_instances, isar_proofs = isar_proofs,
   320      isar_compress = isar_compress, isar_try0 = isar_try0, slice = slice,
   325      isar_compress = isar_compress, isar_try0 = isar_try0, slice = slice, minimize = minimize,
   321      minimize = minimize, timeout = timeout, preplay_timeout = preplay_timeout,
   326      timeout = timeout, preplay_timeout = preplay_timeout, expect = expect}
   322      expect = expect}
       
   323   end
   327   end
   324 
   328 
   325 fun get_params mode = extract_params mode o default_raw_params
   329 fun get_params mode = extract_params mode o default_raw_params
   326 fun default_params thy = get_params Normal thy o map (apsnd single)
   330 fun default_params thy = get_params Normal thy o map (apsnd single)
   327 
   331