src/Pure/pure_thy.ML
changeset 21597 0e7a441ac637
parent 21580 ff8062cd41e9
child 21600 222810ce6b05
equal deleted inserted replaced
21596:486cae91868f 21597:0e7a441ac637
   416 fun smart_store _ (name, []) =
   416 fun smart_store _ (name, []) =
   417       error ("Cannot store empty list of theorems: " ^ quote name)
   417       error ("Cannot store empty list of theorems: " ^ quote name)
   418   | smart_store name_thm (name, [thm]) =
   418   | smart_store name_thm (name, [thm]) =
   419       fst (enter_thms (name_thm true) (name_thm false) I (name, [thm]) (Thm.theory_of_thm thm))
   419       fst (enter_thms (name_thm true) (name_thm false) I (name, [thm]) (Thm.theory_of_thm thm))
   420   | smart_store name_thm (name, thms) =
   420   | smart_store name_thm (name, thms) =
   421       let
   421       let val thy = Theory.merge_list (map Thm.theory_of_thm thms)
   422         fun merge th thy = Theory.merge (thy, Thm.theory_of_thm th)
       
   423           handle TERM (msg, _) => raise THM (msg, 0, [th]);
       
   424         val thy = fold merge (tl thms) (Thm.theory_of_thm (hd thms));
       
   425       in fst (enter_thms (name_thm true) (name_thm false) I (name, thms) thy) end;
   422       in fst (enter_thms (name_thm true) (name_thm false) I (name, thms) thy) end;
   426 
   423 
   427 in
   424 in
   428 
   425 
   429 val smart_store_thms = smart_store name_thms;
   426 val smart_store_thms = smart_store name_thms;