Re: Replacement Rule with Sqrt in denominator
- To: mathgroup at smc.vnet.net
- Subject: [mg114426] Re: Replacement Rule with Sqrt in denominator
- From: Daniel Lichtblau <danl at wolfram.com>
- Date: Sat, 4 Dec 2010 06:12:43 -0500 (EST)
Richard Fateman wrote: > [...] > Each time someone defends Mathematica via "you have to look > at FullForm" he/she is essentially saying, "Mathematica is now too > stupid to do what you want, A more accurate translation would be "Mathematica is to stupid to read your mind and figure out what you really want." > and the programmers of the system > are too resistant to making it smarter. I cannot speak for all of the programmers here. For myself, I'll say I've been doing this stuff a long time, and I recognize a fool's errand in what you propose here. > Thus the burden falls on > you to look at the data representation underlying the abstraction > to make your program work." I'd change "abstraction" to "representation". At which point I would agree, regarding the burden. > It's not so hard to make the system smarter. I'll indicate below why I am not convinced what you want equates to smarter software. > But you pay for what > you get. Here I agree. Actually one of the things I really appreciate about Mathematica, and for which, alas, I can take no credit, is that rule replacement works so reliably well. When I get frustrated with it failing to do what I intend (about once every month or two), there is the inevitable session with MatchQ to sort things out. > RJF I think any nonsyntactic rule replacement will need very clear semantics. The notion "replace it if it shows up visually" is not terribly clear. It relies, among other things, on specifics of the format settings, vagaries of e.g. StandardForm, and other details. To give an idea of what is meant by the formatting vagaries, consider that we could represent 1/Sqrt[x+1] explicitly as (x+1)^(-1/2) (mentally format that so it looks pretty, with the exponent raised, no caret, etc.) So the substitution semantics being proposed would depend on formatting?! Or should it apply to any power of (x+1) when that power visually has a 2 in the denominator? (Does it then apply to (x+1)^(a/2+b/4)? Or only to the equivalent (x+1)^(1/2*(a+b/2))?) These are the questions that would need to be answered before even embarking on this journey. I will add that about the last thing anyone wants is that StandardForm formatting be influenced by the desire to avoid any possibility of showing "misleading" expression structure. I don't think you are proposing otherwise, but it would be a natural outcome to any effort to try to curtail this misunderstanding. I have not raised the I->3*I issue. I do wonder what should be the outcome of Sin[x] /. I->3*I . Maybe the trig equivalent of (Exp[3*I*x] - Exp[-3*I*x]) / (6*I), which is Sin[3*x]/3? (Maybe we should make it case insensitive, and return S3in[x]?) Daniel Lichtblau Wolfram Research