general comments, was: proposal to cut some aliases



Rules are seductive because they solve easy problems easily. They do not
solve difficult problems easily. Rules are very inconvenient for
accumulating and acting upon global information, including looking at
various simplification flags, noticing whether a particular variable occurs
elsewhere in an expression, and providing simple facilities -- such as
sorting -- efficiently. 

It seems to me that you are asking for documentation in the form of rules,
at least in part. That's OK with me.

It is also ok to write rules for  f(g(x)) -->     e.g.  sin(2*x).

But rules for  sin(x)^2+ [otherstuff]+cos(x)^2 --> ....
Cannot just be thrown in with everything else.

Replacing the core of the simplifier with something small and very fast, and
having special routines like ratsimp,  or  "simplify_with_assumptions"  or
"simplify_with_ruleset"  seem to me to be more plausible.

E.g. I have routines that take large expressions (sums or products), and
distribute the contents into hash-table entries.  Not rule-based.  But
potentially orders of magnitude faster than programs like simplus,
simptimes, etc.

RJF

-----Original Message-----
From: maxima-admin at math.utexas.edu [mailto:maxima-admin at math.utexas.edu] On
Behalf Of Robert Dodier
Sent: Monday, July 10, 2006 8:57 PM
To: macrakis at alum.mit.edu
Cc: Maxima mailing list
Subject: Re: [Maxima] general comments, was: proposal to cut some aliases

Stavros,

> The core simplifier is fast and (pretty) good because thought
> was put into (1) standardizing the internal format (sorting
> arguments in useful ways) and taking advantage of that
> and (2) ordering the rule applications.  No doubt this work
> could be reproduced by a combination of compiling rules
> cleverly and giving hints of various kinds, but I suspect
> the result would be slower, no more functional, and perhaps
> still difficult to extend (presumably the main motivation for
> doing it).

Well, the primary motivation behind making the simplifier
rule-based is to make it more comprehensible. At present,
you have to reverse-engineer the source code to know
what identities are applied.
Expressing identities as rules won't completely solve the
problem -- there would be lot of rules & they would interact,
so predicting their effect is hard -- but I'm pretty sure it would
make it easier to comprehend what the simplifier is doing.

Extensibility isn't so much of an issue since the simplifier
can already be extended by rules. It's the built-in stuff that
I'm thinking about.

Ideally it would be possible to cancel the built-in
simplification rules or maybe swap one set of built-in
rules for another. I am thinking (day dreaming, really)
that this could make it easier to work in a specified domain,
or, as an academic exercise for example, to reimplement
the standard rules. But this rule-swapping business is
a secondary motivation for reworking the simplifier.

I'm quite sure that a rule-base simplifier would be slower,
but I'd certainly be willing to give up a small constant factor
in time, if it gave us greater comprehensibility.

best,
Robert

_______________________________________________
Maxima mailing list
Maxima at math.utexas.edu
http://www.math.utexas.edu/mailman/listinfo/maxima