-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.py
29 lines (26 loc) · 1.04 KB
/
test.py
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
from operator import itemgetter
from DataStructures.Trees import findAndRemoveChild
from Tests import *
from Utilities.HelperFunctions import print_constraint_tree
from Utilities.ReduceToElegance import ReductionSignal, reduceToElegance
result = oneConstraintComplementSubtractionTestCase()
current, parentOfCurrent, dominantSet, commandSet, constraint, constraint2 = itemgetter(
"current",
"parentOfCurrent",
"dominantSet",
"commandSet",
"constraint",
"constraint2",
)(result)
print_constraint_tree(constraint)
# action = reduceToElegance(constraint, constraint, [], [])
action = reduceToElegance(parentOfCurrent, current, commandSet, dominantSet)
match action:
# case ReductionSignal.DELETE:
# parentOfCurrent.children = findAndRemoveChild(parentOfCurrent.children, current)
case ReductionSignal.DISCONNECT:
parentOfCurrent.children = findAndRemoveChild(parentOfCurrent.children, current)
print(action)
print_constraint_tree(constraint)
print_constraint_tree(constraint2)
print(compareTrees(constraint, constraint2))