Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis15/src/compiler/tree-ir/tree-ops.sml
ViewVC logotype

Annotation of /branches/vis15/src/compiler/tree-ir/tree-ops.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3844 - (view) (download)

1 : jhr 3756 (* tree-ops.sml
2 :     *
3 :     * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     *
5 :     * COPYRIGHT (c) 2016 The University of Chicago
6 :     * All rights reserved.
7 :     *
8 :     * Operators for Tree IR.
9 :     *
10 :     * Note: this file is generated from gen/ir/tree-ops.spec and gen/ir/tree-ops.in.
11 :     *)
12 :    
13 :     structure TreeOps =
14 :     struct
15 :    
16 :     (* required helper functions for types *)
17 : jhr 3832 type ty = TreeTypes.t
18 : jhr 3756 val samety = TreeTypes.same
19 :     val hashty = TreeTypes.hash
20 :     val tyToString = TreeTypes.toString
21 :    
22 :     (* required helper functions for type lists *)
23 :     type tys = ty list
24 :     fun sametys (tys1, tys2) = ListPair.allEq samety (tys1, tys2)
25 :     fun hashtys tys = List.foldl (fn (ty, s) => hashty ty + 0w3 * s) 0w0 tys
26 :     fun tysToString tys = String.concat["[", String.concatWithMap "," tyToString tys, "]" ]
27 :    
28 :     (* required helper functions for the int type *)
29 :     fun sameint (i1 : int, i2) = (i1 = i2)
30 :     fun hashint i = Word.fromInt i
31 :     fun intToString i = Int.toString i
32 :    
33 :     (* required helper functions for the string type *)
34 :     fun samestring (s1 : string, s2) = (s1 = s2)
35 :     val hashstring = HashString.hashString
36 :     fun stringToString s = String.concat["\"", s, "\""]
37 :    
38 :     (* required helper functions for the shape type *)
39 :     type shape = int list
40 :     val sameshape : (shape * shape -> bool) = (op =)
41 :     fun hashshape shp =
42 :     List.foldl (fn (i, w) => Word.xorb(Word.<<(w, 0w1), Word.fromInt i))
43 :     (Word.fromInt(List.length shp)) shp
44 :     fun shapeToString shp = String.concat["[", String.concatWithMap "," Int.toString shp, "]"]
45 :    
46 :     (* required helper functions for the mask type *)
47 :     type mask = bool list
48 :     val samemask : (mask * mask -> bool) = (op =)
49 :     fun hashmask m =
50 :     List.foldl (fn (false, w) => w+w | (true, w) => w+w+0w1)
51 :     (Word.fromInt(List.length m)) m
52 :     fun maskToString m =
53 :     String.concat(List.map (fn true => "_" | false => ":") m)
54 :    
55 :     (* required helper functions for the index control type type *)
56 :     type idxctl = IndexCtl.ctl
57 :     val sameidxctl = IndexCtl.same
58 :     val hashidxctl = IndexCtl.hash
59 :     val idxctlToString = IndexCtl.toString
60 :    
61 :     datatype rator
62 :     = IAdd
63 :     | ISub
64 :     | IMul
65 :     | IDiv
66 :     | IMod
67 :     | INeg
68 :     | RAdd
69 :     | RSub
70 :     | RMul
71 :     | RDiv
72 :     | RNeg
73 : jhr 3830 | RClamp
74 :     | RLerp
75 : jhr 3756 | LT of ty
76 :     | LTE of ty
77 :     | EQ of ty
78 :     | NEQ of ty
79 :     | GT of ty
80 :     | GTE of ty
81 :     | Not
82 :     | Abs of ty
83 :     | Max of ty
84 :     | Min of ty
85 : jhr 3766 | VAdd of int
86 :     | VSub of int
87 :     | VScale of int
88 :     | VMul of int
89 :     | VNeg of int
90 :     | VSum of int
91 : jhr 3844 | VIndex of int * int
92 : jhr 3830 | VClamp of int
93 :     | VMapClamp of int
94 :     | VLerp of int
95 : jhr 3766 | TensorIndex of ty * shape
96 : jhr 3756 | EigenVecs2x2
97 :     | EigenVecs3x3
98 :     | EigenVals2x2
99 :     | EigenVals3x3
100 :     | Zero of ty
101 :     | Select of ty * int
102 :     | Subscript of ty
103 :     | MkDynamic of ty * int
104 :     | Append of ty
105 :     | Prepend of ty
106 :     | Concat of ty
107 :     | Range
108 :     | Length of ty
109 :     | SphereQuery of ty * ty
110 :     | Sqrt
111 :     | Cos
112 :     | ArcCos
113 : jhr 3835 | Sin
114 : jhr 3756 | ArcSin
115 :     | Tan
116 :     | ArcTan
117 : jhr 3757 | Exp
118 : jhr 3756 | Ceiling of int
119 :     | Floor of int
120 :     | Round of int
121 :     | Trunc of int
122 :     | IntToReal
123 :     | RealToInt of int
124 :     | R_All of ty
125 :     | R_Exists of ty
126 :     | R_Max of ty
127 :     | R_Min of ty
128 :     | R_Sum of ty
129 :     | R_Product of ty
130 :     | R_Mean of ty
131 :     | R_Variance of ty
132 :     | Transform of ImageInfo.info * int
133 :     | Translate of ImageInfo.info
134 : jhr 3766 | BaseAddress of ImageInfo.info
135 : jhr 3756 | ControlIndex of ImageInfo.info * idxctl * int
136 :     | Inside of ImageInfo.info * int
137 :     | ImageDim of ImageInfo.info * int
138 :     | LoadSeq of ty * string
139 :     | LoadImage of ty * string
140 :     | MathFn of MathFns.t
141 :    
142 :     fun resultArity IAdd = 1
143 :     | resultArity ISub = 1
144 :     | resultArity IMul = 1
145 :     | resultArity IDiv = 1
146 :     | resultArity IMod = 1
147 :     | resultArity INeg = 1
148 :     | resultArity RAdd = 1
149 :     | resultArity RSub = 1
150 :     | resultArity RMul = 1
151 :     | resultArity RDiv = 1
152 :     | resultArity RNeg = 1
153 : jhr 3830 | resultArity RClamp = 1
154 :     | resultArity RLerp = 1
155 : jhr 3756 | resultArity (LT _) = 1
156 :     | resultArity (LTE _) = 1
157 :     | resultArity (EQ _) = 1
158 :     | resultArity (NEQ _) = 1
159 :     | resultArity (GT _) = 1
160 :     | resultArity (GTE _) = 1
161 :     | resultArity Not = 1
162 :     | resultArity (Abs _) = 1
163 :     | resultArity (Max _) = 1
164 :     | resultArity (Min _) = 1
165 : jhr 3766 | resultArity (VAdd _) = 1
166 :     | resultArity (VSub _) = 1
167 :     | resultArity (VScale _) = 1
168 :     | resultArity (VMul _) = 1
169 :     | resultArity (VNeg _) = 1
170 :     | resultArity (VSum _) = 1
171 : jhr 3844 | resultArity (VIndex _) = 1
172 : jhr 3830 | resultArity (VClamp _) = 1
173 :     | resultArity (VMapClamp _) = 1
174 :     | resultArity (VLerp _) = 1
175 : jhr 3766 | resultArity (TensorIndex _) = 1
176 : jhr 3756 | resultArity EigenVecs2x2 = 1
177 :     | resultArity EigenVecs3x3 = 1
178 :     | resultArity EigenVals2x2 = 1
179 :     | resultArity EigenVals3x3 = 1
180 :     | resultArity (Zero _) = 1
181 :     | resultArity (Select _) = 1
182 :     | resultArity (Subscript _) = 1
183 :     | resultArity (MkDynamic _) = 1
184 :     | resultArity (Append _) = 2
185 :     | resultArity (Prepend _) = 2
186 :     | resultArity (Concat _) = 2
187 :     | resultArity Range = 2
188 :     | resultArity (Length _) = 1
189 :     | resultArity (SphereQuery _) = 1
190 :     | resultArity Sqrt = 1
191 :     | resultArity Cos = 1
192 :     | resultArity ArcCos = 1
193 : jhr 3835 | resultArity Sin = 1
194 : jhr 3756 | resultArity ArcSin = 1
195 :     | resultArity Tan = 1
196 :     | resultArity ArcTan = 1
197 : jhr 3757 | resultArity Exp = 1
198 : jhr 3756 | resultArity (Ceiling _) = 1
199 :     | resultArity (Floor _) = 1
200 :     | resultArity (Round _) = 1
201 :     | resultArity (Trunc _) = 1
202 :     | resultArity IntToReal = 1
203 :     | resultArity (RealToInt _) = 1
204 :     | resultArity (R_All _) = 1
205 :     | resultArity (R_Exists _) = 1
206 :     | resultArity (R_Max _) = 1
207 :     | resultArity (R_Min _) = 1
208 :     | resultArity (R_Sum _) = 1
209 :     | resultArity (R_Product _) = 1
210 :     | resultArity (R_Mean _) = 1
211 :     | resultArity (R_Variance _) = 1
212 :     | resultArity (Transform _) = 1
213 :     | resultArity (Translate _) = 1
214 : jhr 3766 | resultArity (BaseAddress _) = 1
215 : jhr 3756 | resultArity (ControlIndex _) = 1
216 :     | resultArity (Inside _) = 1
217 :     | resultArity (ImageDim _) = 1
218 :     | resultArity (LoadSeq _) = 1
219 :     | resultArity (LoadImage _) = 1
220 :     | resultArity (MathFn _) = 1
221 :    
222 :     fun arity IAdd = 2
223 :     | arity ISub = 2
224 :     | arity IMul = 2
225 :     | arity IDiv = 2
226 :     | arity IMod = 2
227 :     | arity INeg = 1
228 :     | arity RAdd = 2
229 :     | arity RSub = 2
230 :     | arity RMul = 2
231 :     | arity RDiv = 2
232 :     | arity RNeg = 1
233 : jhr 3830 | arity RClamp = 3
234 :     | arity RLerp = 3
235 : jhr 3756 | arity (LT _) = 2
236 :     | arity (LTE _) = 2
237 :     | arity (EQ _) = 2
238 :     | arity (NEQ _) = 2
239 :     | arity (GT _) = 2
240 :     | arity (GTE _) = 2
241 :     | arity Not = 1
242 :     | arity (Abs _) = 1
243 :     | arity (Max _) = 2
244 :     | arity (Min _) = 2
245 : jhr 3766 | arity (VAdd _) = 2
246 :     | arity (VSub _) = 2
247 :     | arity (VScale _) = 2
248 :     | arity (VMul _) = 2
249 :     | arity (VNeg _) = 2
250 :     | arity (VSum _) = 1
251 : jhr 3844 | arity (VIndex _) = 1
252 : jhr 3830 | arity (VClamp _) = 3
253 :     | arity (VMapClamp _) = 3
254 :     | arity (VLerp _) = 3
255 : jhr 3766 | arity (TensorIndex _) = 1
256 : jhr 3756 | arity EigenVecs2x2 = 1
257 :     | arity EigenVecs3x3 = 1
258 :     | arity EigenVals2x2 = 1
259 :     | arity EigenVals3x3 = 1
260 :     | arity (Zero _) = 0
261 :     | arity (Select _) = 1
262 :     | arity (Subscript _) = 2
263 :     | arity (MkDynamic _) = 1
264 :     | arity (Append _) = 1
265 :     | arity (Prepend _) = 1
266 :     | arity (Concat _) = 1
267 :     | arity Range = 1
268 :     | arity (Length _) = 1
269 :     | arity (SphereQuery _) = 2
270 :     | arity Sqrt = 1
271 :     | arity Cos = 1
272 :     | arity ArcCos = 1
273 : jhr 3835 | arity Sin = 1
274 : jhr 3756 | arity ArcSin = 1
275 :     | arity Tan = 1
276 :     | arity ArcTan = 1
277 : jhr 3757 | arity Exp = 1
278 : jhr 3756 | arity (Ceiling _) = 1
279 :     | arity (Floor _) = 1
280 :     | arity (Round _) = 1
281 :     | arity (Trunc _) = 1
282 :     | arity IntToReal = 1
283 :     | arity (RealToInt _) = 1
284 :     | arity (R_All _) = 3
285 :     | arity (R_Exists _) = 3
286 :     | arity (R_Max _) = 3
287 :     | arity (R_Min _) = 3
288 :     | arity (R_Sum _) = 3
289 :     | arity (R_Product _) = 3
290 :     | arity (R_Mean _) = 3
291 :     | arity (R_Variance _) = 4
292 :     | arity (Transform _) = 2
293 :     | arity (Translate _) = 2
294 : jhr 3766 | arity (BaseAddress _) = 1
295 : jhr 3756 | arity (ControlIndex _) = 2
296 :     | arity (Inside _) = 2
297 :     | arity (ImageDim _) = 1
298 :     | arity (LoadSeq _) = 0
299 :     | arity (LoadImage _) = 0
300 :     | arity (MathFn _) = ~1
301 :    
302 :     fun isPure (MkDynamic _) = false
303 :     | isPure (Append _) = false
304 :     | isPure (Prepend _) = false
305 :     | isPure (Concat _) = false
306 :     | isPure _ = true
307 :    
308 :     fun same (IAdd, IAdd) = true
309 :     | same (ISub, ISub) = true
310 :     | same (IMul, IMul) = true
311 :     | same (IDiv, IDiv) = true
312 :     | same (IMod, IMod) = true
313 :     | same (INeg, INeg) = true
314 :     | same (RAdd, RAdd) = true
315 :     | same (RSub, RSub) = true
316 :     | same (RMul, RMul) = true
317 :     | same (RDiv, RDiv) = true
318 :     | same (RNeg, RNeg) = true
319 : jhr 3830 | same (RClamp, RClamp) = true
320 :     | same (RLerp, RLerp) = true
321 : jhr 3756 | same (LT(a0), LT(b0)) = samety(a0, b0)
322 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
323 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
324 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
325 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
326 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
327 :     | same (Not, Not) = true
328 :     | same (Abs(a0), Abs(b0)) = samety(a0, b0)
329 :     | same (Max(a0), Max(b0)) = samety(a0, b0)
330 :     | same (Min(a0), Min(b0)) = samety(a0, b0)
331 : jhr 3766 | same (VAdd(a0), VAdd(b0)) = sameint(a0, b0)
332 :     | same (VSub(a0), VSub(b0)) = sameint(a0, b0)
333 :     | same (VScale(a0), VScale(b0)) = sameint(a0, b0)
334 :     | same (VMul(a0), VMul(b0)) = sameint(a0, b0)
335 :     | same (VNeg(a0), VNeg(b0)) = sameint(a0, b0)
336 :     | same (VSum(a0), VSum(b0)) = sameint(a0, b0)
337 : jhr 3844 | same (VIndex(a0,a1), VIndex(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
338 : jhr 3830 | same (VClamp(a0), VClamp(b0)) = sameint(a0, b0)
339 :     | same (VMapClamp(a0), VMapClamp(b0)) = sameint(a0, b0)
340 :     | same (VLerp(a0), VLerp(b0)) = sameint(a0, b0)
341 : jhr 3766 | same (TensorIndex(a0,a1), TensorIndex(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
342 : jhr 3756 | same (EigenVecs2x2, EigenVecs2x2) = true
343 :     | same (EigenVecs3x3, EigenVecs3x3) = true
344 :     | same (EigenVals2x2, EigenVals2x2) = true
345 :     | same (EigenVals3x3, EigenVals3x3) = true
346 :     | same (Zero(a0), Zero(b0)) = samety(a0, b0)
347 :     | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
348 :     | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
349 :     | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
350 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
351 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
352 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
353 :     | same (Range, Range) = true
354 :     | same (Length(a0), Length(b0)) = samety(a0, b0)
355 :     | same (SphereQuery(a0,a1), SphereQuery(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
356 :     | same (Sqrt, Sqrt) = true
357 :     | same (Cos, Cos) = true
358 :     | same (ArcCos, ArcCos) = true
359 : jhr 3835 | same (Sin, Sin) = true
360 : jhr 3756 | same (ArcSin, ArcSin) = true
361 :     | same (Tan, Tan) = true
362 :     | same (ArcTan, ArcTan) = true
363 : jhr 3757 | same (Exp, Exp) = true
364 : jhr 3756 | same (Ceiling(a0), Ceiling(b0)) = sameint(a0, b0)
365 :     | same (Floor(a0), Floor(b0)) = sameint(a0, b0)
366 :     | same (Round(a0), Round(b0)) = sameint(a0, b0)
367 :     | same (Trunc(a0), Trunc(b0)) = sameint(a0, b0)
368 :     | same (IntToReal, IntToReal) = true
369 :     | same (RealToInt(a0), RealToInt(b0)) = sameint(a0, b0)
370 :     | same (R_All(a0), R_All(b0)) = samety(a0, b0)
371 :     | same (R_Exists(a0), R_Exists(b0)) = samety(a0, b0)
372 :     | same (R_Max(a0), R_Max(b0)) = samety(a0, b0)
373 :     | same (R_Min(a0), R_Min(b0)) = samety(a0, b0)
374 :     | same (R_Sum(a0), R_Sum(b0)) = samety(a0, b0)
375 :     | same (R_Product(a0), R_Product(b0)) = samety(a0, b0)
376 :     | same (R_Mean(a0), R_Mean(b0)) = samety(a0, b0)
377 :     | same (R_Variance(a0), R_Variance(b0)) = samety(a0, b0)
378 :     | same (Transform(a0,a1), Transform(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
379 :     | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
380 : jhr 3766 | same (BaseAddress(a0), BaseAddress(b0)) = ImageInfo.same(a0, b0)
381 : jhr 3756 | same (ControlIndex(a0,a1,a2), ControlIndex(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameidxctl(a1, b1) andalso sameint(a2, b2)
382 :     | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
383 :     | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
384 :     | same (LoadSeq(a0,a1), LoadSeq(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
385 :     | same (LoadImage(a0,a1), LoadImage(b0,b1)) = samety(a0, b0) andalso samestring(a1, b1)
386 :     | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
387 :     | same _ = false
388 :    
389 :     fun hash IAdd = 0w3
390 :     | hash ISub = 0w5
391 :     | hash IMul = 0w7
392 :     | hash IDiv = 0w11
393 :     | hash IMod = 0w13
394 :     | hash INeg = 0w17
395 : jhr 3766 | hash RAdd = 0w19
396 :     | hash RSub = 0w23
397 :     | hash RMul = 0w29
398 :     | hash RDiv = 0w31
399 :     | hash RNeg = 0w37
400 : jhr 3830 | hash RClamp = 0w41
401 :     | hash RLerp = 0w43
402 :     | hash (LT(a0)) = 0w47 + hashty a0
403 :     | hash (LTE(a0)) = 0w53 + hashty a0
404 :     | hash (EQ(a0)) = 0w59 + hashty a0
405 :     | hash (NEQ(a0)) = 0w61 + hashty a0
406 :     | hash (GT(a0)) = 0w67 + hashty a0
407 :     | hash (GTE(a0)) = 0w71 + hashty a0
408 :     | hash Not = 0w73
409 :     | hash (Abs(a0)) = 0w79 + hashty a0
410 :     | hash (Max(a0)) = 0w83 + hashty a0
411 :     | hash (Min(a0)) = 0w89 + hashty a0
412 : jhr 3766 | hash (VAdd(a0)) = 0w97 + hashint a0
413 :     | hash (VSub(a0)) = 0w101 + hashint a0
414 :     | hash (VScale(a0)) = 0w103 + hashint a0
415 :     | hash (VMul(a0)) = 0w107 + hashint a0
416 :     | hash (VNeg(a0)) = 0w109 + hashint a0
417 :     | hash (VSum(a0)) = 0w113 + hashint a0
418 : jhr 3844 | hash (VIndex(a0,a1)) = 0w127 + hashint a0 + hashint a1
419 :     | hash (VClamp(a0)) = 0w131 + hashint a0
420 :     | hash (VMapClamp(a0)) = 0w137 + hashint a0
421 :     | hash (VLerp(a0)) = 0w139 + hashint a0
422 :     | hash (TensorIndex(a0,a1)) = 0w149 + hashty a0 + hashshape a1
423 :     | hash EigenVecs2x2 = 0w151
424 :     | hash EigenVecs3x3 = 0w157
425 :     | hash EigenVals2x2 = 0w163
426 :     | hash EigenVals3x3 = 0w167
427 :     | hash (Zero(a0)) = 0w173 + hashty a0
428 :     | hash (Select(a0,a1)) = 0w179 + hashty a0 + hashint a1
429 :     | hash (Subscript(a0)) = 0w181 + hashty a0
430 :     | hash (MkDynamic(a0,a1)) = 0w191 + hashty a0 + hashint a1
431 :     | hash (Append(a0)) = 0w193 + hashty a0
432 :     | hash (Prepend(a0)) = 0w197 + hashty a0
433 :     | hash (Concat(a0)) = 0w199 + hashty a0
434 :     | hash Range = 0w211
435 :     | hash (Length(a0)) = 0w223 + hashty a0
436 :     | hash (SphereQuery(a0,a1)) = 0w227 + hashty a0 + hashty a1
437 :     | hash Sqrt = 0w229
438 :     | hash Cos = 0w233
439 :     | hash ArcCos = 0w239
440 :     | hash Sin = 0w241
441 :     | hash ArcSin = 0w251
442 :     | hash Tan = 0w257
443 :     | hash ArcTan = 0w263
444 :     | hash Exp = 0w269
445 :     | hash (Ceiling(a0)) = 0w271 + hashint a0
446 :     | hash (Floor(a0)) = 0w277 + hashint a0
447 :     | hash (Round(a0)) = 0w281 + hashint a0
448 :     | hash (Trunc(a0)) = 0w283 + hashint a0
449 :     | hash IntToReal = 0w293
450 :     | hash (RealToInt(a0)) = 0w307 + hashint a0
451 :     | hash (R_All(a0)) = 0w311 + hashty a0
452 :     | hash (R_Exists(a0)) = 0w313 + hashty a0
453 :     | hash (R_Max(a0)) = 0w317 + hashty a0
454 :     | hash (R_Min(a0)) = 0w331 + hashty a0
455 :     | hash (R_Sum(a0)) = 0w337 + hashty a0
456 :     | hash (R_Product(a0)) = 0w347 + hashty a0
457 :     | hash (R_Mean(a0)) = 0w349 + hashty a0
458 :     | hash (R_Variance(a0)) = 0w353 + hashty a0
459 :     | hash (Transform(a0,a1)) = 0w359 + ImageInfo.hash a0 + hashint a1
460 :     | hash (Translate(a0)) = 0w367 + ImageInfo.hash a0
461 :     | hash (BaseAddress(a0)) = 0w373 + ImageInfo.hash a0
462 :     | hash (ControlIndex(a0,a1,a2)) = 0w379 + ImageInfo.hash a0 + hashidxctl a1 + hashint a2
463 :     | hash (Inside(a0,a1)) = 0w383 + ImageInfo.hash a0 + hashint a1
464 :     | hash (ImageDim(a0,a1)) = 0w389 + ImageInfo.hash a0 + hashint a1
465 :     | hash (LoadSeq(a0,a1)) = 0w397 + hashty a0 + hashstring a1
466 :     | hash (LoadImage(a0,a1)) = 0w401 + hashty a0 + hashstring a1
467 :     | hash (MathFn(a0)) = 0w409 + MathFns.hash a0
468 : jhr 3756
469 :     fun toString IAdd = "IAdd"
470 :     | toString ISub = "ISub"
471 :     | toString IMul = "IMul"
472 :     | toString IDiv = "IDiv"
473 :     | toString IMod = "IMod"
474 :     | toString INeg = "INeg"
475 :     | toString RAdd = "RAdd"
476 :     | toString RSub = "RSub"
477 :     | toString RMul = "RMul"
478 :     | toString RDiv = "RDiv"
479 :     | toString RNeg = "RNeg"
480 : jhr 3830 | toString RClamp = "RClamp"
481 :     | toString RLerp = "RLerp"
482 : jhr 3756 | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
483 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
484 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
485 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
486 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
487 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
488 :     | toString Not = "Not"
489 :     | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
490 :     | toString (Max(a0)) = concat["Max<", tyToString a0, ">"]
491 :     | toString (Min(a0)) = concat["Min<", tyToString a0, ">"]
492 : jhr 3766 | toString (VAdd(a0)) = concat["VAdd<", intToString a0, ">"]
493 :     | toString (VSub(a0)) = concat["VSub<", intToString a0, ">"]
494 :     | toString (VScale(a0)) = concat["VScale<", intToString a0, ">"]
495 :     | toString (VMul(a0)) = concat["VMul<", intToString a0, ">"]
496 :     | toString (VNeg(a0)) = concat["VNeg<", intToString a0, ">"]
497 :     | toString (VSum(a0)) = concat["VSum<", intToString a0, ">"]
498 : jhr 3844 | toString (VIndex(a0,a1)) = concat["VIndex<", intToString a0, ",", intToString a1, ">"]
499 : jhr 3830 | toString (VClamp(a0)) = concat["VClamp<", intToString a0, ">"]
500 :     | toString (VMapClamp(a0)) = concat["VMapClamp<", intToString a0, ">"]
501 :     | toString (VLerp(a0)) = concat["VLerp<", intToString a0, ">"]
502 : jhr 3766 | toString (TensorIndex(a0,a1)) = concat["TensorIndex<", tyToString a0, ",", shapeToString a1, ">"]
503 : jhr 3756 | toString EigenVecs2x2 = "EigenVecs2x2"
504 :     | toString EigenVecs3x3 = "EigenVecs3x3"
505 :     | toString EigenVals2x2 = "EigenVals2x2"
506 :     | toString EigenVals3x3 = "EigenVals3x3"
507 :     | toString (Zero(a0)) = concat["Zero<", tyToString a0, ">"]
508 :     | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
509 :     | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
510 :     | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
511 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
512 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
513 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
514 :     | toString Range = "Range"
515 :     | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
516 :     | toString (SphereQuery(a0,a1)) = concat["SphereQuery<", tyToString a0, ",", tyToString a1, ">"]
517 :     | toString Sqrt = "Sqrt"
518 :     | toString Cos = "Cos"
519 :     | toString ArcCos = "ArcCos"
520 : jhr 3835 | toString Sin = "Sin"
521 : jhr 3756 | toString ArcSin = "ArcSin"
522 :     | toString Tan = "Tan"
523 :     | toString ArcTan = "ArcTan"
524 : jhr 3757 | toString Exp = "Exp"
525 : jhr 3756 | toString (Ceiling(a0)) = concat["Ceiling<", intToString a0, ">"]
526 :     | toString (Floor(a0)) = concat["Floor<", intToString a0, ">"]
527 :     | toString (Round(a0)) = concat["Round<", intToString a0, ">"]
528 :     | toString (Trunc(a0)) = concat["Trunc<", intToString a0, ">"]
529 :     | toString IntToReal = "IntToReal"
530 :     | toString (RealToInt(a0)) = concat["RealToInt<", intToString a0, ">"]
531 :     | toString (R_All(a0)) = concat["R_All<", tyToString a0, ">"]
532 :     | toString (R_Exists(a0)) = concat["R_Exists<", tyToString a0, ">"]
533 :     | toString (R_Max(a0)) = concat["R_Max<", tyToString a0, ">"]
534 :     | toString (R_Min(a0)) = concat["R_Min<", tyToString a0, ">"]
535 :     | toString (R_Sum(a0)) = concat["R_Sum<", tyToString a0, ">"]
536 :     | toString (R_Product(a0)) = concat["R_Product<", tyToString a0, ">"]
537 :     | toString (R_Mean(a0)) = concat["R_Mean<", tyToString a0, ">"]
538 :     | toString (R_Variance(a0)) = concat["R_Variance<", tyToString a0, ">"]
539 :     | toString (Transform(a0,a1)) = concat["Transform<", ImageInfo.toString a0, ",", intToString a1, ">"]
540 :     | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
541 : jhr 3766 | toString (BaseAddress(a0)) = concat["BaseAddress<", ImageInfo.toString a0, ">"]
542 : jhr 3756 | toString (ControlIndex(a0,a1,a2)) = concat["ControlIndex<", ImageInfo.toString a0, ",", idxctlToString a1, ",", intToString a2, ">"]
543 :     | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
544 :     | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
545 :     | toString (LoadSeq(a0,a1)) = concat["LoadSeq<", tyToString a0, ",", stringToString a1, ">"]
546 :     | toString (LoadImage(a0,a1)) = concat["LoadImage<", tyToString a0, ",", stringToString a1, ">"]
547 :     | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
548 :    
549 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0