Hi, all,
I met a problem when using the TransformationFunctions option in Simplify:
ClearAll[PDD,try,t,z,aa];
PDD[a_?NumericQ, idx_] := 0;
t = aa PDD[z, d];
try[expr_] := Replace[expr, aa_. PDD[bb_, cc_] :> -bb PDD[aa, cc]];
Simplify[t, TransformationFunctions :> {try}]
I expect Simplify to do nothing, because the replace rule in try[] does not make the function simpler in this special case. However, Simplify[...] returns 0.
If I delete the line " PDD[a_?NumericQ, idx_] := 0; ", Simplify will give the correct result. However, z (or N[z]) is not a number thus it seems the above line shouldn't matter.
I also tried several other tests. I found a_?NumberQ, a_?IntegerQ both have the above problem, while a_ListQ has the desired behaviour.