check if negating the goal is possible (avoids CTERM exception for Pure propositions)
authorboehmes
Fri, 08 Apr 2011 19:04:08 +0200
changeset 42320 1f09e4c680fc
parent 42319 9a8ba59aed06
child 42321 ce83c1654b86
check if negating the goal is possible (avoids CTERM exception for Pure propositions)
src/HOL/Tools/SMT/smt_solver.ML
--- a/src/HOL/Tools/SMT/smt_solver.ML	Fri Apr 08 19:04:08 2011 +0200
+++ b/src/HOL/Tools/SMT/smt_solver.ML	Fri Apr 08 19:04:08 2011 +0200
@@ -284,7 +284,11 @@
     val {facts, goal, ...} = Proof.goal st
     val ({context=ctxt', prems, concl, ...}, _) = Subgoal.focus ctxt i goal
     fun negate ct = Thm.dest_comb ct ||> Thm.capply cnot |-> Thm.capply
-    val cprop = negate (Thm.rhs_of (SMT_Normalize.atomize_conv ctxt' concl))
+    val cprop =
+      (case try negate (Thm.rhs_of (SMT_Normalize.atomize_conv ctxt' concl)) of
+        SOME ct => ct
+      | NONE => raise SMT_Failure.SMT (SMT_Failure.Other_Failure (
+          "goal is not a HOL term")))
   in
     map snd xwthms
     |> map_index I