question about declarations



On 2012-05-17, Karl-Dieter Crisman <kcrisman at gmail.com> wrote:

> (%i1) declare(x,complex);
> (%o1)                                done
> (%i2) facts();
> (%o2)                         [kind(x, complex)]
> (%i3) declare(x,real);
> (%o3)                                done
> (%i4) facts();
> (%o4)                  [kind(x, complex), kind(x, real)]
>
> Should this perhaps just result in real, if RR \subset CC?  Or are
> there situations where this would be different from just declaring x
> to be real?

Well, declare is just lazy; for the most part it doesn't attempt to
figure out if declarations are inconsistent or redundant.

(%i1) declare (foo, integer);
(%o1)                                done
(%i2) declare (foo, irrational);
(%o2)                                done
(%i3) facts ();
(%o3)             [kind(foo, integer), kind(foo, irrational)]

Oops.

best,

Robert Dodier