summaryrefslogtreecommitdiff
path: root/src/mono_reduce.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 13:18:31 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-14 13:18:31 -0400
commitdf3de8503f41b7f317167273e636cd722ba31bc1 (patch)
tree2d38397e8bfd910828e32184e9adbda761b1ae84 /src/mono_reduce.sml
parente6dd56d42a28138bcd9fdea52d0b232839c298dc (diff)
Proper lifting of MonoEnv stored expressions; avoidance of onchange clobbering
Diffstat (limited to 'src/mono_reduce.sml')
-rw-r--r--src/mono_reduce.sml19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mono_reduce.sml b/src/mono_reduce.sml
index 5d8afee3..5a2aca85 100644
--- a/src/mono_reduce.sml
+++ b/src/mono_reduce.sml
@@ -409,7 +409,15 @@ fun reduce file =
case match (env, p, e') of
No => search pes
| Maybe => push ()
- | Yes env => #1 (reduceExp env body)
+ | Yes env' =>
+ let
+ val r = reduceExp env' body
+ in
+ (*Print.prefaces "ECase"
+ [("body", MonoPrint.p_exp env' body),
+ ("r", MonoPrint.p_exp env r)];*)
+ #1 r
+ end
in
search pes
end
@@ -443,7 +451,14 @@ fun reduce file =
| ELet (x, t, e', b) =>
let
fun doSub () =
- #1 (reduceExp env (subExpInExp (0, e') b))
+ let
+ val r = subExpInExp (0, e') b
+ in
+ (*Print.prefaces "doSub" [("e'", MonoPrint.p_exp env e'),
+ ("b", MonoPrint.p_exp (E.pushERel env x t NONE) b),
+ ("r", MonoPrint.p_exp env r)];*)
+ #1 (reduceExp env r)
+ end
fun trySub () =
case t of