function nonintegerp (was RE: should all floats be nonintegers?)
Subject: function nonintegerp (was RE: should all floats be nonintegers?)
From: Robert Dodier
Date: Mon, 24 Dec 2012 17:46:29 +0000 (UTC)
On 2012-12-24, Rupert Swarbrick <rswarbrick at gmail.com> wrote:
> Hmm, but how would you actually define such a symbolic set? I mean, if
> you think about it, you'll probably use a predicate. As such, I think
> you're suggesting that
>
> nonintegerp (x) <=> not {x in ZZ} where ZZ is defined to be the set of
> x such that integerp(x)
>
> This seems rather circular!
Well, I am thinking that set properties will be defined by
simplification and therefore there need not be a single function to
determine set membership. E.g. for integers we could have
elementp(x, ZZ) => true when x is a machine integer
elementp(x, ZZ) => true when x is a symbol declared integer
elementp(f(x), ZZ) => true when f maps S into ZZ and elementp(x, S)
elementp(x, ZZ) => false when x is a literal rational number
elementp(x, ZZ) => false when x is a symbol declared irrational
etc etc for as many cases as we can think of. (The expression won't be
simplified, therefore representing indecision, for any arguments not
falling into a known case.)
As part of this I anticipate there wouldn't be any need for featurep to
attempt to deduce some properties from others; featurep would be
only for inspecting declarations.
Incidentally I should have written nonintegerp(x) <==> not elementp(x,
ZZ) originally; {x in ZZ} is maybe a notation for constructing a set (in
this case, a set identical to ZZ). However, "in" is already recognized
by the parser as part of the notation for a do-loop; I don't know if
it's possible to rearrange things so that 'x in S' is recognized as a
membership test.
best
Robert Dodier