There are lots of details that need to be nailed down in
making a computer algebra system, including parser,
evaluator, and display.
MockMMA is a skeleton of a computer algebra system, but
with occasional substantial "meat" on the bones. It also
has some wired-in decision that make it different in some
respects from what is largely compatible with Mathematica.
These decision have to do either with efficiency, or a
disagreement about what should be done in certain cases.
Also there may be subsidiary "fallout" from some of the
decisions in unexpected ways. One design decision is
to provide (and use, in algorithms) a more efficient representation
for polynomials and rational functions (an idea used
in Macsyma). Another is to
make comparison of expressions for equality very fast by
making unique copies of all distinct expressions (an idea
used in Maple).
An eval-once model (an idea in almost all non-Mathematica
systems) is the default; providing an eval-until-it-seems-to
not-change, as in Mathematica, is contemplated.
This file is intended as an overview of the implementation,
but does not provide all the details. Some moredored
details are in the comments in the source files.dired
(the parser)
Our parser differs from Mathematica in a few ways.
Several kinds of unlikely-looking expressions, corner-cases,
are recognized differently. These are generally deliberate,
though some results "fell out automatically" from our parser,
and after some thought we decided they were better.
1.2.3
45/.45->60
We decided that there was too much complication and inconsistency
in the treatment of inequalities or equalities in MMA, and so
we invented a new internal construct, Comparison. Its use replaces
a raft of other stuff, like Inequality, Less, Greater, etc.
In our design a==b is Comparison[a,Equal,b], and
a**1 arguments, the derivatives are provided in
a list:
Gradef[WW, {DWW1, DWW2}].
Naturally the chain rule is used so D[WW[x^2],x] is 2*x*DWW1[x^2,3].
Int (integration) The major built-in program implements
a derivative-divides routine. It knows many, but not all
of the anti-derivatives for the functions known to
the D[] program, but currently not all of them.
It uses the derivatives newly defined by the user when
possible, so that integrating u*du to get 1/2*u^2 is possible
as, for example, Int[2*x*WW[x^2,3]*DWW1[x^2,3],x] is
computed as 1/2*WW[x^2,3]^2.
Int could use Albert Rich's Rubi,
currently (3/2011) being tested.
(interface)
Interactive reading
Batch reading Batch is smart enough to parse some file names without
quotes. e.g. Batch["foo/bar.m"] can also be typed Batch[foo/bar.m].
Extras
PrimeQ etc
just plopped in this piece of code.
Bigfloats.
Currently in the subdirectory more/
there are 3 files bf.lisp, bfelem.lisp bfappend.lisp
load them in (that order) and a bunch of definitions
change. In particular, the meaning of rational floats
is altered so that typing 3.1 no longer yields 31/10,
but a bigfloat.
If you set
Precision=50
1/3.
you now get something like..
Out[701] = 3.3333333333333333333333333333333333333333333333333*10^-1
You can do arithmetic as well as compute Sin, Cos, and some other
functions provided.
Running Rubi..
If your lisp has home directory mma4max, then
(tl)
Batch[rubi/newutility.m]
Batch[rubi/CosCosRules.m]
should get you a bunch of Rubi ready to go. For test examples, see
rubi/CosCosTest.m
Also, lots of things not in that part of Rubi may work simply because
there is a backup integration program in MockMMa for "derivative divides"
integration.
**