Browse Source

Fixed group combination constants.

Taddeus Kroes 14 năm trước cách đây
mục cha
commit
569d321d2a
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      src/rules/groups.py

+ 4 - 1
src/rules/groups.py

@@ -46,12 +46,15 @@ def match_combine_groups(node):
                     groups.append((sub_node, g, n))
 
     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
             c0 = c0.negate(g0.negated)
             c1 = c1.negate(g1.negated)
             g0 = negate(g0, 0)
             g1 = negate(g1, 0)
+
             p.append(P(node, combine_groups, (scope, c0, g0, n0, c1, g1, n1)))
 
     return p