featurep(e, real)



On 5/16/06, Robert Dodier <robert.dodier at gmail.com> wrote:
>
> > However, featurep (like sign, etc.) is a *programming tool*, not a
> mathematical
> > function.  It is useful for dispatching on the result.  I don't think
> it's useful or
> > helpful for it to return a conditional expression.
>
> featurep has accreted some mathematical knowledge, because that
> knowledge is useful and there's nowhere else to put it.
> e.g. declare (n, integer); featurep (2*n, even); =3D> true
> In the absence of something like is (2*n in 2*Z), featurep will have to
> do.
> Whether it was originally invented for some other purpose doesn't
> matter anymore.


Well, I partly agree and partly disagree.

The original purpose matters because it is still a valid purpose.  It is
still useful to be able to tag identifiers with properties and look up those
properties simply and efficiently.  The feature creep that gave us
featurep(2*n,even) is a bad thing.

For the tagging functionality, it is clear that True means simply "X has
been tagged with Property" and False means "X has not been tagged with
Property".  If we extend this to the general inference problem of
determining whether X has a property, what does False mean? that Maxima
cannot determine whether X has the property? that X provably does not have
the property?

There is a very different requirement for a function that performs a
best-effort determination of whether X has a certain property.  That
function does not have to restrict itself to the simplest cases, and might
well spend some significant effort determining that an expression is
integral or odd or whatever.

              -s