Commit 569d321d authored by Taddeus Kroes's avatar Taddeus Kroes

Fixed group combination constants.

parent 1efc3675
...@@ -46,12 +46,15 @@ def match_combine_groups(node): ...@@ -46,12 +46,15 @@ def match_combine_groups(node):
groups.append((sub_node, g, n)) groups.append((sub_node, g, n))
for (c0, g0, n0), (c1, g1, n1) in combinations(groups, 2): for (c0, g0, n0), (c1, g1, n1) in combinations(groups, 2):
if g0.equals(g1, ignore_negation=True): if g0.equals(g1):
p.append(P(node, combine_groups, (scope, c0, g0, n0, c1, g1, n1)))
elif g0.equals(g1, ignore_negation=True):
# Move negations to constants # Move negations to constants
c0 = c0.negate(g0.negated) c0 = c0.negate(g0.negated)
c1 = c1.negate(g1.negated) c1 = c1.negate(g1.negated)
g0 = negate(g0, 0) g0 = negate(g0, 0)
g1 = negate(g1, 0) g1 = negate(g1, 0)
p.append(P(node, combine_groups, (scope, c0, g0, n0, c1, g1, n1))) p.append(P(node, combine_groups, (scope, c0, g0, n0, c1, g1, n1)))
return p return p
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment