aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/especialize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-06-03 13:04:37 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-06-03 13:04:37 -0400
commitb1d29df128dd1fa879e24f0eb3f5cdc1b74e16b7 (patch)
tree370066a96da7c7aff61371c96f82804cde02fa75 /src/especialize.sml
parentccc3c126378aaa53765f8d69c267c6ffee666acf (diff)
Some serious bug-fix work to get HTML example to compile; this includes fixing a bug with 'val' patterns in Unnest and the need for more local reduction in Especialize
Diffstat (limited to 'src/especialize.sml')
-rw-r--r--src/especialize.sml7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/especialize.sml b/src/especialize.sml
index 7d129b8b..3fa3ea1d 100644
--- a/src/especialize.sml
+++ b/src/especialize.sml
@@ -1,4 +1,4 @@
-(* Copyright (c) 2008-2009, Adam Chlipala
+(* Copyright (c) 2008-2010, Adam Chlipala
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -278,7 +278,7 @@ fun specialize' (funcs, specialized) file =
NONE => default ()
| SOME (f, xs) =>
case IM.find (#funcs st, f) of
- NONE => default ()
+ NONE => ((*print ("No find: " ^ Int.toString f ^ "\n");*) default ())
| SOME {name, args, body, typ, tag} =>
let
val (xs, st) = ListUtil.foldlMap (fn (e, st) => exp (env, e, st)) st xs
@@ -415,6 +415,8 @@ fun specialize' (funcs, specialized) file =
(body', typ') fvs
val mns = !mayNotSpec
(*val () = mayNotSpec := SS.add (mns, name)*)
+ (*val () = print ("NEW: " ^ name ^ "__" ^ Int.toString f' ^ "\n");*)
+ val body' = ReduceLocal.reduceExp body'
(*val () = Print.preface ("PRE", CorePrint.p_exp CoreEnv.empty body')*)
val (body', st) = exp (env, body', st)
val () = mayNotSpec := mns
@@ -424,7 +426,6 @@ fun specialize' (funcs, specialized) file =
e' fvs
val e' = foldl (fn (arg, e) => (EApp (e, arg), loc))
e' xs
- (*val () = print ("NEW: " ^ name ^ "__" ^ Int.toString f' ^ "\n");*)
(*val () = Print.prefaces "Brand new"
[("e'", CorePrint.p_exp CoreEnv.empty e'),
("e", CorePrint.p_exp CoreEnv.empty e),