Is %i an integer? - Adding more facts to the database



A symbol that is declared to be rational can also be an integer.
Same for real.
Maybe even complex, if the imaginary part is zero.

So is this change wrong?


Is nonintegerp(x) :=  is not(integerp(x))  ??



Dieter Kaiser wrote:
> I had a look at the problem of the bug report "integrate(exp(-x^(%i)),x,0,1); =>
> Is %i an integer?" - ID: 2811926.
>
> I think at first we should give Maxima more knowledge about known facts.
>
> I have added the following facts to the database:
>
>    (kind $%i $imaginary)
>    (kind $%pi $real)
>    (kind $%gamma $real)
>    (kind $%phi $real)
>
> Next I have improved the function NONINTEGERP.
>
> ;	  ((atom e) (kindp e '$noninteger))
>           ((atom e) (or (kindp e '$noninteger)
>                         (kindp e '$rational)
>                         (kindp e '$real)
>                         (kindp e '$complex)))
>
> With this change symbols wich are declared to be rational, real, or complex are
> a noninteger too.
>
> With this changes we get:
>
> (%i3) featurep(%i,imaginary);
> (%o3) true
>
> and
>
> (%i4) askinteger(%i);
> (%o4) no
>
> Because we have %pi declared to be real we get:
>
> (%i5) featurep(%pi,real);
> (%o5) true
>
> (%i6) askinteger(%pi);
> (%o6) no
>
> With this extension we no longer get the question "Is %i an integer?". Maxima
> tries to give a result. I have not checked the result.
>
> (%i7) integrate(exp(-x^(%i)),x,0,1);
> (%o7) %i*(%i*('limit(%i*gamma_incomplete(-%i,-log(x+1))/2
>                       -%i*gamma_incomplete(%i,-log(x+1))/2,x,0,minus)
>              +%i*gamma_incomplete(%i,1)/2-%i*gamma_incomplete(-%i,1)/2)
>          +'limit(-gamma_incomplete(%i,-log(x+1))/2
>                   -gamma_incomplete(-%i,-log(x+1))/2,x,0,minus)
>          +gamma_incomplete(%i,1)/2+gamma_incomplete(-%i,1)/2)
>
> Maxima gives the correct indefinite integral:
>  
> (%i8) integrate(exp(-x^(%i)),x);
> (%o8) %i*gamma_incomplete(-%i,x^%i)*x*(x^%i)^%i
>
> The testsuite and the share_testsuite has no problems with this extension. I
> think we should do this extension.
>
> Dieter Kaiser
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>