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 4056 - (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 : jhr 3886 type idxctl = IndexCtl.t
57 : jhr 3756 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 3880 | RCeiling
76 :     | RFloor
77 :     | RRound
78 :     | RTrunc
79 :     | RealToInt
80 : jhr 3756 | LT of ty
81 :     | LTE of ty
82 :     | EQ of ty
83 :     | NEQ of ty
84 :     | GT of ty
85 :     | GTE of ty
86 :     | Not
87 :     | Abs of ty
88 :     | Max of ty
89 :     | Min of ty
90 : jhr 3880 | VAdd of int * int
91 :     | VSub of int * int
92 :     | VScale of int * int
93 :     | VMul of int * int
94 :     | VNeg of int * int
95 :     | VSum of int * int
96 : jhr 4056 | VDot of int * int
97 : jhr 3880 | VIndex of int * int * int
98 :     | VClamp of int * int
99 :     | VMapClamp of int * int
100 :     | VLerp of int * int
101 :     | VCeiling of int * int
102 :     | VFloor of int * int
103 :     | VRound of int * int
104 :     | VTrunc of int * int
105 :     | VToInt of int * int
106 : jhr 3766 | TensorIndex of ty * shape
107 : jhr 3853 | ProjectLast of ty * shape
108 : jhr 3955 | TensorCopy of shape
109 : jhr 4033 | TensorRef of shape
110 : jhr 3756 | EigenVecs2x2
111 :     | EigenVecs3x3
112 :     | EigenVals2x2
113 :     | EigenVals3x3
114 :     | Select of ty * int
115 :     | Subscript of ty
116 :     | MkDynamic of ty * int
117 :     | Append of ty
118 :     | Prepend of ty
119 :     | Concat of ty
120 :     | Range
121 :     | Length of ty
122 :     | SphereQuery of ty * ty
123 :     | Sqrt
124 :     | Cos
125 :     | ArcCos
126 : jhr 3835 | Sin
127 : jhr 3756 | ArcSin
128 :     | Tan
129 :     | ArcTan
130 : jhr 3757 | Exp
131 : jhr 3756 | IntToReal
132 :     | R_All of ty
133 :     | R_Exists of ty
134 :     | R_Max of ty
135 :     | R_Min of ty
136 :     | R_Sum of ty
137 :     | R_Product of ty
138 :     | R_Mean of ty
139 :     | R_Variance of ty
140 : jhr 3851 | Transform of ImageInfo.info
141 : jhr 3756 | Translate of ImageInfo.info
142 : jhr 3766 | BaseAddress of ImageInfo.info
143 : jhr 3756 | ControlIndex of ImageInfo.info * idxctl * int
144 : jhr 3851 | LoadVoxel of ImageInfo.info
145 : jhr 3756 | Inside of ImageInfo.info * int
146 :     | ImageDim of ImageInfo.info * int
147 :     | MathFn of MathFns.t
148 :    
149 :     fun resultArity IAdd = 1
150 :     | resultArity ISub = 1
151 :     | resultArity IMul = 1
152 :     | resultArity IDiv = 1
153 :     | resultArity IMod = 1
154 :     | resultArity INeg = 1
155 :     | resultArity RAdd = 1
156 :     | resultArity RSub = 1
157 :     | resultArity RMul = 1
158 :     | resultArity RDiv = 1
159 :     | resultArity RNeg = 1
160 : jhr 3830 | resultArity RClamp = 1
161 :     | resultArity RLerp = 1
162 : jhr 3880 | resultArity RCeiling = 1
163 :     | resultArity RFloor = 1
164 :     | resultArity RRound = 1
165 :     | resultArity RTrunc = 1
166 :     | resultArity RealToInt = 1
167 : jhr 3756 | resultArity (LT _) = 1
168 :     | resultArity (LTE _) = 1
169 :     | resultArity (EQ _) = 1
170 :     | resultArity (NEQ _) = 1
171 :     | resultArity (GT _) = 1
172 :     | resultArity (GTE _) = 1
173 :     | resultArity Not = 1
174 :     | resultArity (Abs _) = 1
175 :     | resultArity (Max _) = 1
176 :     | resultArity (Min _) = 1
177 : jhr 3766 | resultArity (VAdd _) = 1
178 :     | resultArity (VSub _) = 1
179 :     | resultArity (VScale _) = 1
180 :     | resultArity (VMul _) = 1
181 :     | resultArity (VNeg _) = 1
182 :     | resultArity (VSum _) = 1
183 : jhr 4056 | resultArity (VDot _) = 1
184 : jhr 3844 | resultArity (VIndex _) = 1
185 : jhr 3830 | resultArity (VClamp _) = 1
186 :     | resultArity (VMapClamp _) = 1
187 :     | resultArity (VLerp _) = 1
188 : jhr 3880 | resultArity (VCeiling _) = 1
189 :     | resultArity (VFloor _) = 1
190 :     | resultArity (VRound _) = 1
191 :     | resultArity (VTrunc _) = 1
192 :     | resultArity (VToInt _) = 1
193 : jhr 3766 | resultArity (TensorIndex _) = 1
194 : jhr 3853 | resultArity (ProjectLast _) = 1
195 : jhr 3955 | resultArity (TensorCopy _) = 1
196 : jhr 4033 | resultArity (TensorRef _) = 1
197 : jhr 3756 | resultArity EigenVecs2x2 = 1
198 :     | resultArity EigenVecs3x3 = 1
199 :     | resultArity EigenVals2x2 = 1
200 :     | resultArity EigenVals3x3 = 1
201 :     | resultArity (Select _) = 1
202 :     | resultArity (Subscript _) = 1
203 :     | resultArity (MkDynamic _) = 1
204 : jhr 3866 | resultArity (Append _) = 1
205 :     | resultArity (Prepend _) = 1
206 :     | resultArity (Concat _) = 1
207 :     | resultArity Range = 1
208 : jhr 3756 | resultArity (Length _) = 1
209 :     | resultArity (SphereQuery _) = 1
210 :     | resultArity Sqrt = 1
211 :     | resultArity Cos = 1
212 :     | resultArity ArcCos = 1
213 : jhr 3835 | resultArity Sin = 1
214 : jhr 3756 | resultArity ArcSin = 1
215 :     | resultArity Tan = 1
216 :     | resultArity ArcTan = 1
217 : jhr 3757 | resultArity Exp = 1
218 : jhr 3756 | resultArity IntToReal = 1
219 :     | resultArity (R_All _) = 1
220 :     | resultArity (R_Exists _) = 1
221 :     | resultArity (R_Max _) = 1
222 :     | resultArity (R_Min _) = 1
223 :     | resultArity (R_Sum _) = 1
224 :     | resultArity (R_Product _) = 1
225 :     | resultArity (R_Mean _) = 1
226 :     | resultArity (R_Variance _) = 1
227 :     | resultArity (Transform _) = 1
228 :     | resultArity (Translate _) = 1
229 : jhr 3766 | resultArity (BaseAddress _) = 1
230 : jhr 3756 | resultArity (ControlIndex _) = 1
231 : jhr 3851 | resultArity (LoadVoxel _) = 1
232 : jhr 3756 | resultArity (Inside _) = 1
233 :     | resultArity (ImageDim _) = 1
234 :     | resultArity (MathFn _) = 1
235 :    
236 :     fun arity IAdd = 2
237 :     | arity ISub = 2
238 :     | arity IMul = 2
239 :     | arity IDiv = 2
240 :     | arity IMod = 2
241 :     | arity INeg = 1
242 :     | arity RAdd = 2
243 :     | arity RSub = 2
244 :     | arity RMul = 2
245 :     | arity RDiv = 2
246 :     | arity RNeg = 1
247 : jhr 3830 | arity RClamp = 3
248 :     | arity RLerp = 3
249 : jhr 3880 | arity RCeiling = 1
250 :     | arity RFloor = 1
251 :     | arity RRound = 1
252 :     | arity RTrunc = 1
253 :     | arity RealToInt = 1
254 : jhr 3756 | arity (LT _) = 2
255 :     | arity (LTE _) = 2
256 :     | arity (EQ _) = 2
257 :     | arity (NEQ _) = 2
258 :     | arity (GT _) = 2
259 :     | arity (GTE _) = 2
260 :     | arity Not = 1
261 :     | arity (Abs _) = 1
262 :     | arity (Max _) = 2
263 :     | arity (Min _) = 2
264 : jhr 3766 | arity (VAdd _) = 2
265 :     | arity (VSub _) = 2
266 :     | arity (VScale _) = 2
267 :     | arity (VMul _) = 2
268 :     | arity (VNeg _) = 2
269 :     | arity (VSum _) = 1
270 : jhr 4056 | arity (VDot _) = 2
271 : jhr 3844 | arity (VIndex _) = 1
272 : jhr 3830 | arity (VClamp _) = 3
273 :     | arity (VMapClamp _) = 3
274 :     | arity (VLerp _) = 3
275 : jhr 3880 | arity (VCeiling _) = 1
276 :     | arity (VFloor _) = 1
277 :     | arity (VRound _) = 1
278 :     | arity (VTrunc _) = 1
279 :     | arity (VToInt _) = 1
280 : jhr 3766 | arity (TensorIndex _) = 1
281 : jhr 3853 | arity (ProjectLast _) = 1
282 : jhr 3955 | arity (TensorCopy _) = 1
283 : jhr 4033 | arity (TensorRef _) = 1
284 : jhr 3756 | arity EigenVecs2x2 = 1
285 :     | arity EigenVecs3x3 = 1
286 :     | arity EigenVals2x2 = 1
287 :     | arity EigenVals3x3 = 1
288 :     | arity (Select _) = 1
289 :     | arity (Subscript _) = 2
290 :     | arity (MkDynamic _) = 1
291 : jhr 3866 | arity (Append _) = 2
292 :     | arity (Prepend _) = 2
293 :     | arity (Concat _) = 2
294 :     | arity Range = 2
295 : jhr 3756 | arity (Length _) = 1
296 :     | arity (SphereQuery _) = 2
297 :     | arity Sqrt = 1
298 :     | arity Cos = 1
299 :     | arity ArcCos = 1
300 : jhr 3835 | arity Sin = 1
301 : jhr 3756 | arity ArcSin = 1
302 :     | arity Tan = 1
303 :     | arity ArcTan = 1
304 : jhr 3757 | arity Exp = 1
305 : jhr 3756 | arity IntToReal = 1
306 :     | arity (R_All _) = 3
307 :     | arity (R_Exists _) = 3
308 :     | arity (R_Max _) = 3
309 :     | arity (R_Min _) = 3
310 :     | arity (R_Sum _) = 3
311 :     | arity (R_Product _) = 3
312 :     | arity (R_Mean _) = 3
313 :     | arity (R_Variance _) = 4
314 : jhr 3870 | arity (Transform _) = 1
315 :     | arity (Translate _) = 1
316 : jhr 3766 | arity (BaseAddress _) = 1
317 : jhr 3756 | arity (ControlIndex _) = 2
318 : jhr 3851 | arity (LoadVoxel _) = 2
319 : jhr 3756 | arity (Inside _) = 2
320 :     | arity (ImageDim _) = 1
321 :     | arity (MathFn _) = ~1
322 :    
323 :     fun isPure (MkDynamic _) = false
324 :     | isPure (Append _) = false
325 :     | isPure (Prepend _) = false
326 :     | isPure (Concat _) = false
327 :     | isPure _ = true
328 :    
329 :     fun same (IAdd, IAdd) = true
330 :     | same (ISub, ISub) = true
331 :     | same (IMul, IMul) = true
332 :     | same (IDiv, IDiv) = true
333 :     | same (IMod, IMod) = true
334 :     | same (INeg, INeg) = true
335 :     | same (RAdd, RAdd) = true
336 :     | same (RSub, RSub) = true
337 :     | same (RMul, RMul) = true
338 :     | same (RDiv, RDiv) = true
339 :     | same (RNeg, RNeg) = true
340 : jhr 3830 | same (RClamp, RClamp) = true
341 :     | same (RLerp, RLerp) = true
342 : jhr 3880 | same (RCeiling, RCeiling) = true
343 :     | same (RFloor, RFloor) = true
344 :     | same (RRound, RRound) = true
345 :     | same (RTrunc, RTrunc) = true
346 :     | same (RealToInt, RealToInt) = true
347 : jhr 3756 | same (LT(a0), LT(b0)) = samety(a0, b0)
348 :     | same (LTE(a0), LTE(b0)) = samety(a0, b0)
349 :     | same (EQ(a0), EQ(b0)) = samety(a0, b0)
350 :     | same (NEQ(a0), NEQ(b0)) = samety(a0, b0)
351 :     | same (GT(a0), GT(b0)) = samety(a0, b0)
352 :     | same (GTE(a0), GTE(b0)) = samety(a0, b0)
353 :     | same (Not, Not) = true
354 :     | same (Abs(a0), Abs(b0)) = samety(a0, b0)
355 :     | same (Max(a0), Max(b0)) = samety(a0, b0)
356 :     | same (Min(a0), Min(b0)) = samety(a0, b0)
357 : jhr 3880 | same (VAdd(a0,a1), VAdd(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
358 :     | same (VSub(a0,a1), VSub(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
359 :     | same (VScale(a0,a1), VScale(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
360 :     | same (VMul(a0,a1), VMul(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
361 :     | same (VNeg(a0,a1), VNeg(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
362 :     | same (VSum(a0,a1), VSum(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
363 : jhr 4056 | same (VDot(a0,a1), VDot(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
364 : jhr 3880 | same (VIndex(a0,a1,a2), VIndex(b0,b1,b2)) = sameint(a0, b0) andalso sameint(a1, b1) andalso sameint(a2, b2)
365 :     | same (VClamp(a0,a1), VClamp(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
366 :     | same (VMapClamp(a0,a1), VMapClamp(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
367 :     | same (VLerp(a0,a1), VLerp(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
368 :     | same (VCeiling(a0,a1), VCeiling(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
369 :     | same (VFloor(a0,a1), VFloor(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
370 :     | same (VRound(a0,a1), VRound(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
371 :     | same (VTrunc(a0,a1), VTrunc(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
372 :     | same (VToInt(a0,a1), VToInt(b0,b1)) = sameint(a0, b0) andalso sameint(a1, b1)
373 : jhr 3766 | same (TensorIndex(a0,a1), TensorIndex(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
374 : jhr 3853 | same (ProjectLast(a0,a1), ProjectLast(b0,b1)) = samety(a0, b0) andalso sameshape(a1, b1)
375 : jhr 3955 | same (TensorCopy(a0), TensorCopy(b0)) = sameshape(a0, b0)
376 : jhr 4033 | same (TensorRef(a0), TensorRef(b0)) = sameshape(a0, b0)
377 : jhr 3756 | same (EigenVecs2x2, EigenVecs2x2) = true
378 :     | same (EigenVecs3x3, EigenVecs3x3) = true
379 :     | same (EigenVals2x2, EigenVals2x2) = true
380 :     | same (EigenVals3x3, EigenVals3x3) = true
381 :     | same (Select(a0,a1), Select(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
382 :     | same (Subscript(a0), Subscript(b0)) = samety(a0, b0)
383 :     | same (MkDynamic(a0,a1), MkDynamic(b0,b1)) = samety(a0, b0) andalso sameint(a1, b1)
384 :     | same (Append(a0), Append(b0)) = samety(a0, b0)
385 :     | same (Prepend(a0), Prepend(b0)) = samety(a0, b0)
386 :     | same (Concat(a0), Concat(b0)) = samety(a0, b0)
387 :     | same (Range, Range) = true
388 :     | same (Length(a0), Length(b0)) = samety(a0, b0)
389 :     | same (SphereQuery(a0,a1), SphereQuery(b0,b1)) = samety(a0, b0) andalso samety(a1, b1)
390 :     | same (Sqrt, Sqrt) = true
391 :     | same (Cos, Cos) = true
392 :     | same (ArcCos, ArcCos) = true
393 : jhr 3835 | same (Sin, Sin) = true
394 : jhr 3756 | same (ArcSin, ArcSin) = true
395 :     | same (Tan, Tan) = true
396 :     | same (ArcTan, ArcTan) = true
397 : jhr 3757 | same (Exp, Exp) = true
398 : jhr 3756 | same (IntToReal, IntToReal) = true
399 :     | same (R_All(a0), R_All(b0)) = samety(a0, b0)
400 :     | same (R_Exists(a0), R_Exists(b0)) = samety(a0, b0)
401 :     | same (R_Max(a0), R_Max(b0)) = samety(a0, b0)
402 :     | same (R_Min(a0), R_Min(b0)) = samety(a0, b0)
403 :     | same (R_Sum(a0), R_Sum(b0)) = samety(a0, b0)
404 :     | same (R_Product(a0), R_Product(b0)) = samety(a0, b0)
405 :     | same (R_Mean(a0), R_Mean(b0)) = samety(a0, b0)
406 :     | same (R_Variance(a0), R_Variance(b0)) = samety(a0, b0)
407 : jhr 3851 | same (Transform(a0), Transform(b0)) = ImageInfo.same(a0, b0)
408 : jhr 3756 | same (Translate(a0), Translate(b0)) = ImageInfo.same(a0, b0)
409 : jhr 3766 | same (BaseAddress(a0), BaseAddress(b0)) = ImageInfo.same(a0, b0)
410 : jhr 3756 | same (ControlIndex(a0,a1,a2), ControlIndex(b0,b1,b2)) = ImageInfo.same(a0, b0) andalso sameidxctl(a1, b1) andalso sameint(a2, b2)
411 : jhr 3851 | same (LoadVoxel(a0), LoadVoxel(b0)) = ImageInfo.same(a0, b0)
412 : jhr 3756 | same (Inside(a0,a1), Inside(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
413 :     | same (ImageDim(a0,a1), ImageDim(b0,b1)) = ImageInfo.same(a0, b0) andalso sameint(a1, b1)
414 :     | same (MathFn(a0), MathFn(b0)) = MathFns.same(a0, b0)
415 :     | same _ = false
416 :    
417 :     fun hash IAdd = 0w3
418 :     | hash ISub = 0w5
419 :     | hash IMul = 0w7
420 :     | hash IDiv = 0w11
421 :     | hash IMod = 0w13
422 :     | hash INeg = 0w17
423 : jhr 3766 | hash RAdd = 0w19
424 :     | hash RSub = 0w23
425 :     | hash RMul = 0w29
426 :     | hash RDiv = 0w31
427 :     | hash RNeg = 0w37
428 : jhr 3830 | hash RClamp = 0w41
429 :     | hash RLerp = 0w43
430 : jhr 3880 | hash RCeiling = 0w47
431 :     | hash RFloor = 0w53
432 :     | hash RRound = 0w59
433 :     | hash RTrunc = 0w61
434 :     | hash RealToInt = 0w67
435 :     | hash (LT(a0)) = 0w71 + hashty a0
436 :     | hash (LTE(a0)) = 0w73 + hashty a0
437 :     | hash (EQ(a0)) = 0w79 + hashty a0
438 :     | hash (NEQ(a0)) = 0w83 + hashty a0
439 :     | hash (GT(a0)) = 0w89 + hashty a0
440 :     | hash (GTE(a0)) = 0w97 + hashty a0
441 :     | hash Not = 0w101
442 :     | hash (Abs(a0)) = 0w103 + hashty a0
443 :     | hash (Max(a0)) = 0w107 + hashty a0
444 :     | hash (Min(a0)) = 0w109 + hashty a0
445 :     | hash (VAdd(a0,a1)) = 0w113 + hashint a0 + hashint a1
446 :     | hash (VSub(a0,a1)) = 0w127 + hashint a0 + hashint a1
447 :     | hash (VScale(a0,a1)) = 0w131 + hashint a0 + hashint a1
448 :     | hash (VMul(a0,a1)) = 0w137 + hashint a0 + hashint a1
449 :     | hash (VNeg(a0,a1)) = 0w139 + hashint a0 + hashint a1
450 :     | hash (VSum(a0,a1)) = 0w149 + hashint a0 + hashint a1
451 : jhr 4056 | hash (VDot(a0,a1)) = 0w151 + hashint a0 + hashint a1
452 :     | hash (VIndex(a0,a1,a2)) = 0w157 + hashint a0 + hashint a1 + hashint a2
453 :     | hash (VClamp(a0,a1)) = 0w163 + hashint a0 + hashint a1
454 :     | hash (VMapClamp(a0,a1)) = 0w167 + hashint a0 + hashint a1
455 :     | hash (VLerp(a0,a1)) = 0w173 + hashint a0 + hashint a1
456 :     | hash (VCeiling(a0,a1)) = 0w179 + hashint a0 + hashint a1
457 :     | hash (VFloor(a0,a1)) = 0w181 + hashint a0 + hashint a1
458 :     | hash (VRound(a0,a1)) = 0w191 + hashint a0 + hashint a1
459 :     | hash (VTrunc(a0,a1)) = 0w193 + hashint a0 + hashint a1
460 :     | hash (VToInt(a0,a1)) = 0w197 + hashint a0 + hashint a1
461 :     | hash (TensorIndex(a0,a1)) = 0w199 + hashty a0 + hashshape a1
462 :     | hash (ProjectLast(a0,a1)) = 0w211 + hashty a0 + hashshape a1
463 :     | hash (TensorCopy(a0)) = 0w223 + hashshape a0
464 :     | hash (TensorRef(a0)) = 0w227 + hashshape a0
465 :     | hash EigenVecs2x2 = 0w229
466 :     | hash EigenVecs3x3 = 0w233
467 :     | hash EigenVals2x2 = 0w239
468 :     | hash EigenVals3x3 = 0w241
469 :     | hash (Select(a0,a1)) = 0w251 + hashty a0 + hashint a1
470 :     | hash (Subscript(a0)) = 0w257 + hashty a0
471 :     | hash (MkDynamic(a0,a1)) = 0w263 + hashty a0 + hashint a1
472 :     | hash (Append(a0)) = 0w269 + hashty a0
473 :     | hash (Prepend(a0)) = 0w271 + hashty a0
474 :     | hash (Concat(a0)) = 0w277 + hashty a0
475 :     | hash Range = 0w281
476 :     | hash (Length(a0)) = 0w283 + hashty a0
477 :     | hash (SphereQuery(a0,a1)) = 0w293 + hashty a0 + hashty a1
478 :     | hash Sqrt = 0w307
479 :     | hash Cos = 0w311
480 :     | hash ArcCos = 0w313
481 :     | hash Sin = 0w317
482 :     | hash ArcSin = 0w331
483 :     | hash Tan = 0w337
484 :     | hash ArcTan = 0w347
485 :     | hash Exp = 0w349
486 :     | hash IntToReal = 0w353
487 :     | hash (R_All(a0)) = 0w359 + hashty a0
488 :     | hash (R_Exists(a0)) = 0w367 + hashty a0
489 :     | hash (R_Max(a0)) = 0w373 + hashty a0
490 :     | hash (R_Min(a0)) = 0w379 + hashty a0
491 :     | hash (R_Sum(a0)) = 0w383 + hashty a0
492 :     | hash (R_Product(a0)) = 0w389 + hashty a0
493 :     | hash (R_Mean(a0)) = 0w397 + hashty a0
494 :     | hash (R_Variance(a0)) = 0w401 + hashty a0
495 :     | hash (Transform(a0)) = 0w409 + ImageInfo.hash a0
496 :     | hash (Translate(a0)) = 0w419 + ImageInfo.hash a0
497 :     | hash (BaseAddress(a0)) = 0w421 + ImageInfo.hash a0
498 :     | hash (ControlIndex(a0,a1,a2)) = 0w431 + ImageInfo.hash a0 + hashidxctl a1 + hashint a2
499 :     | hash (LoadVoxel(a0)) = 0w433 + ImageInfo.hash a0
500 :     | hash (Inside(a0,a1)) = 0w439 + ImageInfo.hash a0 + hashint a1
501 :     | hash (ImageDim(a0,a1)) = 0w443 + ImageInfo.hash a0 + hashint a1
502 :     | hash (MathFn(a0)) = 0w449 + MathFns.hash a0
503 : jhr 3756
504 :     fun toString IAdd = "IAdd"
505 :     | toString ISub = "ISub"
506 :     | toString IMul = "IMul"
507 :     | toString IDiv = "IDiv"
508 :     | toString IMod = "IMod"
509 :     | toString INeg = "INeg"
510 :     | toString RAdd = "RAdd"
511 :     | toString RSub = "RSub"
512 :     | toString RMul = "RMul"
513 :     | toString RDiv = "RDiv"
514 :     | toString RNeg = "RNeg"
515 : jhr 3830 | toString RClamp = "RClamp"
516 :     | toString RLerp = "RLerp"
517 : jhr 3880 | toString RCeiling = "RCeiling"
518 :     | toString RFloor = "RFloor"
519 :     | toString RRound = "RRound"
520 :     | toString RTrunc = "RTrunc"
521 :     | toString RealToInt = "RealToInt"
522 : jhr 3756 | toString (LT(a0)) = concat["LT<", tyToString a0, ">"]
523 :     | toString (LTE(a0)) = concat["LTE<", tyToString a0, ">"]
524 :     | toString (EQ(a0)) = concat["EQ<", tyToString a0, ">"]
525 :     | toString (NEQ(a0)) = concat["NEQ<", tyToString a0, ">"]
526 :     | toString (GT(a0)) = concat["GT<", tyToString a0, ">"]
527 :     | toString (GTE(a0)) = concat["GTE<", tyToString a0, ">"]
528 :     | toString Not = "Not"
529 :     | toString (Abs(a0)) = concat["Abs<", tyToString a0, ">"]
530 :     | toString (Max(a0)) = concat["Max<", tyToString a0, ">"]
531 :     | toString (Min(a0)) = concat["Min<", tyToString a0, ">"]
532 : jhr 3880 | toString (VAdd(a0,a1)) = concat["VAdd<", intToString a0, ",", intToString a1, ">"]
533 :     | toString (VSub(a0,a1)) = concat["VSub<", intToString a0, ",", intToString a1, ">"]
534 :     | toString (VScale(a0,a1)) = concat["VScale<", intToString a0, ",", intToString a1, ">"]
535 :     | toString (VMul(a0,a1)) = concat["VMul<", intToString a0, ",", intToString a1, ">"]
536 :     | toString (VNeg(a0,a1)) = concat["VNeg<", intToString a0, ",", intToString a1, ">"]
537 :     | toString (VSum(a0,a1)) = concat["VSum<", intToString a0, ",", intToString a1, ">"]
538 : jhr 4056 | toString (VDot(a0,a1)) = concat["VDot<", intToString a0, ",", intToString a1, ">"]
539 : jhr 3880 | toString (VIndex(a0,a1,a2)) = concat["VIndex<", intToString a0, ",", intToString a1, ",", intToString a2, ">"]
540 :     | toString (VClamp(a0,a1)) = concat["VClamp<", intToString a0, ",", intToString a1, ">"]
541 :     | toString (VMapClamp(a0,a1)) = concat["VMapClamp<", intToString a0, ",", intToString a1, ">"]
542 :     | toString (VLerp(a0,a1)) = concat["VLerp<", intToString a0, ",", intToString a1, ">"]
543 :     | toString (VCeiling(a0,a1)) = concat["VCeiling<", intToString a0, ",", intToString a1, ">"]
544 :     | toString (VFloor(a0,a1)) = concat["VFloor<", intToString a0, ",", intToString a1, ">"]
545 :     | toString (VRound(a0,a1)) = concat["VRound<", intToString a0, ",", intToString a1, ">"]
546 :     | toString (VTrunc(a0,a1)) = concat["VTrunc<", intToString a0, ",", intToString a1, ">"]
547 :     | toString (VToInt(a0,a1)) = concat["VToInt<", intToString a0, ",", intToString a1, ">"]
548 : jhr 3766 | toString (TensorIndex(a0,a1)) = concat["TensorIndex<", tyToString a0, ",", shapeToString a1, ">"]
549 : jhr 3853 | toString (ProjectLast(a0,a1)) = concat["ProjectLast<", tyToString a0, ",", shapeToString a1, ">"]
550 : jhr 3955 | toString (TensorCopy(a0)) = concat["TensorCopy<", shapeToString a0, ">"]
551 : jhr 4033 | toString (TensorRef(a0)) = concat["TensorRef<", shapeToString a0, ">"]
552 : jhr 3756 | toString EigenVecs2x2 = "EigenVecs2x2"
553 :     | toString EigenVecs3x3 = "EigenVecs3x3"
554 :     | toString EigenVals2x2 = "EigenVals2x2"
555 :     | toString EigenVals3x3 = "EigenVals3x3"
556 :     | toString (Select(a0,a1)) = concat["Select<", tyToString a0, ",", intToString a1, ">"]
557 :     | toString (Subscript(a0)) = concat["Subscript<", tyToString a0, ">"]
558 :     | toString (MkDynamic(a0,a1)) = concat["MkDynamic<", tyToString a0, ",", intToString a1, ">"]
559 :     | toString (Append(a0)) = concat["Append<", tyToString a0, ">"]
560 :     | toString (Prepend(a0)) = concat["Prepend<", tyToString a0, ">"]
561 :     | toString (Concat(a0)) = concat["Concat<", tyToString a0, ">"]
562 :     | toString Range = "Range"
563 :     | toString (Length(a0)) = concat["Length<", tyToString a0, ">"]
564 :     | toString (SphereQuery(a0,a1)) = concat["SphereQuery<", tyToString a0, ",", tyToString a1, ">"]
565 :     | toString Sqrt = "Sqrt"
566 :     | toString Cos = "Cos"
567 :     | toString ArcCos = "ArcCos"
568 : jhr 3835 | toString Sin = "Sin"
569 : jhr 3756 | toString ArcSin = "ArcSin"
570 :     | toString Tan = "Tan"
571 :     | toString ArcTan = "ArcTan"
572 : jhr 3757 | toString Exp = "Exp"
573 : jhr 3756 | toString IntToReal = "IntToReal"
574 :     | toString (R_All(a0)) = concat["R_All<", tyToString a0, ">"]
575 :     | toString (R_Exists(a0)) = concat["R_Exists<", tyToString a0, ">"]
576 :     | toString (R_Max(a0)) = concat["R_Max<", tyToString a0, ">"]
577 :     | toString (R_Min(a0)) = concat["R_Min<", tyToString a0, ">"]
578 :     | toString (R_Sum(a0)) = concat["R_Sum<", tyToString a0, ">"]
579 :     | toString (R_Product(a0)) = concat["R_Product<", tyToString a0, ">"]
580 :     | toString (R_Mean(a0)) = concat["R_Mean<", tyToString a0, ">"]
581 :     | toString (R_Variance(a0)) = concat["R_Variance<", tyToString a0, ">"]
582 : jhr 3851 | toString (Transform(a0)) = concat["Transform<", ImageInfo.toString a0, ">"]
583 : jhr 3756 | toString (Translate(a0)) = concat["Translate<", ImageInfo.toString a0, ">"]
584 : jhr 3766 | toString (BaseAddress(a0)) = concat["BaseAddress<", ImageInfo.toString a0, ">"]
585 : jhr 3756 | toString (ControlIndex(a0,a1,a2)) = concat["ControlIndex<", ImageInfo.toString a0, ",", idxctlToString a1, ",", intToString a2, ">"]
586 : jhr 3851 | toString (LoadVoxel(a0)) = concat["LoadVoxel<", ImageInfo.toString a0, ">"]
587 : jhr 3756 | toString (Inside(a0,a1)) = concat["Inside<", ImageInfo.toString a0, ",", intToString a1, ">"]
588 :     | toString (ImageDim(a0,a1)) = concat["ImageDim<", ImageInfo.toString a0, ",", intToString a1, ">"]
589 :     | toString (MathFn(a0)) = concat["MathFn<", MathFns.toString a0, ">"]
590 :    
591 :     end

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