add_classrel/arity: strip_shyps of stored result;
authorwenzelm
Tue, 07 Jul 2009 00:29:34 +0200
changeset 31948 ea8c8bf47ce3
parent 31947 7daee3bed3af
child 31951 9787769764bb
add_classrel/arity: strip_shyps of stored result;
src/Pure/axclass.ML
--- a/src/Pure/axclass.ML	Mon Jul 06 22:42:27 2009 +0200
+++ b/src/Pure/axclass.ML	Tue Jul 07 00:29:34 2009 +0200
@@ -338,10 +338,11 @@
 
 (* primitive rules *)
 
-fun add_classrel th thy =
+fun add_classrel raw_th thy =
   let
+    val th = Thm.strip_shyps (Thm.transfer thy raw_th);
+    val prop = Thm.plain_prop_of th;
     fun err () = raise THM ("add_classrel: malformed class relation", 0, [th]);
-    val prop = Thm.plain_prop_of (Thm.transfer thy th);
     val rel = Logic.dest_classrel prop handle TERM _ => err ();
     val (c1, c2) = cert_classrel thy rel handle TYPE _ => err ();
   in
@@ -351,10 +352,11 @@
     |> perhaps complete_arities
   end;
 
-fun add_arity th thy =
+fun add_arity raw_th thy =
   let
+    val th = Thm.strip_shyps (Thm.transfer thy raw_th);
+    val prop = Thm.plain_prop_of th;
     fun err () = raise THM ("add_arity: malformed type arity", 0, [th]);
-    val prop = Thm.plain_prop_of (Thm.transfer thy th);
     val (t, Ss, c) = Logic.dest_arity prop handle TERM _ => err ();
     val T = Type (t, map TFree (Name.names Name.context Name.aT Ss));
     val missing_params = Sign.complete_sort thy [c]