diff src/compiler.sml @ 20:1ab48e37d0ef

Some con reducing
author Adam Chlipala <adamc@hcoop.net>
date Sun, 08 Jun 2008 15:47:44 -0400
parents bc7b76ca57e0
children bfa2e9ae4df8
line wrap: on
line diff
--- a/src/compiler.sml	Sun Jun 08 14:42:12 2008 -0400
+++ b/src/compiler.sml	Sun Jun 08 15:47:44 2008 -0400
@@ -72,6 +72,11 @@
         NONE => NONE
       | SOME (_, file) => SOME (Corify.corify file)
 
+fun reduce eenv cenv filename =
+    case corify eenv cenv filename of
+        NONE => NONE
+      | SOME file => SOME (Reduce.reduce file)
+
 fun testParse filename =
     case parse filename of
         NONE => print "Failed\n"
@@ -97,4 +102,13 @@
     handle CoreEnv.UnboundNamed n =>
            print ("Unbound named " ^ Int.toString n ^ "\n")
 
+fun testReduce filename =
+    (case reduce ElabEnv.basis CoreEnv.basis filename of
+         NONE => print "Failed\n"
+       | SOME file =>
+         (Print.print (CorePrint.p_file CoreEnv.basis file);
+          print "\n"))
+    handle CoreEnv.UnboundNamed n =>
+           print ("Unbound named " ^ Int.toString n ^ "\n")
+
 end