comparison src/cloconv.sml @ 74:144d082b47ae

Reduce efold
author Adam Chlipala <adamc@hcoop.net>
date Thu, 26 Jun 2008 12:12:06 -0400
parents d3cc191cb25f
children 40d146f467c5
comparison
equal deleted inserted replaced
73:8b611ecc5f2d 74:144d082b47ae
53 val subExpInExp = 53 val subExpInExp =
54 U.Exp.mapB {typ = fn t => t, 54 U.Exp.mapB {typ = fn t => t,
55 exp = fn (xn, rep) => fn e => 55 exp = fn (xn, rep) => fn e =>
56 case e of 56 case e of
57 L'.ERel xn' => 57 L'.ERel xn' =>
58 if xn = xn' then 58 (case Int.compare (xn', xn) of
59 #1 rep 59 EQUAL => #1 rep
60 else 60 | GREATER => L'.ERel (xn' - 1)
61 e 61 | _ => e)
62 | _ => e, 62 | _ => e,
63 bind = fn ((xn, rep), U.Exp.RelE _) => (xn+1, liftExpInExp 0 rep) 63 bind = fn ((xn, rep), U.Exp.RelE _) => (xn+1, liftExpInExp 0 rep)
64 | (ctx, _) => ctx} 64 | (ctx, _) => ctx}
65 65
66 66