--- 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);
--- a/src/Pure/goal.ML Fri Jan 10 12:30:05 2014 +0100
+++ b/src/Pure/goal.ML Fri Jan 10 16:20:06 2014 +0100
@@ -215,6 +215,8 @@
NONE => err "Tactic failed"
| SOME st =>
let
+ val _ =
+ Theory.subthy (theory_of_thm st, thy) orelse err "Bad background theory of goal state";
val res =
(finish ctxt' st
|> Drule.flexflex_unique