MathGroup Archive 2012

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

Search the Archive

Specify TransformationFunctions in Simplify[] gives wrong result

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125865] Specify TransformationFunctions in Simplify[] gives wrong result
  • From: Yi Wang <tririverwangyi at gmail.com>
  • Date: Thu, 5 Apr 2012 05:52:21 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com

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.



  • Follow-Ups:
    • Re: gives
      • From: Bob Hanlon <hanlonr357@gmail.com>
  • 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