Mirabelle: handle possible parser exceptions, emit suitable log message
authorboehmes
Mon, 31 Aug 2009 17:32:29 +0200
changeset 32460 ba0cf920a39c
parent 32459 0a13ae5d09c8
child 32461 eee4fa79398f
child 32468 3e6f5365971e
Mirabelle: handle possible parser exceptions, emit suitable log message
src/HOL/Tools/Mirabelle/Tools/mirabelle_sledgehammer.ML
--- a/src/HOL/Tools/Mirabelle/Tools/mirabelle_sledgehammer.ML	Mon Aug 31 15:30:11 2009 +0200
+++ b/src/HOL/Tools/Mirabelle/Tools/mirabelle_sledgehammer.ML	Mon Aug 31 17:32:29 2009 +0200
@@ -63,11 +63,12 @@
     fun get_thms ctxt = maps (thms_of_name ctxt)
     fun metis thms ctxt = MetisTools.metis_tac ctxt thms
     fun apply_metis thms = "\nApplying metis with these theorems: " ^
-     (if try (Mirabelle.can_apply (metis thms)) st = SOME true
+     (if Mirabelle.can_apply (metis thms) st
       then "success"
       else "failure")
     val msg = if not (AList.defined (op =) args metisK) then ""
-      else apply_metis (get_thms (Proof.context_of st) (these thm_names))
+      else (apply_metis (get_thms (Proof.context_of st) (these thm_names))
+        handle ERROR m => "\nException: " ^ m)
   in
     if success
     then SOME ("success (" ^ prover_name ^ ": " ^ message ^ ")" ^ msg)