aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java
diff options
context:
space:
mode:
authorLibravatar nagilooh <ficsorattila96@gmail.com>2023-08-25 17:04:43 +0200
committerLibravatar nagilooh <ficsorattila96@gmail.com>2023-08-25 17:04:43 +0200
commit0b3f95bbc05d74b37d7c769bf76f38c25e4b1b73 (patch)
tree3516135ac5d9fa5cfffabe438e576e6b4e347828 /subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java
parentAdd delete action and additional tests for equals (diff)
downloadrefinery-0b3f95bbc05d74b37d7c769bf76f38c25e4b1b73.tar.gz
refinery-0b3f95bbc05d74b37d7c769bf76f38c25e4b1b73.tar.zst
refinery-0b3f95bbc05d74b37d7c769bf76f38c25e4b1b73.zip
Move equivalence checking to new method
Also: - Rename Symbol to Variable - Make fire for InsertAction with low arity faster
Diffstat (limited to 'subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java')
-rw-r--r--subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java253
1 files changed, 126 insertions, 127 deletions
diff --git a/subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java b/subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java
index e29260e9..1489b413 100644
--- a/subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java
+++ b/subprojects/store-dse/src/test/java/tools/refinery/store/dse/ActionEqualsTest.java
@@ -14,8 +14,7 @@ import tools.refinery.store.query.view.KeyOnlyView;
14import tools.refinery.store.representation.Symbol; 14import tools.refinery.store.representation.Symbol;
15import tools.refinery.store.representation.TruthValue; 15import tools.refinery.store.representation.TruthValue;
16 16
17import static org.junit.jupiter.api.Assertions.assertEquals; 17import static org.junit.jupiter.api.Assertions.*;
18import static org.junit.jupiter.api.Assertions.assertNotEquals;
19 18
20public class ActionEqualsTest { 19public class ActionEqualsTest {
21 20
@@ -55,7 +54,6 @@ public class ActionEqualsTest {
55 .build(); 54 .build();
56 55
57 56
58
59 model = store.createEmptyModel(); 57 model = store.createEmptyModel();
60 dseAdapter = model.getAdapter(DesignSpaceExplorationAdapter.class); 58 dseAdapter = model.getAdapter(DesignSpaceExplorationAdapter.class);
61 } 59 }
@@ -64,40 +62,46 @@ public class ActionEqualsTest {
64 void emptyActionEqualsTest() { 62 void emptyActionEqualsTest() {
65 var action1 = new TransformationAction(); 63 var action1 = new TransformationAction();
66 var action2 = new TransformationAction(); 64 var action2 = new TransformationAction();
67 assertEquals(action1, action1); 65
68 assertEquals(action2, action2); 66 assertTrue(action1.equalsWithSubstitution(action1));
69 assertEquals(action1, action2); 67 assertTrue(action2.equalsWithSubstitution(action2));
68 assertTrue(action1.equalsWithSubstitution(action2));
70 } 69 }
71 70
72 @Test 71 @Test
73 void actionTrivialTest() { 72 void actionTrivialTest() {
74 var newItemSymbol1 = new NewItemSymbol(); 73 var newItemSymbol1 = new NewItemVariable();
75 var activationSymbol = new ActivationSymbol(); 74 var activationSymbol = new ActivationVariable();
76 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 75 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1);
76 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
77 activationSymbol); 77 activationSymbol);
78 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 78 var insertAction3 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1);
79 var insertAction4 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
79 activationSymbol); 80 activationSymbol);
80 81
81 var action1 = new TransformationAction(); 82 var action1 = new TransformationAction();
82 action1.add(newItemSymbol1); 83 action1.add(newItemSymbol1);
83 action1.add(activationSymbol); 84 action1.add(activationSymbol);
84 action1.add(insertAction1); 85 action1.add(insertAction1);
86 action1.add(insertAction2);
85 action1.prepare(model); 87 action1.prepare(model);
86 88
87 var action2 = new TransformationAction(); 89 var action2 = new TransformationAction();
88 action2.add(newItemSymbol1); 90 action2.add(newItemSymbol1);
89 action2.add(activationSymbol); 91 action2.add(activationSymbol);
90 action2.add(insertAction2); 92 action2.add(insertAction3);
93 action2.add(insertAction4);
91 action2.prepare(model); 94 action2.prepare(model);
92 95
93 assertEquals(action1, action2); 96 assertTrue(action1.equalsWithSubstitution(action2));
94 } 97 }
95 98
96 @Test 99 @Test
97 void actionIdenticalTest() { 100 void actionIdenticalTest() {
98 var newItemSymbol1 = new NewItemSymbol(); 101 var newItemSymbol1 = new NewItemVariable();
99 var activationSymbol1 = new ActivationSymbol(); 102 var activationSymbol1 = new ActivationVariable();
100 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, activationSymbol1); 103 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
104 activationSymbol1);
101 105
102 var action1 = new TransformationAction(); 106 var action1 = new TransformationAction();
103 action1.add(newItemSymbol1); 107 action1.add(newItemSymbol1);
@@ -105,10 +109,9 @@ public class ActionEqualsTest {
105 action1.add(insertAction1); 109 action1.add(insertAction1);
106 action1.prepare(model); 110 action1.prepare(model);
107 111
108 112 var newItemSymbol2 = new NewItemVariable();
109 var newItemSymbol2 = new NewItemSymbol(); 113 var activationSymbol2 = new ActivationVariable();
110 var activationSymbol2 = new ActivationSymbol(); 114 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
111 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2,
112 activationSymbol2); 115 activationSymbol2);
113 116
114 var action2 = new TransformationAction(); 117 var action2 = new TransformationAction();
@@ -117,14 +120,14 @@ public class ActionEqualsTest {
117 action2.add(insertAction2); 120 action2.add(insertAction2);
118 action2.prepare(model); 121 action2.prepare(model);
119 122
120 assertEquals(action1, action2); 123 assertTrue(action1.equalsWithSubstitution(action2));
121 } 124 }
122 125
123 @Test 126 @Test
124 void actionSymbolGlobalOrderTest() { 127 void actionSymbolGlobalOrderTest() {
125 var newItemSymbol1 = new NewItemSymbol(); 128 var newItemSymbol1 = new NewItemVariable();
126 var activationSymbol1 = new ActivationSymbol(); 129 var activationSymbol1 = new ActivationVariable();
127 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 130 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
128 activationSymbol1); 131 activationSymbol1);
129 132
130 var action1 = new TransformationAction(); 133 var action1 = new TransformationAction();
@@ -133,10 +136,9 @@ public class ActionEqualsTest {
133 action1.add(insertAction1); 136 action1.add(insertAction1);
134 action1.prepare(model); 137 action1.prepare(model);
135 138
136 139 var newItemSymbol2 = new NewItemVariable();
137 var newItemSymbol2 = new NewItemSymbol(); 140 var activationSymbol2 = new ActivationVariable();
138 var activationSymbol2 = new ActivationSymbol(); 141 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
139 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2,
140 activationSymbol2); 142 activationSymbol2);
141 143
142 var action2 = new TransformationAction(); 144 var action2 = new TransformationAction();
@@ -145,43 +147,39 @@ public class ActionEqualsTest {
145 action2.add(insertAction2); 147 action2.add(insertAction2);
146 action2.prepare(model); 148 action2.prepare(model);
147 149
148 assertNotEquals(action1, action2); 150 assertFalse(action1.equalsWithSubstitution(action2));
149 } 151 }
150 152
151 @Test 153 @Test
152 void actionSymbolInInsertActionOrderTest() { 154 void actionSymbolRepeatedInInsertActionTest() {
153 var newItemSymbol1 = new NewItemSymbol(); 155 var newItemSymbol1 = new NewItemVariable();
154 var activationSymbol1 = new ActivationSymbol(); 156 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
155 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, activationSymbol1); 157 newItemSymbol1);
156 158
157 var action1 = new TransformationAction(); 159 var action1 = new TransformationAction();
158 action1.add(newItemSymbol1); 160 action1.add(newItemSymbol1);
159 action1.add(activationSymbol1);
160 action1.add(insertAction1); 161 action1.add(insertAction1);
161 action1.prepare(model); 162 action1.prepare(model);
162 163
163 164 var newItemSymbol2 = new NewItemVariable();
164 var newItemSymbol2 = new NewItemSymbol(); 165 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
165 var activationSymbol2 = new ActivationSymbol();
166 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, activationSymbol2,
167 newItemSymbol2); 166 newItemSymbol2);
168 167
169 var action2 = new TransformationAction(); 168 var action2 = new TransformationAction();
170 action2.add(newItemSymbol2); 169 action2.add(newItemSymbol2);
171 action2.add(activationSymbol2);
172 action2.add(insertAction2); 170 action2.add(insertAction2);
173 action2.prepare(model); 171 action2.prepare(model);
174 172
175 assertNotEquals(action1, action2); 173 assertTrue(action1.equalsWithSubstitution(action2));
176 } 174 }
177 175
178 @Test 176 @Test
179 void identicalInsertActionInDifferentOrderTest() { 177 void identicalInsertActionInDifferentOrderTest() {
180 var newItemSymbol1 = new NewItemSymbol(); 178 var newItemSymbol1 = new NewItemVariable();
181 var activationSymbol1 = new ActivationSymbol(); 179 var activationSymbol1 = new ActivationVariable();
182 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 180 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
183 activationSymbol1); 181 activationSymbol1);
184 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 182 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
185 activationSymbol1); 183 activationSymbol1);
186 184
187 var action1 = new TransformationAction(); 185 var action1 = new TransformationAction();
@@ -198,19 +196,20 @@ public class ActionEqualsTest {
198 action2.add(insertAction1); 196 action2.add(insertAction1);
199 action2.prepare(model); 197 action2.prepare(model);
200 198
201 assertEquals(action1, action2); 199 assertTrue(action1.equalsWithSubstitution(action2));
202 } 200 }
203 201
204 @Test 202 @Test
205 void identicalActionAndSymbolDifferentOrderTest() { 203 void identicalActionAndSymbolDifferentOrderTest() {
206 var newItemSymbol1 = new NewItemSymbol(); 204 var newItemSymbol1 = new NewItemVariable();
207 var activationSymbol1 = new ActivationSymbol(); 205 var newItemSymbol2 = new NewItemVariable();
208 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 206 var activationSymbol1 = new ActivationVariable();
207 var activationSymbol2 = new ActivationVariable();
208
209 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
209 activationSymbol1); 210 activationSymbol1);
210 211
211 var newItemSymbol2 = new NewItemSymbol(); 212 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
212 var activationSymbol2 = new ActivationSymbol();
213 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2,
214 activationSymbol2); 213 activationSymbol2);
215 214
216 var action1 = new TransformationAction(); 215 var action1 = new TransformationAction();
@@ -231,19 +230,19 @@ public class ActionEqualsTest {
231 action2.add(insertAction1); 230 action2.add(insertAction1);
232 action2.prepare(model); 231 action2.prepare(model);
233 232
234 assertEquals(action1, action2); 233 assertTrue(action1.equalsWithSubstitution(action2));
235 } 234 }
236 235
237 @Test 236 @Test
238 void identicalActionAndSymbolMixedOrderTest() { 237 void identicalActionAndSymbolMixedOrderTest() {
239 var newItemSymbol1 = new NewItemSymbol(); 238 var newItemSymbol1 = new NewItemVariable();
240 var activationSymbol1 = new ActivationSymbol(); 239 var activationSymbol1 = new ActivationVariable();
241 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 240 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
242 activationSymbol1); 241 activationSymbol1);
243 242
244 var newItemSymbol2 = new NewItemSymbol(); 243 var newItemSymbol2 = new NewItemVariable();
245 var activationSymbol2 = new ActivationSymbol(); 244 var activationSymbol2 = new ActivationVariable();
246 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2, 245 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
247 activationSymbol2); 246 activationSymbol2);
248 247
249 var action1 = new TransformationAction(); 248 var action1 = new TransformationAction();
@@ -264,16 +263,16 @@ public class ActionEqualsTest {
264 action2.add(activationSymbol2); 263 action2.add(activationSymbol2);
265 action2.prepare(model); 264 action2.prepare(model);
266 265
267 assertEquals(action1, action2); 266 assertTrue(action1.equalsWithSubstitution(action2));
268 } 267 }
269 268
270 @Test 269 @Test
271 void insertActionInterpretationTest() { 270 void insertActionInterpretationTest() {
272 var newItemSymbol1 = new NewItemSymbol(); 271 var newItemSymbol1 = new NewItemVariable();
273 var activationSymbol1 = new ActivationSymbol(); 272 var activationSymbol1 = new ActivationVariable();
274 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 273 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
275 activationSymbol1); 274 activationSymbol1);
276 var insertAction2 = new InsertAction<>(model.getInterpretation(type2), true, newItemSymbol1, 275 var insertAction2 = new InsertAction<>(model.getInterpretation(relation2), true, newItemSymbol1,
277 activationSymbol1); 276 activationSymbol1);
278 277
279 var action1 = new TransformationAction(); 278 var action1 = new TransformationAction();
@@ -288,16 +287,16 @@ public class ActionEqualsTest {
288 action2.add(insertAction2); 287 action2.add(insertAction2);
289 action2.prepare(model); 288 action2.prepare(model);
290 289
291 assertNotEquals(action1, action2); 290 assertFalse(action1.equalsWithSubstitution(action2));
292 } 291 }
293 292
294 @Test 293 @Test
295 void insertActionValueTest() { 294 void insertActionValueTest() {
296 var newItemSymbol1 = new NewItemSymbol(); 295 var newItemSymbol1 = new NewItemVariable();
297 var activationSymbol1 = new ActivationSymbol(); 296 var activationSymbol1 = new ActivationVariable();
298 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 297 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
299 activationSymbol1); 298 activationSymbol1);
300 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), false, newItemSymbol1, 299 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), false, newItemSymbol1,
301 activationSymbol1); 300 activationSymbol1);
302 301
303 var action1 = new TransformationAction(); 302 var action1 = new TransformationAction();
@@ -312,17 +311,17 @@ public class ActionEqualsTest {
312 action2.add(insertAction2); 311 action2.add(insertAction2);
313 action2.prepare(model); 312 action2.prepare(model);
314 313
315 assertNotEquals(action1, action2); 314 assertFalse(action1.equalsWithSubstitution(action2));
316 } 315 }
317 316
318 @Test 317 @Test
319 void newItemSymbolDuplicateTest() { 318 void newItemSymbolDuplicateTest() {
320 var newItemSymbol1 = new NewItemSymbol(); 319 var newItemSymbol1 = new NewItemVariable();
321 var newItemSymbol2 = new NewItemSymbol(); 320 var newItemSymbol2 = new NewItemVariable();
322 var activationSymbol1 = new ActivationSymbol(); 321 var activationSymbol1 = new ActivationVariable();
323 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 322 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
324 activationSymbol1); 323 activationSymbol1);
325 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2, 324 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
326 activationSymbol1); 325 activationSymbol1);
327 326
328 var action1 = new TransformationAction(); 327 var action1 = new TransformationAction();
@@ -337,17 +336,17 @@ public class ActionEqualsTest {
337 action2.add(insertAction2); 336 action2.add(insertAction2);
338 action2.prepare(model); 337 action2.prepare(model);
339 338
340 assertEquals(action1, action2); 339 assertTrue(action1.equalsWithSubstitution(action2));
341 } 340 }
342 341
343 @Test 342 @Test
344 void activationSymbolDuplicateTest() { 343 void activationSymbolDuplicateTest() {
345 var newItemSymbol1 = new NewItemSymbol(); 344 var newItemSymbol1 = new NewItemVariable();
346 var activationSymbol1 = new ActivationSymbol(); 345 var activationSymbol1 = new ActivationVariable();
347 var activationSymbol2 = new ActivationSymbol(); 346 var activationSymbol2 = new ActivationVariable();
348 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 347 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
349 activationSymbol1); 348 activationSymbol1);
350 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 349 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
351 activationSymbol2); 350 activationSymbol2);
352 351
353 var action1 = new TransformationAction(); 352 var action1 = new TransformationAction();
@@ -362,17 +361,17 @@ public class ActionEqualsTest {
362 action2.add(insertAction2); 361 action2.add(insertAction2);
363 action2.prepare(model); 362 action2.prepare(model);
364 363
365 assertEquals(action1, action2); 364 assertTrue(action1.equalsWithSubstitution(action2));
366 } 365 }
367 366
368 @Test 367 @Test
369 void activationSymbolIndexTest() { 368 void activationSymbolIndexTest() {
370 var newItemSymbol1 = new NewItemSymbol(); 369 var newItemSymbol1 = new NewItemVariable();
371 var activationSymbol1 = new ActivationSymbol(0); 370 var activationSymbol1 = new ActivationVariable(0);
372 var activationSymbol2 = new ActivationSymbol(1); 371 var activationSymbol2 = new ActivationVariable(1);
373 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 372 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
374 activationSymbol1); 373 activationSymbol1);
375 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 374 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
376 activationSymbol2); 375 activationSymbol2);
377 376
378 var action1 = new TransformationAction(); 377 var action1 = new TransformationAction();
@@ -387,14 +386,14 @@ public class ActionEqualsTest {
387 action2.add(insertAction2); 386 action2.add(insertAction2);
388 action2.prepare(model); 387 action2.prepare(model);
389 388
390 assertNotEquals(action1, action2); 389 assertFalse(action1.equalsWithSubstitution(action2));
391 } 390 }
392 391
393 @Test 392 @Test
394 void deleteActionTest() { 393 void deleteActionTest() {
395 var newItemSymbol = new NewItemSymbol(); 394 var newItemSymbol = new NewItemVariable();
396 var activationSymbol = new ActivationSymbol(0); 395 var activationSymbol = new ActivationVariable(0);
397 var insertAction = new InsertAction<>(model.getInterpretation(type1), false, newItemSymbol, 396 var insertAction = new InsertAction<>(model.getInterpretation(relation1), false, newItemSymbol,
398 activationSymbol); 397 activationSymbol);
399 var deleteAction = new DeleteAction(activationSymbol); 398 var deleteAction = new DeleteAction(activationSymbol);
400 399
@@ -412,14 +411,14 @@ public class ActionEqualsTest {
412 action2.add(deleteAction); 411 action2.add(deleteAction);
413 action2.prepare(model); 412 action2.prepare(model);
414 413
415 assertEquals(action1, action2); 414 assertTrue(action1.equalsWithSubstitution(action2));
416 } 415 }
417 416
418 @Test 417 @Test
419 void deleteActionMissingTest() { 418 void deleteActionMissingTest() {
420 var newItemSymbol = new NewItemSymbol(); 419 var newItemSymbol = new NewItemVariable();
421 var activationSymbol = new ActivationSymbol(0); 420 var activationSymbol = new ActivationVariable(0);
422 var insertAction = new InsertAction<>(model.getInterpretation(type1), false, newItemSymbol, 421 var insertAction = new InsertAction<>(model.getInterpretation(relation1), false, newItemSymbol,
423 activationSymbol); 422 activationSymbol);
424 var deleteAction = new DeleteAction(activationSymbol); 423 var deleteAction = new DeleteAction(activationSymbol);
425 424
@@ -436,14 +435,14 @@ public class ActionEqualsTest {
436 action2.add(insertAction); 435 action2.add(insertAction);
437 action2.prepare(model); 436 action2.prepare(model);
438 437
439 assertNotEquals(action1, action2); 438 assertFalse(action1.equalsWithSubstitution(action2));
440 } 439 }
441 440
442 @Test 441 @Test
443 void deleteActionIdenticalTest() { 442 void deleteActionIdenticalTest() {
444 var newItemSymbol = new NewItemSymbol(); 443 var newItemSymbol = new NewItemVariable();
445 var activationSymbol = new ActivationSymbol(0); 444 var activationSymbol = new ActivationVariable(0);
446 var insertAction = new InsertAction<>(model.getInterpretation(type1), false, newItemSymbol, 445 var insertAction = new InsertAction<>(model.getInterpretation(relation1), false, newItemSymbol,
447 activationSymbol); 446 activationSymbol);
448 var deleteAction1 = new DeleteAction(activationSymbol); 447 var deleteAction1 = new DeleteAction(activationSymbol);
449 var deleteAction2 = new DeleteAction(activationSymbol); 448 var deleteAction2 = new DeleteAction(activationSymbol);
@@ -462,14 +461,14 @@ public class ActionEqualsTest {
462 action2.add(deleteAction2); 461 action2.add(deleteAction2);
463 action2.prepare(model); 462 action2.prepare(model);
464 463
465 assertEquals(action1, action2); 464 assertTrue(action1.equalsWithSubstitution(action2));
466 } 465 }
467 466
468 @Test 467 @Test
469 void deleteActionSymbolTypeTest() { 468 void deleteActionSymbolTypeTest() {
470 var newItemSymbol = new NewItemSymbol(); 469 var newItemSymbol = new NewItemVariable();
471 var activationSymbol = new ActivationSymbol(0); 470 var activationSymbol = new ActivationVariable(0);
472 var insertAction = new InsertAction<>(model.getInterpretation(type1), false, newItemSymbol, 471 var insertAction = new InsertAction<>(model.getInterpretation(relation1), false, newItemSymbol,
473 activationSymbol); 472 activationSymbol);
474 var deleteAction1 = new DeleteAction(activationSymbol); 473 var deleteAction1 = new DeleteAction(activationSymbol);
475 var deleteAction2 = new DeleteAction(newItemSymbol); 474 var deleteAction2 = new DeleteAction(newItemSymbol);
@@ -488,14 +487,14 @@ public class ActionEqualsTest {
488 action2.add(deleteAction2); 487 action2.add(deleteAction2);
489 action2.prepare(model); 488 action2.prepare(model);
490 489
491 assertNotEquals(action1, action2); 490 assertFalse(action1.equalsWithSubstitution(action2));
492 } 491 }
493 492
494 @Test 493 @Test
495 void deleteActionOrderTest() { 494 void deleteActionOrderTest() {
496 var newItemSymbol = new NewItemSymbol(); 495 var newItemSymbol = new NewItemVariable();
497 var activationSymbol = new ActivationSymbol(0); 496 var activationSymbol = new ActivationVariable(0);
498 var insertAction = new InsertAction<>(model.getInterpretation(type1), false, newItemSymbol, 497 var insertAction = new InsertAction<>(model.getInterpretation(relation1), false, newItemSymbol,
499 activationSymbol); 498 activationSymbol);
500 var deleteAction1 = new DeleteAction(activationSymbol); 499 var deleteAction1 = new DeleteAction(activationSymbol);
501 var deleteAction2 = new DeleteAction(newItemSymbol); 500 var deleteAction2 = new DeleteAction(newItemSymbol);
@@ -516,20 +515,20 @@ public class ActionEqualsTest {
516 action2.add(deleteAction1); 515 action2.add(deleteAction1);
517 action2.prepare(model); 516 action2.prepare(model);
518 517
519 assertNotEquals(action1, action2); 518 assertFalse(action1.equalsWithSubstitution(action2));
520 } 519 }
521 520
522 @Test 521 @Test
523 void actionsMixedOrderTest() { 522 void actionsMixedOrderTest() {
524 var newItemSymbol1 = new NewItemSymbol(); 523 var newItemSymbol1 = new NewItemVariable();
525 var activationSymbol1 = new ActivationSymbol(); 524 var activationSymbol1 = new ActivationVariable();
526 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 525 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
527 activationSymbol1); 526 activationSymbol1);
528 var deleteAction1 = new DeleteAction(newItemSymbol1); 527 var deleteAction1 = new DeleteAction(newItemSymbol1);
529 528
530 var newItemSymbol2 = new NewItemSymbol(); 529 var newItemSymbol2 = new NewItemVariable();
531 var activationSymbol2 = new ActivationSymbol(); 530 var activationSymbol2 = new ActivationVariable();
532 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2, 531 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
533 activationSymbol2); 532 activationSymbol2);
534 var deleteAction2 = new DeleteAction(activationSymbol2); 533 var deleteAction2 = new DeleteAction(activationSymbol2);
535 534
@@ -555,20 +554,20 @@ public class ActionEqualsTest {
555 action2.add(activationSymbol2); 554 action2.add(activationSymbol2);
556 action2.prepare(model); 555 action2.prepare(model);
557 556
558 assertEquals(action1, action2); 557 assertTrue(action1.equalsWithSubstitution(action2));
559 } 558 }
560 559
561 @Test 560 @Test
562 void twoUnpreparedActionsTest() { 561 void twoUnpreparedActionsTest() {
563 var newItemSymbol1 = new NewItemSymbol(); 562 var newItemSymbol1 = new NewItemVariable();
564 var activationSymbol1 = new ActivationSymbol(); 563 var activationSymbol1 = new ActivationVariable();
565 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 564 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
566 activationSymbol1); 565 activationSymbol1);
567 var deleteAction1 = new DeleteAction(newItemSymbol1); 566 var deleteAction1 = new DeleteAction(newItemSymbol1);
568 567
569 var newItemSymbol2 = new NewItemSymbol(); 568 var newItemSymbol2 = new NewItemVariable();
570 var activationSymbol2 = new ActivationSymbol(); 569 var activationSymbol2 = new ActivationVariable();
571 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2, 570 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
572 activationSymbol2); 571 activationSymbol2);
573 var deleteAction2 = new DeleteAction(activationSymbol2); 572 var deleteAction2 = new DeleteAction(activationSymbol2);
574 573
@@ -592,20 +591,20 @@ public class ActionEqualsTest {
592 action2.add(insertAction2); 591 action2.add(insertAction2);
593 action2.add(activationSymbol2); 592 action2.add(activationSymbol2);
594 593
595 assertEquals(action1, action2); 594 assertTrue(action1.equalsWithSubstitution(action2));
596 } 595 }
597 596
598 @Test 597 @Test
599 void oneUnpreparedActionTest() { 598 void oneUnpreparedActionTest() {
600 var newItemSymbol1 = new NewItemSymbol(); 599 var newItemSymbol1 = new NewItemVariable();
601 var activationSymbol1 = new ActivationSymbol(); 600 var activationSymbol1 = new ActivationVariable();
602 var insertAction1 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol1, 601 var insertAction1 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol1,
603 activationSymbol1); 602 activationSymbol1);
604 var deleteAction1 = new DeleteAction(newItemSymbol1); 603 var deleteAction1 = new DeleteAction(newItemSymbol1);
605 604
606 var newItemSymbol2 = new NewItemSymbol(); 605 var newItemSymbol2 = new NewItemVariable();
607 var activationSymbol2 = new ActivationSymbol(); 606 var activationSymbol2 = new ActivationVariable();
608 var insertAction2 = new InsertAction<>(model.getInterpretation(type1), true, newItemSymbol2, 607 var insertAction2 = new InsertAction<>(model.getInterpretation(relation1), true, newItemSymbol2,
609 activationSymbol2); 608 activationSymbol2);
610 var deleteAction2 = new DeleteAction(activationSymbol2); 609 var deleteAction2 = new DeleteAction(activationSymbol2);
611 610
@@ -630,6 +629,6 @@ public class ActionEqualsTest {
630 action2.add(insertAction2); 629 action2.add(insertAction2);
631 action2.add(activationSymbol2); 630 action2.add(activationSymbol2);
632 631
633 assertNotEquals(action1, action2); 632 assertFalse(action1.equalsWithSubstitution(action2));
634 } 633 }
635} 634}