Re: Why doesn't this rule work?
- To: mathgroup at smc.vnet.net
- Subject: [mg32470] Re: Why doesn't this rule work?
- From: atelesforos at hotmail.com (Orestis Vantzos)
- Date: Tue, 22 Jan 2002 03:19:52 -0500 (EST)
- References: <firstname.lastname@example.org>
- Sender: owner-wri-mathgroup at wolfram.com
The correct rule is Plus[n1_. a, n2_. c, R___] /; n1 == -n2 :> Plus[R] Repeat after me: FullForm is my best friend, FullForm is my best friend,... Indeed FullForm[a-b-c] for instance returns Plus[a,Times[-1,b],Times[-1,c]] It is evident that a rule of the form (n1_. a + n2_. b) simply does not match, since the only _Plus expression present contains many more things than a and c. Hope that helped, Orestis