-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathInterpreterTestCases.ts
334 lines (268 loc) · 8.68 KB
/
InterpreterTestCases.ts
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
/********************************************************************************
** InterpreterTestCases
This file contains several test cases, some of which have not been authored yet.
You should add your own interpretation where it says so.
You are also free to add new test cases.
********************************************************************************/
export interface TestCase {
world : string;
utterance : string;
interpretations : string[]
}
export var testCases : TestCase[] = [];
//////////////////////////////////////////////////////////////////////
// Examples that test the physical laws
// "Balls must be in boxes or on the floor, otherwise they roll away"
testCases.push({
world: "small",
utterance: "put a ball on a table",
interpretations: []
});
// "Objects are “inside” boxes, but “ontop” of other objects"
testCases.push({
world: "small",
utterance: "put a ball on a box",
interpretations: []
});
testCases.push({
world: "small",
utterance: "put a box in a brick",
interpretations: []
});
// "Boxes cannot contain pyramids, planks or boxes of the same size"
testCases.push({
world: "medium",
utterance: "put a plank in a box",
interpretations: ["inside(SmlGrnPlnk,LrgRedBox) | inside(SmlGrnPlnk,LrgYlwBox)"]
});
testCases.push({
world: "medium",
utterance: "put a large plank in a box",
interpretations: []
});
testCases.push({
world: "medium",
utterance: "put a pyramid in a box",
interpretations: ["inside(SmlRedPrmd,LrgRedBox) | inside(SmlRedPrmd,LrgYlwBox)"]
});
testCases.push({
world: "medium",
utterance: "put a pyramid in a small box",
interpretations: []
});
testCases.push({
world: "medium",
utterance: "put a box in a box",
interpretations: ["inside(SmlBluBox,LrgRedBox)|inside(SmlBluBox,LrgYlwBox)"]
});
testCases.push({
world: "medium",
utterance: "put a large box in a box",
interpretations: []
});
testCases.push({
world: "medium",
utterance: "put a plank in a small box",
interpretations: []
});
testCases.push({
world: "small",
utterance: "put a big ball in a small box",
interpretations: []
});
// "Small boxes cannot be supported by small bricks or pyramids."
testCases.push({
world: "medium",
utterance: "put a large box on a large brick",
interpretations: ["ontop(LrgRedBox,LrgGrnBrck1) | ontop(LrgYlwBox,LrgGrnBrck1) | " +
"ontop(LrgRedBox,LrgGrnBrck2) | ontop(LrgYlwBox,LrgGrnBrck2) |" +
"ontop(LrgRedBox,LrgGrnBrck3) | ontop(LrgYlwBox,LrgGrnBrck3)"]
});
testCases.push({
world: "medium",
utterance: "put a small box on a small brick",
interpretations: []
});
testCases.push({
world: "medium",
utterance: "put a small box on a small pyramid",
interpretations: []
});
// "Large boxes cannot be supported by large pyramids."
testCases.push({
world: "medium",
utterance: "put a large box on a large pyramid",
interpretations: []
});
// Common errors with the floor
testCases.push({
world: "small",
utterance: "take the floor",
interpretations: []
});
testCases.push({
world: "small",
utterance: "put a brick on a floor",
interpretations: []
});
testCases.push({
world: "small",
utterance: "put a brick on the red floor",
interpretations: []
});
testCases.push({
world: "small",
utterance: "take a ball on a box",
interpretations: []
});
testCases.push({
world: "small",
utterance: "take a ball in the floor",
interpretations: []
});
testCases.push({
world: "small",
utterance: "take a box in a table",
interpretations: []
});
//////////////////////////////////////////////////////////////////////
// Simple examples with a clear interpretation
testCases.push({
world: "small",
utterance: "take an object",
interpretations: ["holding(LargeBlueTable)|holding(LargeWhiteBall)|holding(LargeRedBox)|" +
"holding(LargeYellowBox)|holding(SmallBlackBall)|holding(SmallBlueBox)"]
});
testCases.push({
world: "small",
utterance: "take a blue object",
interpretations: ["holding(LargeBlueTable) | holding(SmallBlueBox)"]
});
testCases.push({
world: "small",
utterance: "take a box",
interpretations: ["holding(LargeRedBox) | holding(LargeYellowBox) | holding(SmallBlueBox)"]
});
testCases.push({
world: "small",
utterance: "put a ball in a box",
interpretations: ["inside(LargeWhiteBall, LargeRedBox) | inside(LargeWhiteBall, LargeYellowBox) |" +
"inside(SmallBlackBall, LargeRedBox) | inside(SmallBlackBall, LargeYellowBox) |" +
"inside(SmallBlackBall, SmallBlueBox)"]
});
testCases.push({
world: "small",
utterance: "put a ball above a table",
interpretations: ["above(LargeWhiteBall,LargeBlueTable)|above(SmallBlackBall,LargeBlueTable)"]
});
testCases.push({
world: "small",
utterance: "put a ball left of a ball",
interpretations: ["leftof(LargeWhiteBall,SmallBlackBall) | leftof(SmallBlackBall,LargeWhiteBall)"]
});
testCases.push({
world: "small",
utterance: "take a white object beside a blue object",
interpretations: ["holding(LargeWhiteBall)"]
});
testCases.push({
world: "small",
utterance: "put a white object beside a blue object",
interpretations: ["beside(LargeWhiteBall,LargeBlueTable) | beside(LargeWhiteBall,SmallBlueBox)"]
});
testCases.push({
world: "small",
utterance: "put a white ball in a box on the floor",
interpretations: ["inside(LargeWhiteBall,LargeYellowBox)"]
});
testCases.push({
world: "small",
utterance: "put a black ball in a box on the floor",
interpretations: ["inside(SmallBlackBall,LargeYellowBox)",
//// Perhaps you want the following interpretation too?
// "inside(SmallBlackBall,SmallBlueBox) & ontop(SmallBlueBox,floor)",
// "inside(SmallBlackBall,LargeRedBox) & ontop(LargeRedBox,floor)",
"ontop(SmallBlackBall,floor)"]
});
//////////////////////////////////////////////////////////////////////
// Examples where YOU shuold define the interpretation
testCases.push({
world: "small",
utterance: "put a ball in a box on the floor",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
// "put it"
testCases.push({
world: "medium",
utterance: "put it on the floor",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
// Deep recursion
testCases.push({
world: "small",
utterance: "take a ball in a box in a box",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "small",
utterance: "take a ball in a box in a box on the floor",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "small",
utterance: "put a box on a table on the floor",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "small",
utterance: "put a box in a box on a table",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "small",
utterance: "put a box in a box on a table on the floor",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "medium",
utterance: "put a brick on a brick on a brick on the floor",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
//////////////////////////////////////////////////////////////////////
// Test cases for the ALL quantifier
// These are not necessary to solve if you only aim for grade 3/G
testCases.push({
world: "small",
utterance: "put all balls on the floor",
interpretations: ["ontop(LargeWhiteBall,floor) & ontop(SmallBlackBall,floor)"]
});
testCases.push({
world: "small",
utterance: "put every ball to the right of all blue things",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "small",
utterance: "put all balls left of a box on the floor",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "small",
utterance: "put a ball in every large box",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "small",
utterance: "put every ball in a box",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "medium",
utterance: "put all large green bricks beside a large green brick",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});
testCases.push({
world: "medium",
utterance: "put all green objects left of all red objects",
interpretations: ["COME-UP-WITH-YOUR-OWN-INTERPRETATION"]
});