MathGroup Archive 2010

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

Search the Archive

Why does this pattern fail to match?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114146] Why does this pattern fail to match?
  • From: kj <no.email at please.post>
  • Date: Thu, 25 Nov 2010 05:57:16 -0500 (EST)




I'm tearing my hair out over this one.  Could someone please explain
to me why all the following MatchQ expressions 

MatchQ[Times[ -1, Power[s, -1]      ],
       Times[___, Power[___],    ___]]

MatchQ[Times[ -1, Power[s, -1]],
       Times[___, Power[___]  ]]

MatchQ[Times[ -1,  Power[s, -1]      ],
       Times[___, _Power        , ___]]

return False?  (In all cases, s is undefined).  And yet, this succeeds:

MatchQ[Times[ -1,  Power[s, -1]],
       Times[___, _Power       ]]


Is there a systematic way to debug/troubleshoot such pattern matching
problems? Trace is useless here.

Also, whatever the reason is for the failure of this pattern to
match, where is this reason documented?  I've gone blind poring
over the documentation trying to find an answer, without success.

TIA!

~kj


  • Prev by Date: Re: Why this can't be reduced by mathematica?!
  • Next by Date: Re: Anyone get OpenCL working?
  • Previous by thread: Re: Efficient search for bounding list elements
  • Next by thread: Re: Why does this pattern fail to match?