Re: [q-lang-users] Q as a Computer Algebra System
Brought to you by:
agraef
From: dx <dx...@ac...> - 2006-08-15 14:02:46
|
Hi, If you want CAS, you can try Maxima or Axiom. By the way, is there anyone knows Wm Leler's Bertrand(augmented term rewriting), I read the book a long time ago, I am just wondering how close it is to Q. Thanks, dex Rob Hubbard wrote: > Hello Anthony, > > I too first became interested in 'Q' because of mathematics. I am > fairly new to Q too. > > Q is not, in my view, a typical functional language. If you're > interested in learning functional languages, you should also take a > look at some others. It would probably be instructive to try Standard > ML <http://www.smlnj.org/>. There are many other interesting > functional languages. However, I think you will really enjoy using Q. > It's one of the languages that I most enjoy using. > > Beware that Q may not always behave quite as you expect at first. For > example, if you enter the simple program consisting of just the > rewrite rule: > X+X = 2*X; > and the giving Q some expressions to reduce: > ==> A+A+B > 2*A+B > ==> A+B+B > A+B+B > the final response from Q may not be what you expect. > > A+B+B, which is (A+B)+B due to the left-associativity of (+), was not > reduced, as this does not match the given rule. > With the additional rule > Y+X+X = Y+2*X; > you will now get the responses from the Q system > ==> A+B+B > A+2*B > ==> A+A+B+B+C+C+D+D > 2*A+2*B+2*C+2*D > > To quote Albert Graef's informative reply to one of my questions: > 'Yes, it's surprisingly hard to do apparently basic stuff like this, > because it involves "rewriting modulo AC" (AC = > associativity/commutativity). The conventional way to deal with this > is to transform the original terms into a "sum of products" normal > form and represent that as a list which is lexicographically ordered > according to the involved symbols. It's not really that hard to do but > it indeed involves additional rules on a kind of meta-level, so there > is no straightforward solution with just a few equations.' > > I was at first disappointed with Q not being the simple computer > algebra system I hoped it would be. But then that's not what it's > intended to be. Once you get used to it, you find that Q does seem to > do the "right thing". Those involved with developing Q take great care > to keep Q a sensible and consistent language. (See for example the > helpful reply from John Cowan in a discussion > <http://sourceforge.net/mailarchive/message.php?msg_id=19294969> of > type tests, in the lead up to the release of Q7.2) > > Not many languages that I know are so well thought out, but I think > that Q is. And Q has fairly comprehensive libraries, together with > comprehensive programming tools, such as the debugger. > > When I want to do some maths, I now usually reach for Q. But I tend to > write code for the specific type of mathematical object I'm currently > interested in. I imagine that to write a fairly comprehensive symbolic > computer algebra system would be a job of comparable complexity in any > language, Q, C++, ML, Python, or any other "general purpose" language. > > By the way, if anyone does know of a good free / open source symbolic > computer algebra system or programming language, please let me know. > Mathematica is unbelievably expensive, and I don't need anything that > powerful or comprehensive. > > I hope these comments (and opinions) are helpful, > Rob. > > On 15/08/06, Anthony <ad...@ke...> wrote: >> Just a general question...Q is my first experience >> with a functional language. What would it take to >> write a Mathematica clone in Q? >> >> I don't mean a full-Mathematica clone, but something >> that would emulate the kernel mode, circa 1988--an >> unlimited integer, numeric, graphical, and symbolic >> program with an easy syntax. >> >> For example x + 8 will generate internally a >> Plus[x,8] production, and 1+x^2+(y+z)^2 generates >> >> Plus[1, Power[x,2], Power[Plus[y,z],2]] >> >> What I'd like to do is just write a small Q program >> that parses a line of input according to the rules of >> Mathematica. No need to evaluate the functions...just >> want to build a syntax checker at first. >> >> Or maybe I am dreaming... > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > q-lang-users mailing list > q-l...@li... > https://lists.sourceforge.net/lists/listinfo/q-lang-users > |