Is %i an integer? - Adding more facts to the database
Subject: Is %i an integer? - Adding more facts to the database
From: Dieter Kaiser
Date: Mon, 29 Jun 2009 01:59:33 +0200
Am Sonntag, den 28.06.2009, 19:36 -0400 schrieb Stavros Macrakis:
> On Sun, Jun 28, 2009 at 5:53 PM, Leo Butler <l.butler at ed.ac.uk> wrote:
> ...It seems to me that there is a convention and it is
> reasonable:
> if x is declared to be in a set, but not explicitly declared
> to be
> in a subset, then it is assumed not to be in the subset.
>
> I think that would be a terrible convention and it conflicts with
> standard mathematics: writing x ? C never implies x ? R in
> mathematics.
But this "terrible" convention is implemented in Maxima:
(%i1) declare(x,real);
(%o1) done
A symbol declared to be real is complex, or real:
(%i5) featurep(x,complex);
(%o5) true
(%i6) featurep(x,real);
(%o6) true
but not a rational, or an integer:
(%i7) featurep(x,rational);
(%o7) false
(%i8) featurep(x,integer);
(%o8) false
Now the other way:
(%i12) declare(n,integer);
(%o12) done
A symbol declared to be an integer is an integer, a rational, a real, or
a complex:
(%i13) featurep(n,integer);
(%o13) true
(%i14) featurep(n,rational);
(%o14) true
(%i15) featurep(n,real);
(%o15) true
(%i16) featurep(n,complex);
(%o16) true
Dieter Kaiser