12 |
* to the instantiated meta variables mvs) to a list of SSA assignments in |
* to the instantiated meta variables mvs) to a list of SSA assignments in |
13 |
* reverse order. |
* reverse order. |
14 |
*) |
*) |
15 |
val translate : (HighIL.var * Var.var * Types.meta_var list * HighIL.var list) |
val translate : (HighIL.var * Var.var * SimpleTypes.meta_arg list * HighIL.var list) |
16 |
-> HighIL.assign list |
-> HighIL.assignment list |
17 |
|
|
18 |
end = struct |
end = struct |
19 |
|
|
21 |
structure IL = HighIL |
structure IL = HighIL |
22 |
structure DstTy = HighILTypes |
structure DstTy = HighILTypes |
23 |
structure Op = HighOps |
structure Op = HighOps |
24 |
structure Ty = Types |
structure Ty = SimpleTypes |
|
structure TU = TypeUtil |
|
|
structure MV = MetaVar |
|
25 |
structure VTbl = Var.Tbl |
structure VTbl = Var.Tbl |
26 |
|
structure mk= mkOperators |
27 |
|
|
28 |
fun pruneDim d = (case TU.pruneDim d |
fun trType (Ty.TY ty) = TranslateTy.tr ty |
29 |
of (Ty.DimConst n) => n |
| trType _ = raise Fail "expected type" |
30 |
| d => raise Fail("unresolved dimension " ^ TU.dimToString d) |
fun dimVarToInt (Ty.DIM d) = d |
31 |
(* end case *)) |
| dimVarToInt _ = raise Fail "expected dim" |
32 |
|
fun dimVarToTensor dv = DstTy.tensorTy[dimVarToInt dv] |
33 |
fun pruneShape sv = (case TU.pruneShape(MV.toShape sv) |
fun dimVarToMatrix dv = let |
34 |
of Ty.Shape dd => DstTy.tensorTy(List.map pruneDim dd) |
val d = dimVarToInt dv |
35 |
| shp => raise Fail("unresolved shape " ^ TU.shapeToString shp) |
in |
36 |
(* end case *)) |
DstTy.tensorTy[d, d] (* square matrix type *) |
37 |
|
end |
38 |
|
fun shapeVarToTensor (Ty.SHAPE shp) = DstTy.tensorTy shp |
39 |
|
| shapeVarToTensor _ = raise Fail "expected shape" |
40 |
|
|
41 |
fun dimVarToTensor dv = DstTy.tensorTy[pruneDim(MV.toDim dv)] |
fun assign (y, rator, xs) = [IL.ASSGN(y, IL.OP(rator, xs))] |
|
fun shapeVarToTensor sv = pruneShape sv |
|
42 |
|
|
43 |
fun assign (y, rator, xs) = [(y, IL.OP(rator, xs))] |
fun basisFn name (y, [], xs) = [IL.ASSGN(y, IL.APPLY(name, xs))] |
44 |
|
|
45 |
fun simpleOp rator (y, [], xs) = assign (y, rator, xs) |
fun simpleOp rator (y, [], xs) = assign (y, rator, xs) |
46 |
|
|
48 |
|
|
49 |
fun vectorOp rator (y, [dv], xs) = assign (y, rator(dimVarToTensor dv), xs) |
fun vectorOp rator (y, [dv], xs) = assign (y, rator(dimVarToTensor dv), xs) |
50 |
|
|
51 |
fun kernel h (y, [], []) = assign(y, Op.Kernel h, []) |
fun kernel h (y, [], []) = assign(y, Op.Kernel(h, 0), []) |
52 |
|
|
53 |
|
val cnt = ref 0 |
54 |
|
fun genName prefix = let |
55 |
|
val n = !cnt |
56 |
|
in |
57 |
|
cnt := n+1; |
58 |
|
String.concat[prefix, "_", Int.toString n] |
59 |
|
end |
60 |
|
(* utility functions for synthesizing eigenvector/eigenvalue code *) |
61 |
|
fun eigenVec (rator, dim) = let |
62 |
|
val ty = DstTy.SeqTy(DstTy.realTy, dim) |
63 |
|
in |
64 |
|
fn (y, _, [m]) => let |
65 |
|
val v = IL.Var.new("evals", ty) |
66 |
|
in |
67 |
|
[IL.MASSGN([v, y], rator, [m])] |
68 |
|
end |
69 |
|
end |
70 |
|
fun eigenVal (rator, dim) = let |
71 |
|
val ty = DstTy.SeqTy(DstTy.vecTy dim, dim) |
72 |
|
in |
73 |
|
fn (y, _, [m]) => let |
74 |
|
val v = IL.Var.new("evecs", ty) |
75 |
|
in |
76 |
|
[IL.MASSGN([y, v], rator, [m])] |
77 |
|
end |
78 |
|
end |
79 |
|
|
80 |
|
fun assignEin (y, rator, xs) = IL.ASSGN(y, IL.EINAPP(rator, xs)) |
81 |
|
|
82 |
|
fun simpleEOp rator (y, _,xs) = [assignEin(y, rator, xs)] |
83 |
|
|
84 |
|
(* shape is an int list, DIM is in int|variable, k-level of differntiation *) |
85 |
|
|
86 |
(* build a table that maps Basis variables to their translation functions *) |
(* build a table that maps Basis variables to their translation functions *) |
87 |
val tbl : ((IL.var * Ty.meta_var list * IL.var list) -> IL.assign list) VTbl.hash_table = let |
val tbl : ((IL.var * Ty.meta_arg list * IL.var list) -> IL.assignment list) VTbl.hash_table = let |
88 |
val tbl = VTbl.mkTable (128, Fail "Translate table") |
val tbl = VTbl.mkTable (128, Fail "Translate table") |
89 |
|
val insert = VTbl.insert tbl |
90 |
in |
in |
91 |
List.app (VTbl.insert tbl) [ |
List.app insert [ |
|
(BV.add_ii, simpleOp(Op.Add DstTy.IntTy)), |
|
|
(BV.add_tt, tensorOp Op.Add), |
|
|
(BV.sub_ii, simpleOp(Op.Sub DstTy.IntTy)), |
|
|
(BV.sub_tt, tensorOp Op.Sub), |
|
|
(BV.mul_ii, simpleOp(Op.Mul DstTy.IntTy)), |
|
|
(BV.mul_rr, simpleOp(Op.Mul(DstTy.realTy))), |
|
|
(BV.mul_rt, tensorOp Op.Scale), |
|
|
(BV.mul_tr, fn (y, sv, [t, r]) => tensorOp Op.Scale (y, sv, [r, t])), |
|
|
(BV.div_ii, simpleOp(Op.Div DstTy.IntTy)), |
|
|
(BV.div_rr, simpleOp(Op.Div(DstTy.realTy))), |
|
|
(BV.div_tr, tensorOp Op.InvScale), |
|
92 |
(BV.lt_ii, simpleOp(Op.LT DstTy.IntTy)), |
(BV.lt_ii, simpleOp(Op.LT DstTy.IntTy)), |
93 |
(BV.lt_rr, simpleOp(Op.LT(DstTy.realTy))), |
(BV.lt_rr, simpleOp(Op.LT DstTy.realTy)), |
94 |
(BV.lte_ii, simpleOp(Op.LTE DstTy.IntTy)), |
(BV.lte_ii, simpleOp(Op.LTE DstTy.IntTy)), |
95 |
(BV.lte_rr, simpleOp(Op.LTE(DstTy.realTy))), |
(BV.lte_rr, simpleOp(Op.LTE DstTy.realTy)), |
96 |
(BV.gte_ii, simpleOp(Op.GTE DstTy.IntTy)), |
(BV.gte_ii, simpleOp(Op.GTE DstTy.IntTy)), |
97 |
(BV.gte_rr, simpleOp(Op.GTE(DstTy.realTy))), |
(BV.gte_rr, simpleOp(Op.GTE(DstTy.realTy))), |
98 |
(BV.gt_ii, simpleOp(Op.GT DstTy.IntTy)), |
(BV.gt_ii, simpleOp(Op.GT DstTy.IntTy)), |
105 |
(BV.neq_ii, simpleOp(Op.NEQ DstTy.IntTy)), |
(BV.neq_ii, simpleOp(Op.NEQ DstTy.IntTy)), |
106 |
(BV.neq_ss, simpleOp(Op.NEQ DstTy.StringTy)), |
(BV.neq_ss, simpleOp(Op.NEQ DstTy.StringTy)), |
107 |
(BV.neq_rr, simpleOp(Op.NEQ(DstTy.realTy))), |
(BV.neq_rr, simpleOp(Op.NEQ(DstTy.realTy))), |
108 |
(BV.neg_i, simpleOp(Op.Neg DstTy.IntTy)), |
(BV.add_ii, simpleOp Op.IAdd), |
109 |
(BV.neg_t, tensorOp Op.Neg), |
(BV.add_tt, fn (y, [shp], xs) => let |
110 |
(BV.neg_f, fn (y, _, xs) => assign(y, Op.NegField, xs)), |
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor shp |
111 |
(BV.op_at, fn (y, [_, dv, sv], xs) => |
val rator =mk.addTen(dd1) |
112 |
assign(y, Op.Probe(shapeVarToTensor sv, dimVarToTensor dv), xs)), |
in |
113 |
(BV.op_convolve, fn (y, _, xs) => assign(y, Op.Convolve, xs)), |
[assignEin(y, rator,xs)] |
114 |
(BV.op_D, fn (y, _, xs) => assign(y, Op.DiffField, xs)), |
end), |
115 |
(BV.op_norm, tensorOp Op.Norm), |
(BV.add_ff, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], xs) => |
116 |
|
[assignEin(y, mk.addField(d, dd),xs)]), |
117 |
|
|
118 |
|
(BV.add_fr, fn (y, [_,Ty.DIM d], [f,s]) => |
119 |
|
[assignEin(y, mk.addTenField(d),[s,f])]), |
120 |
|
|
121 |
|
(BV.add_rf, fn (y, [_,Ty.DIM d], xs) => |
122 |
|
[assignEin(y, mk.addTenField(d),xs)]), |
123 |
|
(BV.sub_ii, simpleOp Op.ISub), |
124 |
|
(BV.sub_tt, fn (y, [shp], xs) => let |
125 |
|
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor shp |
126 |
|
val rator =mk.subTen(dd1) |
127 |
|
in |
128 |
|
[assignEin(y, rator,xs)] |
129 |
|
end), |
130 |
|
(BV.sub_ff, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], xs) => |
131 |
|
[assignEin(y, mk.subField(d, dd),xs)]), |
132 |
|
(BV.sub_fr, fn (y, [_,Ty.DIM d], xs) => |
133 |
|
[assignEin(y, mk.subFieldTen(d),xs)]), |
134 |
|
|
135 |
|
(BV.sub_rf, fn (y, [_,Ty.DIM d], xs) => |
136 |
|
[assignEin(y, mk.subTenField(d),xs)]), |
137 |
|
(BV.mul_ii, simpleOp Op.IMul), |
138 |
|
(BV.mul_rr, fn (y,_,args) => [assignEin(y, mk.prodScalar,args)]), |
139 |
|
(BV.mul_rt, fn (y, [shp], xs) => let |
140 |
|
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor shp |
141 |
|
val rator =mk.scaleTen(dd1) |
142 |
|
in |
143 |
|
[assignEin(y, rator,xs)] |
144 |
|
end), |
145 |
|
(BV.mul_tr, fn (y, [shp], [t, r]) => let |
146 |
|
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor shp |
147 |
|
val rator = mk.scaleTen dd1 |
148 |
|
in |
149 |
|
[assignEin(y, rator,[r,t])] |
150 |
|
end), |
151 |
|
(BV.mul_rf, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], xs) => |
152 |
|
[assignEin(y, mk.scaleField(d, dd),xs)]), |
153 |
|
(BV.mul_fr, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], [f, s]) => |
154 |
|
[assignEin(y, mk.scaleField(d, dd),[s,f])]), |
155 |
|
(BV.mul_ss, fn (y, [_,Ty.DIM d], xs) => |
156 |
|
[assignEin(y, mk.mulFieldss d,xs)]), |
157 |
|
(BV.mul_sf, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], xs) => |
158 |
|
[assignEin(y, mk.mulFieldsf(d,dd),xs)]), |
159 |
|
(BV.mul_fs, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], [f,s]) => |
160 |
|
[assignEin(y, mk.mulFieldsf(d,dd),[s,f])]), |
161 |
|
(BV.div_ii, simpleOp Op.IDiv), |
162 |
|
(BV.div_rr, fn (y,_,args) => [assignEin(y, mk.divScalar,args)]), |
163 |
|
(BV.div_tr, fn (y, [shp], xs) => let |
164 |
|
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor shp |
165 |
|
val rator =mk.divTen(dd1) |
166 |
|
in |
167 |
|
[assignEin(y, rator,xs)] |
168 |
|
end), |
169 |
|
(BV.div_fr, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], xs) => |
170 |
|
[assignEin(y, mk.divideField(d, dd),xs)]), |
171 |
|
(BV.div_ss, fn (y, [_,Ty.DIM d], xs) => |
172 |
|
[assignEin(y, mk.divFieldss d,xs)]), |
173 |
|
(BV.exp_ri, simpleOp(Op.Power)), |
174 |
|
(BV.exp_rr, basisFn MathFuns.pow), |
175 |
|
(BV.curl2D, simpleEOp mk.curl2d), |
176 |
|
(BV.curl3D, simpleEOp mk.curl3d), |
177 |
|
(BV.convolve_vk, fn (y, [_, Ty.DIM d, Ty.SHAPE dd], xs) => |
178 |
|
[assignEin(y, mk.conv(d, dd),xs)]), |
179 |
|
(BV.convolve_kv, fn (y, [_, Ty.DIM d, Ty.SHAPE dd], [k, v]) => |
180 |
|
[assignEin(y, mk.conv(d, dd),[v,k])]), |
181 |
|
(BV.neg_i, simpleOp Op.INeg), |
182 |
|
(BV.neg_t, fn (y, [shp], xs) => let |
183 |
|
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor shp |
184 |
|
val rator =mk.negTen(dd1) |
185 |
|
in |
186 |
|
[assignEin(y, rator,xs)] |
187 |
|
end), |
188 |
|
(BV.neg_f, fn (y, [_,Ty.DIM d, Ty.SHAPE dd], xs) => |
189 |
|
[assignEin(y, mk.negField(d, dd),xs)]), |
190 |
|
(BV.op_probe, fn (y, [_, Ty.DIM d, Ty.SHAPE dd], xs) => |
191 |
|
[assignEin(y, (mk.probe(dd,d)),xs)]), |
192 |
|
(BV.op_D, fn (y, [_, Ty.DIM d], xs) => [assignEin(y, mk.grad([d]),xs)]), |
193 |
|
(BV.op_Dotimes, fn (y, [_, Ty.DIM d1, Ty.SHAPE dd, Ty.DIM d2], xs) => [assignEin(y, mk.dotimes(d1, dd@[d2]),xs)]), |
194 |
|
(BV.op_Ddot, fn (y, [_, Ty.DIM d1, Ty.SHAPE dd, Ty.DIM d2], xs) => |
195 |
|
[assignEin(y, mk.divergence(d1, dd),xs)] ), |
196 |
|
(BV.op_norm, fn (y, [sv], xs) => let |
197 |
|
val ty=shapeVarToTensor sv |
198 |
|
in (case shapeVarToTensor sv |
199 |
|
of DstTy.TensorTy[] => assign(y, Op.Abs DstTy.realTy, xs) |
200 |
|
| DstTy.TensorTy[_] => assign(y, Op.Norm ty, xs) |
201 |
|
| DstTy.TensorTy[_,_] => assign(y, Op.Norm ty, xs) |
202 |
|
| DstTy.TensorTy[_,_,_] => assign(y, Op.Norm ty, xs) |
203 |
|
| _ => raise Fail"unsupported norm of TensorTy" |
204 |
|
(* end case *)) |
205 |
|
end), |
206 |
(BV.op_not, simpleOp Op.Not), |
(BV.op_not, simpleOp Op.Not), |
207 |
(BV.fn_CL, fn (y, _, xs) => assign(y, Op.CL, xs)), |
(BV.op_cross, simpleEOp mk.crossProduct), |
208 |
(BV.fn_convolve, fn (y, _, [h, img]) => assign(y, Op.Convolve, [img, h])), |
(BV.op_cross2, simpleEOp mk.crossProduct2), |
209 |
(BV.fn_cos, simpleOp Op.Cos), |
(BV.op_crossField, simpleEOp mk.crossProductField), |
210 |
(BV.fn_dot, vectorOp Op.Dot), |
(BV.op_outer, fn (y, [Ty.DIM d1, Ty.DIM d2], xs) => |
211 |
(BV.fn_inside, fn (y, [_, dv, _], xs) => |
[assignEin(y, (mk.outerProduct(d1, d2)), xs)]), |
212 |
assign(y, Op.Inside(dimVarToTensor dv), xs)), |
(BV.op_outerField, fn (y, [_, Ty.DIM d1], xs)=> |
213 |
|
[assignEin(y, mk.outerField(d1), xs)]), |
214 |
|
(BV.op_inner, fn (y, [sh1, sh2, _], xs) => let |
215 |
|
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor sh1 |
216 |
|
val ty2 as DstTy.TensorTy dd2 = shapeVarToTensor sh2 |
217 |
|
in |
218 |
|
[assignEin(y, (mk.innerProduct(dd1,dd2)),xs)] |
219 |
|
end), |
220 |
|
|
221 |
|
(BV.op_innerField, fn (y, [_,Ty.SHAPE dd1,Ty.DIM d,Ty.SHAPE dd2,_], xs) => |
222 |
|
[assignEin(y, mk.innerProductField(dd1,d,dd2),xs)]), |
223 |
|
(BV.op_colon, fn (y, [sh1, sh2, _], xs) => let |
224 |
|
val ty1 as DstTy.TensorTy dd1 = shapeVarToTensor sh1 |
225 |
|
val ty2 as DstTy.TensorTy dd2 = shapeVarToTensor sh2 |
226 |
|
in |
227 |
|
[assignEin(y, (mk.doubleDot(dd1,dd2)),xs)] |
228 |
|
end), |
229 |
|
(BV.op_colonField, fn (y, [_,Ty.SHAPE dd1,_,Ty.SHAPE dd2, _], xs) => |
230 |
|
[assignEin(y, (mk.doubleDotField(dd1,dd2)),xs)]), |
231 |
|
(BV.fn_inside, fn (y, [_, Ty.DIM d, _], xs) => assign(y, Op.Inside d, xs)), |
232 |
|
(BV.clamp_rrr, simpleOp (Op.Clamp DstTy.realTy)), |
233 |
|
(BV.clamp_vvv, vectorOp Op.Clamp), |
234 |
|
(BV.lerp3, tensorOp Op.Lerp), |
235 |
|
(BV.lerp5, fn (y, [sv], [a, b, x0, x, x1]) => let |
236 |
|
val t1 = IL.Var.new("t1", DstTy.realTy) |
237 |
|
val t2 = IL.Var.new("t2", DstTy.realTy) |
238 |
|
val t3 = IL.Var.new("t3", DstTy.realTy) |
239 |
|
in [ |
240 |
|
assignEin(t1, mk.subScalar,[x,x0]), |
241 |
|
assignEin(t2, mk.subScalar,[x1,x0]), |
242 |
|
assignEin(t3, mk.divScalar,[t1,t2]), |
243 |
|
IL.ASSGN(y, IL.OP(Op.Lerp(shapeVarToTensor sv), [a, b, t3])) |
244 |
|
] end), |
245 |
|
(BV.evals2x2, eigenVal (Op.Eigen2x2, 2)), |
246 |
|
(BV.evals3x3, eigenVal (Op.Eigen3x3, 3)), |
247 |
|
(BV.evecs2x2, eigenVec (Op.Eigen2x2, 2)), |
248 |
|
(BV.evecs3x3, eigenVec (Op.Eigen3x3, 3)), |
249 |
|
|
250 |
|
|
251 |
(BV.fn_max, simpleOp Op.Max), |
(BV.fn_max, simpleOp Op.Max), |
252 |
(BV.fn_min, simpleOp Op.Min), |
(BV.fn_min, simpleOp Op.Min), |
253 |
(BV.fn_modulate, vectorOp Op.Mul), |
|
254 |
(BV.fn_pow, simpleOp Op.Pow), |
(* modulate is vector * vector pointwise multiplication *) |
255 |
|
(BV.fn_modulate, fn (y,[Ty.DIM dd1], xs) => |
256 |
|
[assignEin(y, (mk.modulate dd1),xs)]), |
257 |
|
(BV.fn_normalize, vectorOp Op.Normalize), |
258 |
(BV.fn_principleEvec, vectorOp Op.PrincipleEvec), |
(BV.fn_principleEvec, vectorOp Op.PrincipleEvec), |
259 |
(BV.fn_sin, simpleOp Op.Sin), |
(BV.fn_trace, fn (y, [Ty.DIM d], xs) => |
260 |
|
[assignEin(y,(mk.trace d), xs)]), |
261 |
|
(BV.fn_traceField, fn (y, [_,Ty.DIM d,Ty.SHAPE dd], xs) => |
262 |
|
[assignEin(y,mk.traceField(d,dd), xs)]), |
263 |
|
(BV.fn_transpose, fn (y, [Ty.DIM d1, Ty.DIM d2], xs) => |
264 |
|
[assignEin(y, (mk.transpose [d1,d2]), xs)]), |
265 |
|
(BV.fn_transposeField, fn (y, [_,Ty.DIM d1, Ty.DIM d2,Ty.DIM d3], xs) => |
266 |
|
[assignEin(y, (mk.transposeField (d1,d2,d3)), xs)]), |
267 |
(BV.kn_bspln3, kernel Kernel.bspln3), |
(BV.kn_bspln3, kernel Kernel.bspln3), |
268 |
(BV.kn_bspln5, kernel Kernel.bspln5), |
(BV.kn_bspln5, kernel Kernel.bspln5), |
269 |
(BV.kn_ctmr, kernel Kernel.ctmr), |
(BV.kn_ctmr, kernel Kernel.ctmr), |
270 |
|
(BV.kn_c2ctmr, kernel Kernel.ctmr), |
271 |
|
(BV.kn_c4hexic, kernel Kernel.c4hexic), |
272 |
(BV.kn_tent, kernel Kernel.tent), |
(BV.kn_tent, kernel Kernel.tent), |
273 |
(BV.i2r, simpleOp Op.IntToReal) |
(BV.kn_c1tent, kernel Kernel.tent), |
274 |
|
(BV.i2r, simpleOp Op.IntToReal), |
275 |
|
(BV.identity, fn (y, [Ty.DIM d], xs) => |
276 |
|
[assignEin(y, (mk.identity d), xs)]), |
277 |
|
(BV.zero, fn (y, [sv], []) => |
278 |
|
assign(y, Op.Zero(shapeVarToTensor sv), [])), |
279 |
|
(BV.subscript, fn (y, [ty, Ty.DIM d], xs) => |
280 |
|
assign (y, Op.SeqSub(DstTy.SeqTy(trType ty, d)), xs)) |
281 |
|
(*, |
282 |
|
(BV.dynSubscript, fn (y, [tv], args) => |
283 |
|
assign(y, Op.SeqSub(DstTy.DynSeqTy(pruneTy tv)), args)) |
284 |
|
*) |
285 |
]; |
]; |
286 |
|
(* add C math functions *) |
287 |
|
List.app (fn (n, x) => insert(x, basisFn n)) BV.mathFns; |
288 |
tbl |
tbl |
289 |
end |
end |
290 |
|
|
292 |
of SOME transFn => transFn(y, mvs, xs) |
of SOME transFn => transFn(y, mvs, xs) |
293 |
| NONE => raise Fail("TranslateBasis.translate: unknown basis function " ^ Var.uniqueNameOf f) |
| NONE => raise Fail("TranslateBasis.translate: unknown basis function " ^ Var.uniqueNameOf f) |
294 |
(* end case *)) |
(* end case *)) |
295 |
|
handle ex => (print(concat["translate (", IL.Var.toString y, ", ", |
296 |
|
Var.uniqueNameOf f, ", ...)\n"]); raise ex) |
297 |
|
|
298 |
end |
end |