It seems that the term 'pattern match' is overloaded here.
The existing pattern matching in sympy appears to match at the
mathematical level:
p = Wild('p')
print (x+1).match(x+p)
{p_: 1}
That is, it returns the value that makes the patterned expression
true.
The code I've written is for
Dimas,
The pattern matching code I've been working on might be useful to
compactly represent this sort of transformation.
The code is here:
https://github.com/markdewing/sympy/blob/derivation_modeling/sympy/prototype/codegen/pattern_match.py
Example of it in use is here (converting to a