src/Pure/Isar/proof.ML
changeset 54981 a128df2f670e
parent 54742 7a86358a3c0b
child 54984 da70ab8531f4
--- a/src/Pure/Isar/proof.ML	Fri Jan 10 12:30:05 2014 +0100
+++ b/src/Pure/Isar/proof.ML	Fri Jan 10 16:20:06 2014 +0100
@@ -481,6 +481,8 @@
   let
     val thy = Proof_Context.theory_of ctxt;
 
+    val _ =
+      Theory.subthy (theory_of_thm goal, thy) orelse error "Bad background theory of goal state";
     val _ = Thm.no_prems goal orelse error (Proof_Display.string_of_goal ctxt goal);
 
     fun lost_structure () = error ("Lost goal structure:\n" ^ Display.string_of_thm ctxt goal);