comparison src/mono_reduce.sml @ 920:7accd4546cf9

Fix memmem() signature; fix mono_reduce environment bookkeeping
author Adam Chlipala <adamc@hcoop.net>
date Tue, 08 Sep 2009 20:12:17 -0400
parents cc956020801b
children ae0110465421
comparison
equal deleted inserted replaced
919:cc956020801b 920:7accd4546cf9
472 let 472 let
473 val (body, remaining) = 473 val (body, remaining) =
474 foldl (fn (e, (body, remaining)) => 474 foldl (fn (e, (body, remaining)) =>
475 (subExpInExp (0, multiLift remaining e) body, remaining - 1)) 475 (subExpInExp (0, multiLift remaining e) body, remaining - 1))
476 (body, length subs - 1) subs 476 (body, length subs - 1) subs
477 val r = reduceExp env body 477 val r = reduceExp (E.patBinds env p) body
478 in 478 in
479 (*Print.preface ("subs", Print.p_list (MonoPrint.p_exp env) subs);*) 479 (*Print.preface ("subs", Print.p_list (MonoPrint.p_exp env) subs);*)
480 (*Print.prefaces "ECase" 480 (*Print.prefaces "ECase"
481 [("old", MonoPrint.p_exp env body), 481 [("old", MonoPrint.p_exp env body),
482 ("body", MonoPrint.p_exp env body), 482 ("body", MonoPrint.p_exp env body),
508 508
509 | ELet (x, t, e', (EAbs (x', t' as (TRecord [], _), ran, e''), loc)) => 509 | ELet (x, t, e', (EAbs (x', t' as (TRecord [], _), ran, e''), loc)) =>
510 if impure env e' then 510 if impure env e' then
511 e 511 e
512 else 512 else
513 EAbs (x', t', ran, reduceExp env (ELet (x, t, liftExpInExp 0 e', swapExpVars 0 e''), loc)) 513 EAbs (x', t', ran, reduceExp (E.pushERel env x' t' NONE)
514 (ELet (x, t, liftExpInExp 0 e', swapExpVars 0 e''), loc))
514 515
515 | ELet (x, t, e', b) => 516 | ELet (x, t, e', b) =>
516 let 517 let
517 fun doSub () = 518 fun doSub () =
518 let 519 let