ntrig and constantp problem



On 5/2/08, Robert Marik <marik at mendelu.cz> wrote:

> Dear members of the list, it seems that ntrig causes problems in
>  constantp function. The following returns false
>
>  load(ntrig);
>  declare(a,constant);
>  constantp(sin(a));

Robert, this is a bug. constantp assumes that if a function foo
is not a Maxima built-in simplifying function, then any expression
foo(x) (ignoring what might be known about x) is not constant.

There are 2 problems here. The immediate problem is that the test
(MOPP) to distinguish Maxima built-in simplifying functions is buggy;
in particular the presence of tellsimp rules for the operator
(as created by ntrig, for example) cause MOPP to mistakenly
return NIL. Not sure what we can do to fix MOPP.

The other problem is the assumption that functions other than
the ones that pass MOPP are not constant. Maybe that should
be relaxed. I am a little surprised that constantp('foo(1)) => false
where foo is some random symbol. I suppose the rationale here
is that some random function could depend on a global variable.

In summary it's clear what's going on here, but I'm not sure
what to do about it at this point.

best

Robert Dodier