src/HOL/Tools/Sledgehammer/sledgehammer_commands.ML
changeset 58089 20e76da3a0ef
parent 58075 95bab16eac45
child 58831 aa8cf5eed06e
equal deleted inserted replaced
58088:f9e4a9621c75 58089:20e76da3a0ef
   316 
   316 
   317 val default_learn_prover_timeout = 2.0
   317 val default_learn_prover_timeout = 2.0
   318 
   318 
   319 fun hammer_away override_params subcommand opt_i fact_override state0 =
   319 fun hammer_away override_params subcommand opt_i fact_override state0 =
   320   let
   320   let
       
   321     (* We generally want chained facts to be picked up by the relevance filter, because it can then
       
   322        give it a proper name, which is useful for a variety of reasons (minimization, Isar proofs,
       
   323        verbose output, machine learning). However, if the fact is available by no other means (not
       
   324        even backticks), as "f" would be in "using f unfolding f'" after unfolding, we have no choice
       
   325        but to insert it into the state as an additional hypothesis.
       
   326     *)
       
   327     val {facts = chained0, ...} = Proof.goal state0
       
   328     val (inserts, keep_chained) =
       
   329       if null chained0 orelse #only fact_override then
       
   330         (chained0, [])
       
   331       else
       
   332         let val ctxt0 = Proof.context_of state0 in
       
   333           List.partition (is_useful_unnamed_local_fact ctxt0) chained0
       
   334         end
   321     val state = state0
   335     val state = state0
       
   336       |> (if null inserts then I else Proof.refine_insert inserts #> Proof.set_facts keep_chained)
   322       |> Proof.map_contexts (Try0.silence_methods false #> Config.put SMT_Config.verbose false)
   337       |> Proof.map_contexts (Try0.silence_methods false #> Config.put SMT_Config.verbose false)
       
   338 
   323     val thy = Proof.theory_of state
   339     val thy = Proof.theory_of state
   324     val ctxt = Proof.context_of state
   340     val ctxt = Proof.context_of state
   325 
   341 
   326     val override_params = override_params |> map (normalize_raw_param ctxt)
   342     val override_params = override_params |> map (normalize_raw_param ctxt)
   327     val _ = Isabelle_System.mkdir (Path.explode (getenv "ISABELLE_TMP"))
   343     val _ = Isabelle_System.mkdir (Path.explode (getenv "ISABELLE_TMP"))