Theory.specify_const;
authorwenzelm
Thu, 11 Oct 2007 16:05:32 +0200
changeset 24962 60d33fb8ea5d
parent 24961 5298ee9c3fe5
child 24963 c04ec061ac2b
Theory.specify_const;
src/HOL/Tools/function_package/size.ML
--- a/src/HOL/Tools/function_package/size.ML	Thu Oct 11 16:05:30 2007 +0200
+++ b/src/HOL/Tools/function_package/size.ML	Thu Oct 11 16:05:32 2007 +0200
@@ -25,16 +25,6 @@
   fun merge _ = Symtab.merge (K true);
 );
 
-fun specify_consts args thy =
-  let
-    val specs = map (fn (c, T, mx) =>
-      Const (Sign.full_name thy (Syntax.const_name c mx), T)) args;
-  in
-    thy
-    |> Sign.add_consts_authentic [] args
-    |> Theory.add_finals_i false specs
-  end;
-
 fun add_axioms label ts atts thy =
   thy
   |> PureThy.add_axiomss_i [((label, ts), atts)];
@@ -165,10 +155,9 @@
     val size_names = DatatypeProp.indexify_names
       (map (fn T => name_of_typ T ^ size_suffix) (Library.drop (head_len, recTs)));
 
-    val thy' = thy
-      |> specify_consts (map (fn (s, T) =>
-        (Sign.base_name s, T --> HOLogic.natT, NoSyn))
-          (size_names ~~ Library.drop (head_len, recTs)))
+    val thy' = thy |> fold (fn (s, T) =>
+        snd o Theory.specify_const [] (Sign.base_name s, T --> HOLogic.natT, NoSyn))
+      (size_names ~~ Library.drop (head_len, recTs))
     val size_axs = make_size head_len descr' sorts recTs thy';
   in
     thy'