src/HOL/Tools/Sledgehammer/sledgehammer_prover.ML
changeset 55452 29ec8680e61f
parent 55345 8a53ee72e595
child 55453 0b070d098d1a
equal deleted inserted replaced
55451:ea1d9408a233 55452:29ec8680e61f
    76   val bunch_of_proof_methods : bool -> bool -> string -> proof_method list
    76   val bunch_of_proof_methods : bool -> bool -> string -> proof_method list
    77   val is_fact_chained : (('a * stature) * 'b) -> bool
    77   val is_fact_chained : (('a * stature) * 'b) -> bool
    78   val filter_used_facts :
    78   val filter_used_facts :
    79     bool -> (''a * stature) list -> ((''a * stature) * 'b) list ->
    79     bool -> (''a * stature) list -> ((''a * stature) * 'b) list ->
    80     ((''a * stature) * 'b) list
    80     ((''a * stature) * 'b) list
    81   val play_one_line_proof : mode -> bool -> Time.time -> ((string * 'a) * thm) list ->
    81   val play_one_line_proof : mode -> bool -> bool -> Time.time -> ((string * 'a) * thm) list ->
    82     Proof.state -> int -> proof_method -> proof_method list -> proof_method * play_outcome
    82     Proof.state -> int -> proof_method -> proof_method list -> proof_method * play_outcome
    83   val remotify_atp_if_not_installed : theory -> string -> string option
    83   val remotify_atp_if_not_installed : theory -> string -> string option
    84   val isar_supported_prover_of : theory -> string -> string
    84   val isar_supported_prover_of : theory -> string -> string
    85   val choose_minimize_command : theory -> params -> ((string * string list) list -> string -> 'a) ->
    85   val choose_minimize_command : theory -> params -> ((string * string list) list -> string -> 'a) ->
    86     string -> proof_method * play_outcome -> 'a
    86     string -> proof_method * play_outcome -> 'a
   217     val full_tac = Method.insert_tac facts i THEN tac ctxt i
   217     val full_tac = Method.insert_tac facts i THEN tac ctxt i
   218   in
   218   in
   219     TimeLimit.timeLimit timeout (try (Seq.pull o full_tac)) goal
   219     TimeLimit.timeLimit timeout (try (Seq.pull o full_tac)) goal
   220   end
   220   end
   221 
   221 
   222 fun timed_proof_method meth timeout ths =
   222 fun timed_proof_method debug timeout ths meth =
   223   timed_apply timeout (fn ctxt => tac_of_proof_method ctxt ([], ths) meth)
   223   timed_apply timeout (fn ctxt => tac_of_proof_method ctxt debug ([], ths) meth)
   224 
   224 
   225 fun is_fact_chained ((_, (sc, _)), _) = sc = Chained
   225 fun is_fact_chained ((_, (sc, _)), _) = sc = Chained
   226 
   226 
   227 fun filter_used_facts keep_chained used =
   227 fun filter_used_facts keep_chained used =
   228   filter ((member (op =) used o fst) orf (if keep_chained then is_fact_chained else K false))
   228   filter ((member (op =) used o fst) orf (if keep_chained then is_fact_chained else K false))
   229 
   229 
   230 fun play_one_line_proof mode verbose timeout pairs state i preferred (meths as meth :: _) =
   230 fun play_one_line_proof mode debug verbose timeout pairs state i preferred (meths as meth :: _) =
   231   let
   231   let
   232     fun get_preferred meths = if member (op =) meths preferred then preferred else meth
   232     fun get_preferred meths = if member (op =) meths preferred then preferred else meth
   233   in
   233   in
   234     if timeout = Time.zeroTime then
   234     if timeout = Time.zeroTime then
   235       (get_preferred meths, Not_Played)
   235       (get_preferred meths, Not_Played)
   247                     "\" for " ^ string_of_time timeout ^ "...")
   247                     "\" for " ^ string_of_time timeout ^ "...")
   248                 else
   248                 else
   249                   ()
   249                   ()
   250               val timer = Timer.startRealTimer ()
   250               val timer = Timer.startRealTimer ()
   251             in
   251             in
   252               (case timed_proof_method meth timeout ths state i of
   252               (case timed_proof_method debug timeout ths meth state i of
   253                 SOME (SOME _) => (meth, Played (Timer.checkRealTimer timer))
   253                 SOME (SOME _) => (meth, Played (Timer.checkRealTimer timer))
   254               | _ => play timed_out meths)
   254               | _ => play timed_out meths)
   255             end
   255             end
   256             handle TimeLimit.TimeOut => play (meth :: timed_out) meths
   256             handle TimeLimit.TimeOut => play (meth :: timed_out) meths
   257       in
   257       in