adding case theorems for code generator
authorhaftmann
Wed, 07 Jun 2006 16:55:39 +0200
changeset 19818 5c5c1208a3fa
parent 19817 bb16bf9ae3fd
child 19819 14de4d05d275
adding case theorems for code generator
src/HOL/Tools/datatype_codegen.ML
--- a/src/HOL/Tools/datatype_codegen.ML	Wed Jun 07 16:55:14 2006 +0200
+++ b/src/HOL/Tools/datatype_codegen.ML	Wed Jun 07 16:55:39 2006 +0200
@@ -337,6 +337,13 @@
       ((map (apsnd length) o #3 o the o AList.lookup (op =) descr) index) thy
   end;
 
+fun add_datatype_case_defs dtco thy =
+  let
+    val {case_rewrites, ...} = DatatypePackage.the_datatype thy dtco
+  in
+    fold CodegenTheorems.add_fun case_rewrites thy
+  end;
+
 val setup = 
   add_codegen "datatype" datatype_codegen #>
   add_tycodegen "datatype" datatype_tycodegen #>