freeof, functions and nounify



> I think the noun / verb thing is only a headache--I don't think
> it ever really *does* anything. The abs function has a long-standing
> noun / verb confusion.

There are two cases where Maxima uses the noun/verb system: one is for
mathematical functions from numbers to numbers like sin, gamma, etc.,
the other is for functions over mathematical expressions like diff,
limit, sum, etc. They are only tenuously related conceptually.

For math functions, a verb converts its argument to floating-point if
possible and calculates a floating-point result (possibly complex),
e.g. (verbify(sin))(sqrt(-3)+1) =>  1.48 %i + 2.45, just as though the
"numer" flag were set: sin(%pi/4) => 1/sqrt(2) but
(verbify(sin))(%pi/4) => 0.707.    It's not entirely clear to me why
this was done; perhaps the idea was that you'd convert all nouns into
verbs in an expression which you wanted to evaluate numerically
repeatedly. As far as I can tell, this was a bad design decision made
35+ years ago which was never fully thought through, and never taken
advantage of in any meaningful way. I believe this could be stripped
out of Maxima with no ill effects.

On the other hand, the noun/verb system for functions from expressions
to expressions has some utility.  It lets you express the notion of an
unevaluated version of a function; thus 'diff(y,x) remains 'diff(y,x)
(even after re-evaluation), and does not become 0.  This allows you to
later substitute some expression in x for y, and then force the
explicit calculation of the differential using ev(...,diff).  This is
used both in user input -- where the user inputs 'diff(y,x) -- and in
function output, where limit(f(x),x,0) returns a "noun form" to
express the fact that it can't find any better form.  It is arguably
not necessary for the latter case: the function could simply return
the literal value limit( f(x), x, 0 ) (not calling the "limit"
function); but it turns out to be handy that "ev" does not try to
re-evaluate because "ev" is often (mis-)used for simple value
substitution.  If users were careful about using subst rather than ev,
perhaps this wouldn't be necessary, and we could have the input syntax
'diff(y,x) mean funmake('diff,[y,x]).rather than
(nounify('diff))(y,x).

Given how difficult it is to explain the concepts of
evaluation/simplification/substitution to users, I think it would
confuse our users to get rid of noun/verb for expression-functions.
However, I think we could eliminate noun/verb for mathematical
functions with no consequences at all.  Does anyone disagree?

                   -s