Open
Description
Prompted by this discussion
When using @acrule
, I can't "propagate" AC to operands other than the toplevel one. In the example below, a correct factorisation rewriter would be Rewriters.Chain([factor, factor2, factor3])
where I would expect to only have to write the first rule. Maybe there is a way to circumvent this though?
using SymbolicUtils
@syms a b c
expr = a*b + b*c
factor = @acrule +(~x*~y, ~x*~z) => *(~x, ~y+~z)
factor2 = @acrule +(~y*~x, ~z*~x) => *(~x, ~y+~z)
factor(expr) # nothing
factor2(expr) # nothing
factor3 = @acrule +(~x*~y, ~z*~x) => *(~x, ~y+~z)
factor3(expr) # b*(a+c)
Metadata
Metadata
Assignees
Labels
No labels