Mercurial > urweb
comparison src/unpoly.sml @ 1016:065ce3252090
Inlining threshold for Reduce
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Sun, 25 Oct 2009 12:08:21 -0400 |
parents | 6271f0e3c272 |
children | 85d194409b17 |
comparison
equal
deleted
inserted
replaced
1015:e47303e5d73d | 1016:065ce3252090 |
---|---|
160 val vis = map (fn (x, n, n_old, t, e, s) => | 160 val vis = map (fn (x, n, n_old, t, e, s) => |
161 (x ^ "_unpoly", n, n_old, t, e, s)) vis | 161 (x ^ "_unpoly", n, n_old, t, e, s)) vis |
162 val vis' = map (fn (x, n, _, t, e, s) => | 162 val vis' = map (fn (x, n, _, t, e, s) => |
163 (x, n, t, e, s)) vis | 163 (x, n, t, e, s)) vis |
164 | 164 |
165 val funcs = IM.insert (#funcs st, n, | 165 val funcs = foldl (fn ((_, n, n_old, _, _, _), funcs) => |
166 {kinds = ks, | 166 let |
167 defs = old_vis, | 167 val replacements = case IM.find (funcs, n_old) of |
168 replacements = M.insert (replacements, | 168 NONE => M.empty |
169 cargs, | 169 | SOME {replacements = r, ...} => r |
170 thisName)}) | 170 in |
171 IM.insert (funcs, n_old, | |
172 {kinds = ks, | |
173 defs = old_vis, | |
174 replacements = M.insert (replacements, | |
175 cargs, | |
176 n)}) | |
177 end) (#funcs st) vis | |
171 | 178 |
172 val ks' = List.drop (ks, length cargs) | 179 val ks' = List.drop (ks, length cargs) |
173 | 180 |
174 val st = {funcs = foldl (fn (vi, funcs) => | 181 val st = {funcs = foldl (fn (vi, funcs) => |
175 IM.insert (funcs, #2 vi, | 182 IM.insert (funcs, #2 vi, |