From df3de8503f41b7f317167273e636cd722ba31bc1 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Thu, 14 May 2009 13:18:31 -0400 Subject: Proper lifting of MonoEnv stored expressions; avoidance of onchange clobbering --- src/mono_reduce.sml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/mono_reduce.sml') 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 -- cgit v1.2.3