comparison src/reduce.sml @ 193:8a70e2919e86

Specialization of single-parameter datatypes
author Adam Chlipala <adamc@hcoop.net>
date Fri, 08 Aug 2008 17:55:51 -0400
parents 7420fa18d657
children 2f574c07df2e
comparison
equal deleted inserted replaced
192:9bbf4d383381 193:8a70e2919e86
33 33
34 structure E = CoreEnv 34 structure E = CoreEnv
35 structure U = CoreUtil 35 structure U = CoreUtil
36 36
37 val liftConInCon = E.liftConInCon 37 val liftConInCon = E.liftConInCon
38 38 val subConInCon = E.subConInCon
39 val subConInCon =
40 U.Con.mapB {kind = fn k => k,
41 con = fn (xn, rep) => fn c =>
42 case c of
43 CRel xn' =>
44 (case Int.compare (xn', xn) of
45 EQUAL => #1 rep
46 | GREATER => CRel (xn' - 1)
47 | LESS => c)
48 | _ => c,
49 bind = fn ((xn, rep), U.Con.Rel _) => (xn+1, liftConInCon 0 rep)
50 | (ctx, _) => ctx}
51 39
52 val liftExpInExp = 40 val liftExpInExp =
53 U.Exp.mapB {kind = fn k => k, 41 U.Exp.mapB {kind = fn k => k,
54 con = fn _ => fn c => c, 42 con = fn _ => fn c => c,
55 exp = fn bound => fn e => 43 exp = fn bound => fn e =>