src/Pure/Thy/thy_read.ML
changeset 1236 b54d51df9065
parent 1223 53e4b22aa1f2
child 1242 b3f68a644380
equal deleted inserted replaced
1235:b4056a71eca2 1236:b54d51df9065
   499 (*Store a theorem in the thy_info of its theory*)
   499 (*Store a theorem in the thy_info of its theory*)
   500 fun store_thm (name, thm) =
   500 fun store_thm (name, thm) =
   501   let
   501   let
   502     val (thy_name, ThyInfo {path, children, thy_time, ml_time, theory, thms}) =
   502     val (thy_name, ThyInfo {path, children, thy_time, ml_time, theory, thms}) =
   503       thyinfo_of_sign (#sign (rep_thm thm));
   503       thyinfo_of_sign (#sign (rep_thm thm));
       
   504 
   504     val thms' = Symtab.update_new ((name, thm), thms)
   505     val thms' = Symtab.update_new ((name, thm), thms)
   505       handle Symtab.DUPLICATE s => 
   506       handle Symtab.DUPLICATE s => 
   506         (if eq_thm (the (Symtab.lookup (thms, name)), thm) then 
   507         (if eq_thm (the (Symtab.lookup (thms, name)), thm) then 
   507            (writeln ("Warning: Theorem database already contains copy of\
   508            (writeln ("Warning: Theory database already contains copy of\
   508                      \ theorem " ^ quote name);
   509                      \ theorem " ^ quote name);
   509             thms)
   510             thms)
   510          else error ("Duplicate theorem name " ^ quote s));
   511          else error ("Duplicate theorem name " ^ quote s
       
   512                      ^ " used in theory database"));
   511   in
   513   in
   512     loaded_thys := Symtab.update
   514     loaded_thys := Symtab.update
   513      ((thy_name, ThyInfo {path = path, children = children,
   515      ((thy_name, ThyInfo {path = path, children = children,
   514        thy_time = thy_time, ml_time = ml_time, theory = theory, thms = thms'}),
   516        thy_time = thy_time, ml_time = ml_time, theory = theory, thms = thms'}),
   515       ! loaded_thys);
   517       ! loaded_thys);