Mercurial > urweb
comparison src/reduce.sml @ 1863:32784d27b5bc
Expand coverage of 'functionInside' for Especialize
author | Adam Chlipala <adam@chlipala.net> |
---|---|
date | Sat, 10 Aug 2013 10:13:40 -0400 |
parents | e15234fbb163 |
children | f463c773ed6a |
comparison
equal
deleted
inserted
replaced
1862:a3d795fbecb9 | 1863:32784d27b5bc |
---|---|
556 case #1 e1 of | 556 case #1 e1 of |
557 ELet (x, t, e1', e2') => | 557 ELet (x, t, e1', e2') => |
558 (ELet (x, t, e1', exp (UnknownE :: env') (EApp (e2', E.liftExpInExp 0 e2), loc)), loc) | 558 (ELet (x, t, e1', exp (UnknownE :: env') (EApp (e2', E.liftExpInExp 0 e2), loc)), loc) |
559 | 559 |
560 | EAbs (x, dom, _, b) => | 560 | EAbs (x, dom, _, b) => |
561 if count b <= 1 orelse passive e2 orelse ESpecialize.functionInside dom then | 561 if count b <= 1 orelse passive e2 orelse ESpecialize.functionInside IS.empty dom then |
562 let | 562 let |
563 val r = exp (KnownE e2 :: env') b | 563 val r = exp (KnownE e2 :: env') b |
564 in | 564 in |
565 (*Print.prefaces "eapp" [("b", CorePrint.p_exp CoreEnv.empty b), | 565 (*Print.prefaces "eapp" [("b", CorePrint.p_exp CoreEnv.empty b), |
566 ("env", Print.PD.string (e2s env')), | 566 ("env", Print.PD.string (e2s env')), |
796 let | 796 let |
797 val e1' = exp env e1 | 797 val e1' = exp env e1 |
798 | 798 |
799 val t = con env t | 799 val t = con env t |
800 in | 800 in |
801 if notFfi t andalso (passive e1' orelse count e2 <= 1 orelse ESpecialize.functionInside t) then | 801 if notFfi t andalso (passive e1' orelse count e2 <= 1 orelse ESpecialize.functionInside IS.empty t) then |
802 exp (KnownE e1 :: env) e2 | 802 exp (KnownE e1 :: env) e2 |
803 else | 803 else |
804 (ELet (x, t, e1', exp (UnknownE :: env) e2), loc) | 804 (ELet (x, t, e1', exp (UnknownE :: env) e2), loc) |
805 end | 805 end |
806 | 806 |