Skip to content

Commit 013a450

Browse files
committed
also check cse.get_extra_properties
1 parent 17783e1 commit 013a450

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

pymbolic/mapper/equality.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,11 @@ def map_common_subexpression(self, expr, other) -> bool:
213213
return (
214214
expr.prefix == other.prefix
215215
and expr.scope == other.scope
216-
and self.rec(expr.child, other.child))
216+
and self.rec(expr.child, other.child)
217+
and all(k == other_k and v == other_v
218+
for (k, v), (other_k, other_v) in zip(
219+
expr.get_extra_properties(),
220+
other.get_extra_properties())))
217221

218222
def map_substitution(self, expr, other) -> bool:
219223
return (

pymbolic/primitives.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,12 +1029,6 @@ class Quotient(QuotientBase):
10291029
.. attribute:: denominator
10301030
"""
10311031

1032-
def is_equal(self, other):
1033-
from pymbolic.rational import Rational
1034-
return isinstance(other, (Rational, Quotient)) \
1035-
and (self.numerator == other.numerator) \
1036-
and (self.denominator == other.denominator)
1037-
10381032
mapper_method = intern("map_quotient")
10391033

10401034

0 commit comments

Comments
 (0)