proper treatment of code theorems for primrec
authorhaftmann
Fri, 07 Dec 2007 15:07:56 +0100
changeset 25570 fdfbbb92dadf
parent 25569 c597835d5de4
child 25571 c9e39eafc7a0
proper treatment of code theorems for primrec
src/HOL/Tools/primrec_package.ML
src/HOL/Tools/recfun_codegen.ML
--- a/src/HOL/Tools/primrec_package.ML	Fri Dec 07 15:07:54 2007 +0100
+++ b/src/HOL/Tools/primrec_package.ML	Fri Dec 07 15:07:56 2007 +0100
@@ -258,8 +258,8 @@
         "\nare not mutually recursive");
     val qualify = NameSpace.qualified
       (space_implode "_" (map (Sign.base_name o #1) defs));
-    val simp_atts = map (Attrib.internal o K) [Simplifier.simp_add]
-      @ [Code.add_default_func_attr (*FIXME*)] (*RecfunCodegen.add NONE*);
+    val simp_atts = map (Attrib.internal o K)
+      [Simplifier.simp_add, RecfunCodegen.add NONE];
   in
     lthy
     |> fold_map (LocalTheory.define Thm.definitionK o make_def lthy fixes fs) defs
--- a/src/HOL/Tools/recfun_codegen.ML	Fri Dec 07 15:07:54 2007 +0100
+++ b/src/HOL/Tools/recfun_codegen.ML	Fri Dec 07 15:07:56 2007 +0100
@@ -35,10 +35,10 @@
   string_of_thm thm);
 
 fun add_thm opt_module thm =
-  if Pattern.pattern (lhs_of thm) then
+  (if Pattern.pattern (lhs_of thm) then
     RecCodegenData.map
       (Symtab.cons_list ((fst o const_of o prop_of) thm, (thm, opt_module)))
-  else tap (fn _ => warn thm)
+  else tap (fn _ => warn thm))
   handle TERM _ => tap (fn _ => warn thm);
 
 fun add opt_module = Thm.declaration_attribute (fn thm => Context.mapping