added warning for already stored theorem to store_thm
authorclasohm
Fri, 09 Dec 1994 13:05:03 +0100
changeset 774 ea19f22ed23c
parent 773 9f8bcf1a4cff
child 775 7b60621e2bad
added warning for already stored theorem to store_thm
src/Pure/Thy/thy_read.ML
--- a/src/Pure/Thy/thy_read.ML	Thu Dec 08 16:42:58 1994 +0100
+++ b/src/Pure/Thy/thy_read.ML	Fri Dec 09 13:05:03 1994 +0100
@@ -478,7 +478,12 @@
     val (thy_name, ThyInfo {path, children, thy_time, ml_time, theory, thms}) =
       thyinfo_of_sign (#sign (rep_thm thm));
     val thms' = Symtab.update_new ((name, thm), thms)
-      handle Symtab.DUPLICATE s => error ("Duplicate theorem name " ^ quote s);
+      handle Symtab.DUPLICATE s => 
+        (if eq_thm (the (Symtab.lookup (thms, name)), thm) then 
+           (writeln ("Warning: Theorem database already contains copy of\
+                     \ theorem " ^ quote name);
+            thms)
+         else error ("Duplicate theorem name " ^ quote s));
   in
     loaded_thys := Symtab.update
      ((thy_name, ThyInfo {path = path, children = children,