Re: Dot[]->1

*To*: mathgroup at yoda.physics.unc.edu*Subject*: Re: Dot[]->1*From*: a_rubin at dsg4.dse.beckman.com (arthur rubin)*Date*: Fri, 7 Aug 92 07:36:35 PDT

trott at physik.th-ilmenau.de (Trott Michael) writes: Hi mathgroup, On simplifying some large expressions via some rules I ended with expressions of the following type: Dot[]+Dot[x,y] . In this expression I would like to replace the first part by 1. So I tried: (Dot[] + Dot[x,y])/.{Dot[]->1}. But the result was not what I expected (1+x.y), but rather 1 + 1.x.y . Can somebody tell me how to do my disired replacement and what happens in the described example? ---------------------------------------------------------------------------- Dot has the attribute "Flat", so that Dot[].x = x; I think the best way to fix it would be to use: X_Dot :> If[Length[X]===0,1,X] Not elegant, but it works.