Skip to content
Snippets Groups Projects
Commit 97d4462f authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Fix CSE tagger when multiple identical expressions occur in a commutative subexpr.

parent 4ffb47d4
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,11 @@ class NormalizedKeyGetter(object): ...@@ -26,7 +26,11 @@ class NormalizedKeyGetter(object):
def __call__(self, expr): def __call__(self, expr):
expr = self.remove_cses(expr) expr = self.remove_cses(expr)
if isinstance(expr, COMMUTATIVE_CLASSES): if isinstance(expr, COMMUTATIVE_CLASSES):
return type(expr), frozenset(expr.children) kid_count = {}
for child in expr.children:
kid_count[child] = kid_count.get(child, 0) + 1
return type(expr), frozenset(kid_count.iteritems())
else: else:
return expr return expr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment