src/HOL/Mirabelle/Tools/mirabelle_sledgehammer.ML
changeset 73292 f84a93f1de2f
parent 73289 a34b49841585
equal deleted inserted replaced
73291:efeebcfaef85 73292:f84a93f1de2f
    53 val strict_default = "false"
    53 val strict_default = "false"
    54 val stride_default = 1
    54 val stride_default = 1
    55 val max_facts_default = "smart"
    55 val max_facts_default = "smart"
    56 val slice_default = "true"
    56 val slice_default = "true"
    57 val max_calls_default = 10000000
    57 val max_calls_default = 10000000
    58 val trivial_default = "false"
    58 val check_trivial_default = false
    59 
    59 
    60 (*If a key is present in args then augment a list with its pair*)
    60 (*If a key is present in args then augment a list with its pair*)
    61 (*This is used to avoid fixing default values at the Mirabelle level, and
    61 (*This is used to avoid fixing default values at the Mirabelle level, and
    62   instead use the default values of the tool (Sledgehammer in this case).*)
    62   instead use the default values of the tool (Sledgehammer in this case).*)
    63 fun available_parameter args key label list =
    63 fun available_parameter args key label list =
   611 
   611 
   612 fun sledgehammer_action args =
   612 fun sledgehammer_action args =
   613   let
   613   let
   614     val stride = Mirabelle.get_int_setting args (strideK, stride_default)
   614     val stride = Mirabelle.get_int_setting args (strideK, stride_default)
   615     val max_calls = Mirabelle.get_int_setting args (max_callsK, max_calls_default)
   615     val max_calls = Mirabelle.get_int_setting args (max_callsK, max_calls_default)
       
   616     val check_trivial = Mirabelle.get_bool_setting args (check_trivialK, check_trivial_default)
   616   in
   617   in
   617     fn id => fn (st as {pre, name, log, ...}: Mirabelle.run_args) =>
   618     fn id => fn (st as {pre, name, log, ...}: Mirabelle.run_args) =>
   618       let val goal = Thm.major_prem_of (#goal (Proof.goal pre)) in
   619       let val goal = Thm.major_prem_of (#goal (Proof.goal pre)) in
   619         if can Logic.dest_conjunction goal orelse can Logic.dest_equals goal then
   620         if can Logic.dest_conjunction goal orelse can Logic.dest_equals goal then
   620           ()
   621           ()
   634               let
   635               let
   635                 val meth = Unsynchronized.ref ""
   636                 val meth = Unsynchronized.ref ""
   636                 val named_thms =
   637                 val named_thms =
   637                   Unsynchronized.ref (NONE : ((string * stature) * thm list) list option)
   638                   Unsynchronized.ref (NONE : ((string * stature) * thm list) list option)
   638                 val trivial =
   639                 val trivial =
   639                   if AList.lookup (op =) args check_trivialK |> the_default trivial_default
   640                   if check_trivial then
   640                                   |> Value.parse_bool then
       
   641                     Try0.try0 (SOME try_timeout) ([], [], [], []) pre
   641                     Try0.try0 (SOME try_timeout) ([], [], [], []) pre
   642                     handle Timeout.TIMEOUT _ => false
   642                     handle Timeout.TIMEOUT _ => false
   643                   else false
   643                   else false
   644                 fun apply_method () =
   644                 fun apply_method () =
   645                   (Mirabelle.catch_result (proof_method_tag meth) false
   645                   (Mirabelle.catch_result (proof_method_tag meth) false