Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Problem with matching.

  • To: mathgroup at
  • Subject: [mg53959] Re: Problem with matching.
  • From: p-valko at
  • Date: Sat, 5 Feb 2005 03:15:30 -0500 (EST)
  • References: <ctrngb$brk$>
  • Sender: owner-wri-mathgroup at

On a second thought:

I think the first responses (inclding mine) did not capture the

The real problem is that your original matching pattern is so generally
stated that it would match anything so Mathematica prevents it to do so.

I think in this case you must require F to have 3 arguments, whatever
they are. In other words you should write:
/. F[{c1_, a_, c2_}]F[{c3_, a_, c4_}]

Indeed, with this construction
F[{x, 1, c}]F[{x, 2, f}] /. F[{c1_, a_, c2_}]F[{c3_, a_, c4_}] :> yes
does not do the substitution and
F[{x, 2, c}]F[{x, 2, f}] /. F[{c1_, a_, c2_}]F[{c3_, a_, c4_}] :> yes
does do the substitution - and hence results is yes, as expected.


  • Prev by Date: Re: Product {for p=2 to infinity} (p^2+1)/(p^2-1)
  • Next by Date: Mathematica for Summation of Trigonometry expression
  • Previous by thread: Re: Problem with matching.
  • Next by thread: Re: Re: Problem with matching.