src/HOL/Tools/Sledgehammer/sledgehammer_util.ML
changeset 57882 38bf4de248a6
parent 57756 92fe49c7ab3b
parent 57838 c21f2c52f54b
child 58028 e4250d370657
equal deleted inserted replaced
57881:37920df63ab9 57882:38bf4de248a6
   117   in
   117   in
   118     snd (app_body map_plain_name body (0, []))
   118     snd (app_body map_plain_name body (0, []))
   119   end
   119   end
   120 
   120 
   121 fun thms_in_proof max_thms name_tabs th =
   121 fun thms_in_proof max_thms name_tabs th =
   122   let val map_names = (case name_tabs of SOME p => pairself Symtab.lookup p | NONE => `I SOME) in
   122   (case try Thm.proof_body_of th of
   123     SOME (fold_body_thm max_thms (Thm.get_name_hint th) map_names
   123     NONE => NONE
   124       (Proofterm.strip_thm (Thm.proof_body_of th)))
   124   | SOME body =>
   125     handle TOO_MANY () => NONE
   125     let val map_names = (case name_tabs of SOME p => pairself Symtab.lookup p | NONE => `I SOME) in
   126   end
   126       SOME (fold_body_thm max_thms (Thm.get_name_hint th) map_names (Proofterm.strip_thm body))
       
   127       handle TOO_MANY () => NONE
       
   128     end)
   127 
   129 
   128 fun thms_of_name ctxt name =
   130 fun thms_of_name ctxt name =
   129   let
   131   let
   130     val lex = Keyword.get_lexicons
   132     val lex = Keyword.get_lexicons
   131     val get = maps (Proof_Context.get_fact ctxt o fst)
   133     val get = maps (Proof_Context.get_fact ctxt o fst)