Open shashi opened 1 year ago
Have a macro
@arithmetic_rule $(D(r)) * ~x => ...
such that it matches,
D(r) * a * b with ~x as a*b (D(r) * b) / a with ~x as b/a
D(r) * a * b
~x
a*b
(D(r) * b) / a
b/a
Also similarly enable: D(x) * ~y + ~x
D(x) * ~y + ~x
This should simplify writing redundant rules in MethodOfLines.jl
One idea is to just add multipleof predicate, and make it more powerful by allowing slots in predicate.
multipleof
@rule ~x::multipleof(~y) + ~z::multipleof(~y) => ~y * (~x / ~y + ~z/~y)
Have a macro
such that it matches,
D(r) * a * b
with~x
asa*b
(D(r) * b) / a
with~x
asb/a
Also similarly enable:
D(x) * ~y + ~x
This should simplify writing redundant rules in MethodOfLines.jl