[Maxima] Maxima interface to Lisp bit-functions

van Nek van.nek at arcor.de
Sat Mar 22 17:49:24 CDT 2008


> > As a general rule, Maxima is extremely loose in typechecking. Not
> only
> >  does it simplify 0*x => 0, but even 0/x => 0 and "."(x) => x
> 
> Well, it's true that Maxima isn't always very careful, but I think
> there is still something to gain by being more careful with
> new operators (and old ones too, but that is more work).
> 
> So I would rather see simplifications of bitwise operators carried
> out only if the argument is is known by Maxima to be an integer
> (i.e. a literal integer or a symbol or function declared to be
> integral
> or an expression which is demonstrably integral).

'declared to be an integral' means declared by
declare(n,integer) resp. declare(foo,integervalued) ?

And I check this via featurep, like I mentioned below?

Volker


> >  > (%i1) declare(x,even);
> >  > (%o1)                                done
> >  > (%i2) featurep(x,even);
> >  > (%o2)                                true
> >  > (%i3) evenp(x);
> >  > (%o3)                                false
> >
> > This is confusing, I agree.  evenp checks for even *literal
> numbers*:
> >
> >      evenp(floor(x)*2) => false
> >
> >  and featurep has been extended not only to look for features
> >  explicitly added to objects, but for the property in general:
> >
> >     featurep(floor(x)*2,even) => true
> 
> featurep has evolved into a kind of a set membership test for a
> few sets including integers, reals, complex numbers, and a few
> others. I would like to see a general set membership test, e.g.
> is(floor(x)*2 in even_integers), and make featurep just a
> declaration test (as it once was, I believe). Of course set
> membership is not a simple problem, but we may as well start
> talking about what we would like to see.
> 
> FWIW
> 
> Robert Dodier
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima



More information about the Maxima mailing list