You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This also is a necessary (but not sufficient) step towards being able to use Exprs in sets and maps (still need to implement Ord and Hash) which might have helped @waynexia in #792 with CSE and would help with other algebriac transformations in the future.
Describe the solution you'd like impl PartialOrd for Expr
Thanks, @alamb. That's a good point to have PartialOrd on Expr.
For the CSE use case, it would be nice if we can compare and arrange Exprs in some kinds of order. By doing that we can recognize a+b and b+a are the same expression. And I think it can help other things too.
For the CSE use case, it would be nice if we can compare and arrange Exprs in some kinds of order. By doing that we can recognize a+b and b+a are the same expression. And I think it can help other things too.
That is a good point @waynexia -- I think one common approach is typically called "normalization" (aka rewrite all expressions so logically equivalent expressions like a+b and b+a end up with the same actual Expr form.
Activity
waynexia commentedon Sep 17, 2021
Thanks, @alamb. That's a good point to have
PartialOrdonExpr.For the CSE use case, it would be nice if we can compare and arrange
Exprs in some kinds of order. By doing that we can recognizea+bandb+aare the same expression. And I think it can help other things too.alamb commentedon Sep 17, 2021
That is a good point @waynexia -- I think one common approach is typically called "normalization" (aka rewrite all expressions so logically equivalent expressions like
a+bandb+aend up with the same actualExprform.