-
Notifications
You must be signed in to change notification settings - Fork 0
/
foldleft.check
468 lines (468 loc) · 10.2 KB
/
foldleft.check
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
/*****************************************
Emitting Generated Code
*******************************************/
class foldLeftId extends ((Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int): scala.collection.immutable.List[Int] = {
val x1 = List(1,2,3)
var x3: scala.collection.immutable.List[Int] = x1
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x18 = while ({val x5 = x3
val x6 = x5.isEmpty
val x7 = !x6
x7}) {
val x9 = x4
val x10 = x3
val x11 = x10.head
val x12 = List(x11)
val x13 = x9 ::: x12
x4 = x13
val x15 = x10.tail
x3 = x15
()
}
val x19 = x4
x19
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(1, 2, 3)
/*****************************************
Emitting Generated Code
*******************************************/
class map extends ((Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int): scala.collection.immutable.List[Int] = {
val x1 = List(1,2,3)
var x3: scala.collection.immutable.List[Int] = x1
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x19 = while ({val x5 = x3
val x6 = x5.isEmpty
val x7 = !x6
x7}) {
val x9 = x4
val x10 = x3
val x11 = x10.head
val x12 = x11 * 2
val x13 = List(x12)
val x14 = x9 ::: x13
x4 = x14
val x16 = x10.tail
x3 = x16
()
}
val x20 = x4
x20
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(2, 4, 6)
/*****************************************
Emitting Generated Code
*******************************************/
class mapmap extends ((Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int): scala.collection.immutable.List[Int] = {
val x1 = List(1,2,3)
var x3: scala.collection.immutable.List[Int] = x1
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x20 = while ({val x5 = x3
val x6 = x5.isEmpty
val x7 = !x6
x7}) {
val x9 = x4
val x10 = x3
val x11 = x10.head
val x12 = x11 * 2
val x13 = x12 + 1
val x14 = List(x13)
val x15 = x9 ::: x14
x4 = x15
val x17 = x10.tail
x3 = x17
()
}
val x21 = x4
x21
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(3, 5, 7)
/*****************************************
Emitting Generated Code
*******************************************/
class mapmapRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x3: Int = x0
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x18 = while ({val x5 = x3
val x6 = x5 <= x1
x6}) {
val x8 = x4
val x9 = x3
val x10 = x9 * 2
val x11 = x10 + 1
val x12 = List(x11)
val x13 = x8 ::: x12
x4 = x13
val x15 = x9 + 1
x3 = x15
()
}
val x19 = x4
x19
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(3, 5, 7, 9, 11)
/*****************************************
Emitting Generated Code
*******************************************/
class filterRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x3: Int = x0
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x19 = while ({val x5 = x3
val x6 = x5 <= x1
x6}) {
val x8 = x4
val x9 = x3
val x10 = x9 % 2
val x11 = x10 == 1
val x14 = if (x11) {
val x12 = List(x9)
val x13 = x8 ::: x12
x13
} else {
x8
}
x4 = x14
val x16 = x9 + 1
x3 = x16
()
}
val x20 = x4
x20
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(1, 3, 5)
/*****************************************
Emitting Generated Code
*******************************************/
class filtermapRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x3: Int = x0
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x20 = while ({val x5 = x3
val x6 = x5 <= x1
x6}) {
val x8 = x4
val x9 = x3
val x10 = x9 % 2
val x11 = x10 == 1
val x15 = if (x11) {
val x12 = x9 * 3
val x13 = List(x12)
val x14 = x8 ::: x13
x14
} else {
x8
}
x4 = x15
val x17 = x9 + 1
x3 = x17
()
}
val x21 = x4
x21
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(3, 9, 15)
/*****************************************
Emitting Generated Code
*******************************************/
class flatMapRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x3: Int = x0
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x29 = while ({val x5 = x3
val x6 = x5 <= x1
x6}) {
val x8 = x4
val x9 = x3
var x10: Int = 1
var x11: scala.collection.immutable.List[Int] = x8
val x23 = while ({val x12 = x10
val x13 = x12 <= x9
x13}) {
val x15 = x11
val x16 = x10
val x17 = List(x16)
val x18 = x15 ::: x17
x11 = x18
val x20 = x16 + 1
x10 = x20
()
}
val x24 = x11
x4 = x24
val x26 = x9 + 1
x3 = x26
()
}
val x30 = x4
x30
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(1, 1, 2, 1, 2, 3, 1, 2, 3, 4, 1, 2, 3, 4, 5)
/*****************************************
Emitting Generated Code
*******************************************/
class flatMapmapRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x3: Int = x0
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x30 = while ({val x5 = x3
val x6 = x5 <= x1
x6}) {
val x8 = x4
val x9 = x3
var x10: Int = 1
var x11: scala.collection.immutable.List[Int] = x8
val x24 = while ({val x12 = x10
val x13 = x12 <= x9
x13}) {
val x15 = x11
val x16 = x10
val x17 = x16 * 2
val x18 = List(x17)
val x19 = x15 ::: x18
x11 = x19
val x21 = x16 + 1
x10 = x21
()
}
val x25 = x11
x4 = x25
val x27 = x9 + 1
x3 = x27
()
}
val x31 = x4
x31
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(2, 2, 4, 2, 4, 6, 2, 4, 6, 8, 2, 4, 6, 8, 10)
/*****************************************
Emitting Generated Code
*******************************************/
class flatMapfiltermapRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x3: Int = x0
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x33 = while ({val x5 = x3
val x6 = x5 <= x1
x6}) {
val x8 = x4
val x9 = x3
var x10: Int = 1
var x11: scala.collection.immutable.List[Int] = x8
val x27 = while ({val x12 = x10
val x13 = x12 <= x9
x13}) {
val x15 = x11
val x16 = x10
val x17 = x16 % 2
val x18 = x17 == 1
val x22 = if (x18) {
val x19 = x16 * 3
val x20 = List(x19)
val x21 = x15 ::: x20
x21
} else {
x15
}
x11 = x22
val x24 = x16 + 1
x10 = x24
()
}
val x28 = x11
x4 = x28
val x30 = x9 + 1
x3 = x30
()
}
val x34 = x4
x34
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(3, 3, 3, 9, 3, 9, 3, 9, 15)
/*****************************************
Emitting Generated Code
*******************************************/
class flatMapfiltermapRange2 extends ((Int, Int)=>(Int)) {
def apply(x0:Int, x1:Int): Int = {
var x2: Int = x0
var x3: Int = 0
val x31 = while ({val x4 = x2
val x5 = x4 <= x1
x5}) {
val x7 = x3
val x8 = x2
var x9: Int = 1
var x10: Int = x7
val x25 = while ({val x11 = x9
val x12 = x11 <= x8
x12}) {
val x14 = x10
val x15 = x9
val x16 = x15 % 2
val x17 = x16 == 1
val x20 = if (x17) {
val x18 = x15 * 3
val x19 = x14 + x18
x19
} else {
x14
}
x10 = x20
val x22 = x15 + 1
x9 = x22
()
}
val x26 = x10
x3 = x26
val x28 = x8 + 1
x2 = x28
()
}
val x32 = x3
x32
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
57
/*****************************************
Emitting Generated Code
*******************************************/
class mapconcatmapRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x3: Int = x0
val x2 = List()
var x4: scala.collection.immutable.List[Int] = x2
val x18 = while ({val x5 = x3
val x6 = x5 <= x1
x6}) {
val x8 = x4
val x9 = x3
val x10 = x9 * 2
val x11 = x10 * 3
val x12 = List(x11)
val x13 = x8 ::: x12
x4 = x13
val x15 = x9 + 1
x3 = x15
()
}
val x19 = x4
var x20: Int = x0
var x21: scala.collection.immutable.List[Int] = x19
val x34 = while ({val x22 = x20
val x23 = x22 <= x1
x23}) {
val x25 = x21
val x26 = x20
val x27 = x26 * 3
val x28 = List(x27)
val x29 = x25 ::: x28
x21 = x29
val x31 = x26 + 1
x20 = x31
()
}
val x35 = x21
x35
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(6, 12, 18, 24, 30, 3, 6, 9, 12, 15)
/*****************************************
Emitting Generated Code
*******************************************/
class mapappendmapRange extends ((Int, Int)=>(scala.collection.immutable.List[Int])) {
def apply(x0:Int, x1:Int): scala.collection.immutable.List[Int] = {
var x4: Int = x0
val x3 = List()
var x5: scala.collection.immutable.List[Int] = x3
val x19 = while ({val x6 = x4
val x7 = x6 <= x1
x7}) {
val x9 = x5
val x10 = x4
val x11 = x10 * 2
val x12 = x11 * 3
val x13 = List(x12)
val x14 = x9 ::: x13
x5 = x14
val x16 = x10 + 1
x4 = x16
()
}
val x20 = x5
val x2 = x1 + 1
val x21 = x2 * 3
val x22 = List(x21)
val x23 = x20 ::: x22
x23
}
}
/*****************************************
End of Generated Code
*******************************************/
compilation: ok
List(6, 12, 18, 24, 30, 18)