# Design of Computer Algebra Systems

- 02 December 2005
- General

Computer algebra systems (CAS), such as Mathematica, are complex systems that have been evolving for a couple of decades. They are advertised as advanced mathematical tools, and users expect them to be such. They are the next-generation calculators. But they also suffer from serious design flaws.

Unfortunately, the current CAS implementations suffer from two serious problems. Firstly, in terms of programming language design they are horrible abominations. It is next to impossible to maintain a large piece of code in Mathematica. The bugs starts crawling in at around 3000 lines of code. Secondly, people *expect* correct answers but they are given no guarantee. The advertisements and the documentation never warn you of typical traps that users fall in. I have seen this happen to my students many times.

Below is included a Mathematica notebook, as well as a PDF transcript of it, which shows you some pitfalls of Mathematica. Please, do not get me wrong, I *love* Mathematica for all of the great things it can do. I teach my students how to use Mathematica, and I show them examples from their calculus classes that their teacher solved incorrectly, which Mathematica gets right. But I also *hate* it for containing so many nasty surprises. As a mathematician, I care about mathematical correctness. It bugs me when a program is promoted under the name _Math_ematica, but its makers do not state clearly, under what conditions it gives correct answers.

I have no solutions to offer, yet. Designing a *safe* Computer Algebra System which is also *useful* is a big open problem.

**Download:** Surprises.nb or Surprises.pdf

P.S. I am interested in other examples which show design flaws and inherent limiations of Mathematica, especially when they cause surprising or wrong answers. If you know any, please send them to me.

##### Post a comment:

`$⋯$`

for inline and `$$⋯$$`

for display LaTeX formulas,
and `<pre>⋯</pre>`

for display code. Your E-mail address is only used to compute
your Gravatar and is not stored anywhere.
Comments are moderated through pull requests.
## Comments

Not sure if you are aware of it, but there is an interesting certified CAS called Focal.

I would hardly call Focal a "Computer Algebra System". It's a tool for writing correct programs. A computer algebra system is something that knows how to solve a cubic equation, for example.

I would hardly call Focal a “Computer Algebra System”. It’s a tool for writing correct programs. A computer algebra system is something that knows how to solve a cubic equation, for example. Realy?

Hi Andrej

You could read some serious reviews of Mathematica from Richard Fateman at

http://people.eecs.berkeley.edu/~fateman/papers/mma.pdf http://people.eecs.berkeley.edu/~fateman/papers/mma6rev.pdf

Ugh, this is a very very old post. Mathematica has changed since then and I am sure a lot of what I was cirticizing has been fixed. In any case, I think Mathematica is taking a different route than proof assistants. It's more about knowledge management in the machine-learning sense of the word than about mechanised mathematics.

Focal link broken