MathGroup Archive 2010

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

Search the Archive

Re: More /.{I->-1} craziness

  • To: mathgroup at
  • Subject: [mg106166] Re: More /.{I->-1} craziness
  • From: David Bailey <dave at>
  • Date: Sun, 3 Jan 2010 03:43:19 -0500 (EST)
  • References: <> <hhhmn8$o9t$> <hhkjc4$5ag$>

Richard Fateman wrote:
> Leonid Shifrin wrote:
> ...
>> I think that there are not many more objects in Mathematica which are as
>> tricky as <I> or Infinity in terms of pattern-matching. 
> I agree.
> That's why it can be fixed.
> Here's a beginning of a short list for the "we're not just talking 
> syntactic replacement-- version of substitution":
> If the user says   -i --> i,   then do  Complex[a_,-b_] -> Complex[a,b].
> If the user says   x^2 --> y,  then do  x^(-2)-> 1/y    also.
> I assume this list can be enlarged somewhat, and could even be left 
> open-ended by user option of some sort.  [e.g. should x^2--> y   also 
> change x^3 to x*y?   or to y^(3/2) or ....]
> ....
>>  It would perhaps be nice if such
>> cases were more systematically documented, but they have nothing to do with
>> bugs, 
> You are right if you mean  "bug in Mathematica implementation of 
> intended design"  (this is not such a bug).
> But there is another concept:
> "bug in Mathematica design, contrary to reasonable mathematical expectation"
> (this IS such a bug).
Would you really want to use a system which had been arbitrarily hacked 
by well meaning individuals to create exceptions that suited their taste?

Perhaps the documentation should make it clearer which operations are 
supposed to always perform mathematically valid operations, and which 
are meant to operate on the structure of expressions, oblivious to their 
meaning. I think this is an important distinction. If you pass an 
expression to Integrate (say), you expect to get the integral of that 
expression back as a result (possibly in symbolic form still involving 
an integral sign) - anything else is a bug. However, other operations - 
such as ReplaceAll - are not *defined* mathematically, they are defined 
structurally, and as I pointed out earlier, can be used to produce 
explicitly invalid expression transformations.

Are you really saying that Mathematica doesn't need structural 
operations? If it does, why pick on ReplaceAll?

David Bailey

  • Prev by Date: Re: Difficulty with NDSolve (and DSolve)
  • Next by Date: Re: Replace and ReplaceAll -- simple application
  • Previous by thread: Re: More /.{I->-1} craziness
  • Next by thread: Re: More /.{I->-1} craziness