SymbolicUtils.jl
SymbolicUtils.jl copied to clipboard
`substitute` doesn't substitute `x*z` in `x*z*k`?
I expect substitute to substitute the xz in xz*k, but it doesn't? Is there a workaround? I'm using version 0.19.7.
Here's a minimal working example:
using SymbolicUtils
@syms x y z k
y = x*z*k
eq = 0.0 ~ y
println(eq.rhs) #got x*z*k
println(substitute(eq.rhs,Dict(x*z=>0))) #expecting to get 0, but got x*z*k
substitute doesn't do commutative-associative matching. Have you tried to use @rule?
I think @rule is also inadequate or annoying here... I've been thinking about this a bit and i think we need better predicates for AC operations.
I think
@ruleis also inadequate or annoying here... I've been thinking about this a bit and i think we need better predicates for AC operations.
Could e-matching with Metatheory.jl help out?
I've been thinking a lot about supporting AC operations in e-graphs.