MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Specify TransformationFunctions in Simplify[] gives wrong result


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.



  • Prev by Date: Re: Pattern Syntax for Alternate Heads with Default Value
  • Next by Date: "Complex" Integral
  • Previous by thread: How to consistently define StandardForm for output?
  • Next by thread: Re: gives