unify(x, y, s, variables) lists the substitutions (named lists from the
variables to expressions) that make x and y equal, treating the
symbols in variables as wildcards; sums, products, unions,
intersections and finite sets match associatively, and commutatively
where SymPy's do. rewriterule(source, target, variables, condition, assume) returns a function giving the rewrites of an expression.
unify_core() is the generic algorithm on unify_compound(),
unify_variable() and unify_condvariable() trees.
Arguments
- op, args, arg, valid
Parts of a tree.
- x, y
Expressions or trees.
- s
A starting substitution.
- fns
Named list with
is_associativeandis_commutative.- variables
Symbols that act as wildcards.
- ...
Unused.
- source, target
Patterns.
- condition
A predicate on the matched values.
- assume
A boolean assumption the match must satisfy.