-
Notifications
You must be signed in to change notification settings - Fork 5
/
result_AscendRec.txt
331 lines (330 loc) · 9 KB
/
result_AscendRec.txt
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
Task name: reverse
sorted examples (4):
([]) -> []
([1]) -> [1]
([2, 3]) -> [3, 2]
([2, 3, 4]) -> [4, 3, 2]
Program Found:
reverse(@xs: List['0]): List['0] =
if isNil(@xs)
then @xs
else concat(reverse(tail(@xs)), cons(head(@xs), nil()))
cost = 12
*** [single synthesis] time used: 511.16ms ***
Task name: length
sorted examples (3):
([]) -> 0
([1]) -> 1
([2, 3, 4]) -> 3
Program Found:
length(@xs: List['0]): Int =
if isNil(@xs)
then zero()
else inc(length(tail(@xs)))
cost = 8
*** [single synthesis] time used: 19.31ms ***
Task name: compress
sorted examples (14):
([]) -> []
([2]) -> [2]
([7]) -> [7]
([9]) -> [9]
([3, 9]) -> [3, 9]
([9, 2]) -> [9, 2]
([9, 9]) -> [9]
([2, 3, 9]) -> [2, 3, 9]
([3, 3, 9]) -> [3, 9]
([3, 9, 9]) -> [3, 9]
([9, 9, 2]) -> [9, 2]
([3, 3, 3, 9]) -> [3, 9]
([3, 3, 9, 9]) -> [3, 9]
([2, 3, 3, 9, 9]) -> [2, 3, 9]
Program Found:
compress(@xs: List['0]): List['0] =
if isNil(@xs)
then @xs
else if isNil(tail(@xs))
then @xs
else if equal(head(@xs), head(tail(@xs)))
then compress(tail(@xs))
else cons(head(@xs), compress(tail(@xs)))
cost = 25
*** [single synthesis] time used: 296.97ms ***
Task name: stutter
sorted examples (3):
([]) -> []
([5]) -> [5, 5]
([5, 6, 3]) -> [5, 5, 6, 6, 3, 3]
Program Found:
stutter(@xs: List['0]): List['0] =
if isNil(@xs)
then nil()
else cons(head(@xs), cons(head(@xs), stutter(tail(@xs))))
cost = 13
*** [single synthesis] time used: 149.82ms ***
Task name: squareList
sorted examples (6):
(0) -> []
(1) -> [1]
(2) -> [1, 4]
(-3) -> []
(3) -> [1, 4, 9]
(4) -> [1, 4, 9, 16]
Program Found:
squareList(@n: Int): List[Int] =
if isNonNeg(dec(@n))
then concat(squareList(dec(@n)), cons(times(@n, @n), nil()))
else nil()
cost = 14
*** [single synthesis] time used: 3,279.45ms ***
Task name: insert
sorted examples (8):
([], 0, 5) -> [5]
([], 3, 5) -> [5]
([3], -1, 1) -> [1, 3]
([1, 2, 3], 0, 8) -> [8, 1, 2, 3]
([1, 2, 3], 1, 8) -> [1, 8, 2, 3]
([1, 2, 3], 2, 8) -> [1, 2, 8, 3]
([1, 2, 3], 3, 8) -> [1, 2, 3, 8]
([1, 2, 3], 4, 8) -> [1, 2, 3, 8]
Program Found:
insert(@xs: List['0], @i: Int, @x: '0): List['0] =
if or(isNil(@xs), isNonNeg(neg(@i)))
then cons(@x, @xs)
else cons(head(@xs), insert(tail(@xs), dec(@i), @x))
cost = 19
*** [single synthesis] time used: 6,600.42ms ***
Task name: contains
sorted examples (7):
([], 1) -> F
([1, 2], 3) -> F
([1, 2, 3], 1) -> T
([1, 2, 3], -1) -> F
([1, 2, 3], 2) -> T
([1, 2, 3], 3) -> T
([1, 2, 3], 4) -> F
Program Found:
contains(@xs: List['0], @x: '0): Bool =
if isNil(@xs)
then F()
else if equal(@x, head(@xs))
then T()
else contains(tail(@xs), @x)
cost = 14
*** [single synthesis] time used: 8.05ms ***
Task name: lastInList
sorted examples (5):
([]) -> Err
([1]) -> 1
([1, 2, 3]) -> 3
([1, 6, 7, 11]) -> 11
([10, 25, 7, 9, 18]) -> 18
Program Found:
lastInList(@xs: List['0]): '0 =
if isNil(@xs)
then head(@xs)
else if isNil(tail(@xs))
then head(@xs)
else lastInList(tail(@xs))
cost = 14
*** [single synthesis] time used: 5.65ms ***
Task name: shiftLeft
sorted examples (5):
([]) -> []
([1]) -> [1]
([1, 2, 3]) -> [3, 2, 1]
([1, 6, 7, 11]) -> [11, 7, 6, 1]
([10, 25, 7, 9, 18]) -> [18, 9, 7, 25, 10]
Program Found:
shiftLeft(@xs: List['0]): List['0] =
if isNil(@xs)
then @xs
else concat(shiftLeft(tail(@xs)), cons(head(@xs), nil()))
cost = 12
*** [single synthesis] time used: 43.06ms ***
Task name: maxInList
sorted examples (7):
([]) -> 0
([3]) -> 3
([0, 2, 1]) -> 2
([1, 6, 2, 5]) -> 6
([1, 6, 7, 5]) -> 7
([10, 25, 7, 9, 18]) -> 25
([100, 25, 7, 9, 18]) -> 100
Program Found:
maxInList(@xs: List[Int]): Int =
if isNil(@xs)
then zero()
else if isNonNeg(plus(head(@xs), neg(head(concat(tail(@xs), @xs)))))
then head(@xs)
else maxInList(tail(@xs))
cost = 20
*** [single synthesis] time used: 13,500.66ms ***
Task name: dropLast
sorted examples (5):
([]) -> []
([1]) -> []
([1, 2]) -> [1]
([1, 2, 3]) -> [1, 2]
([1, 1, 1, 2, 3, 2]) -> [1, 1, 1, 2, 3]
Program Found:
dropLast(@xs: List['0]): List['0] =
if isNil(@xs)
then nil()
else if isNil(tail(@xs))
then nil()
else cons(head(@xs), dropLast(tail(@xs)))
cost = 15
*** [single synthesis] time used: 9.72ms ***
Task name: evens
sorted examples (5):
([]) -> []
([1]) -> [1]
([1, 2]) -> [1]
([1, 2, 3, 4]) -> [1, 3]
([1, 2, 3, 4, 5, 6]) -> [1, 3, 5]
Program Found:
evens(@xs: List['0]): List['0] =
if isNil(@xs)
then nil()
else if isNil(tail(@xs))
then @xs
else cons(head(@xs), evens(tail(tail(@xs))))
cost = 16
*** [single synthesis] time used: 15.70ms ***
Task name: cartesian
sorted examples (4):
([], [2, 3, 4]) -> []
([5], []) -> []
([5], [7, 8, 9]) -> [(5, 7), (5, 8), (5, 9)]
([2, 3], [4, 5]) -> [(2, 4), (2, 5), (3, 4), (3, 5)]
Program Found:
cartesian(@xs: List['0], @ys: List['1]): List[Pair['0,'1]] =
if or(isNil(@ys), isNil(@xs))
then nil()
else if isNil(tail(@xs))
then cons(createPair(head(@xs), head(@ys)), cartesian(@xs, tail(@ys)))
else concat(cartesian(cons(head(@xs), nil()), @ys), cartesian(tail(@xs), @ys))
cost = 32
*** [single synthesis] time used: 3,568.99ms ***
Task name: fib
sorted examples (8):
(0) -> 1
(1) -> 1
(2) -> 2
(-3) -> 1
(3) -> 3
(4) -> 5
(5) -> 8
(6) -> 13
Program Found:
fib(@n: Int): Int =
if isNonNeg(dec(div2(@n)))
then plus(fib(dec(@n)), fib(dec(dec(@n))))
else inc(zero())
cost = 15
*** [single synthesis] time used: 2,080.03ms ***
Task name: sumUnder
sorted examples (5):
(0) -> 0
(1) -> 1
(2) -> 3
(3) -> 6
(4) -> 10
Program Found:
sumUnder(@n: Int): Int =
if isNonNeg(dec(@n))
then plus(@n, sumUnder(dec(@n)))
else @n
cost = 10
*** [single synthesis] time used: 7.10ms ***
Task name: times
sorted examples (6):
(0, 5) -> 0
(0, 8) -> 0
(1, 0) -> 0
(2, 7) -> 14
(3, 8) -> 24
(7, 5) -> 35
Program Found:
times(@x: Int, @y: Int): Int =
if isNonNeg(neg(@x))
then zero()
else plus(@y, times(dec(@x), @y))
cost = 11
*** [single synthesis] time used: 272.94ms ***
Task name: flattenTree
sorted examples (3):
(L) -> []
((1: L, L)) -> [1]
((1: (2: L, L), (3: L, L))) -> [1, 2, 3]
Program Found:
flattenTree(@tree: Tree['0]): List['0] =
if isLeaf(@tree)
then nil()
else cons(treeTag(@tree), concat(flattenTree(treeLeft(@tree)), flattenTree(treeRight(@tree))))
cost = 14
*** [single synthesis] time used: 81.39ms ***
Task name: tConcat
sorted examples (6):
(L, L) -> L
(L, (1: L, L)) -> (1: L, L)
((1: L, L), L) -> (1: L, L)
((1: L, L), (2: (3: L, L), (4: L, L))) -> (1: (2: (3: L, L), (4: L, L)), (2: (3: L, L), (4: L, L)))
((1: (2: L, L), (3: L, L)), (4: (5: L, L), (6: L, L))) -> (1: (2: (4: (5: L, L), (6: L, L)), (4: (5: L, L), (6: L, L))), (3: (4: (5: L, L), (6: L, L)), (4: (5: L, L), (6: L, L))))
((1: L, (2: (3: L, L), (4: L, L))), (5: L, L)) -> (1: (5: L, L), (2: (3: (5: L, L), (5: L, L)), (4: (5: L, L), (5: L, L))))
Program Found:
tConcat(@baseTree: Tree['0], @inserted: Tree['0]): Tree['0] =
if isLeaf(@baseTree)
then @inserted
else createNode(treeTag(@baseTree), tConcat(treeLeft(@baseTree), @inserted), tConcat(treeRight(@baseTree), @inserted))
cost = 15
*** [single synthesis] time used: 54,045.24ms ***
Task name: nodesAtLevel
sorted examples (12):
(L, 1) -> []
(L, -1) -> []
((1: L, L), 0) -> [1]
((1: L, L), -1) -> []
((1: L, L), 1) -> []
((1: L, L), 2) -> []
((1: (7: L, L), (9: L, L)), 1) -> [7, 9]
((1: (15: (4: L, L), L), (9: L, L)), 3) -> []
((1: (2: L, L), (3: (4: L, L), (5: (6: L, L), (7: L, L)))), 0) -> [1]
((1: (2: L, L), (3: (4: L, L), (5: (6: L, L), (7: L, L)))), 1) -> [2, 3]
((1: (2: L, L), (3: (4: L, L), (5: (6: L, L), (7: L, L)))), 2) -> [4, 5]
((1: (2: L, L), (3: (4: L, L), (5: (6: L, L), (7: L, L)))), 3) -> [6, 7]
Program Found:
nodesAtLevel(@tree: Tree['0], @level: Int): List['0] =
if isLeaf(@tree)
then nil()
else if equal(@level, zero())
then cons(treeTag(@tree), nil())
else if isNonNeg(@level)
then concat(nodesAtLevel(treeLeft(@tree), dec(@level)), nodesAtLevel(treeRight(@tree), dec(@level)))
else nil()
cost = 27
*** [single synthesis] time used: 238,356.68ms ***
Summery:
name cost depth examples time
reverse 12 8 4 508.14ms
length 8 4 3 19.00ms
compress 25 9 14 295.43ms
stutter 13 9 3 149.33ms
squareList 14 9 6 3,279.02ms
insert 19 9 8 6,599.94ms
contains 14 5 7 7.76ms
lastInList 14 5 5 5.37ms
shiftLeft 12 8 5 42.72ms
maxInList 20 10 7 13,500.14ms
dropLast 15 6 5 9.49ms
evens 16 7 5 15.44ms
cartesian 32 11 4 3,568.67ms
fib 15 8 8 2,079.78ms
sumUnder 10 5 5 6.97ms
times 11 6 6 272.79ms
flattenTree 14 10 3 81.15ms
tConcat 15 11 6 54,045.01ms
nodesAtLevel 27 11 12 238,356.30ms
Total 306 151 116 322.842s
Process finished with exit code 0