[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Axiom-developer] Re: algebra cycles again (was: Left shifts of negative
[Axiom-developer] Re: algebra cycles again (was: Left shifts of negative numbers)
Tue, 14 Oct 2003 22:48:00 -0400
On Tue, Oct 14, 2003 at 07:40:52PM -0400, Page, Bill wrote:
> Unfortunately INT, SINT, and NNI are all bootstrapped so
> replacing the code and testing is a little more involved.
> Do you want to try it, or shall I?
That scares me a bit. Can you do it, and record the steps involved?
But I don't think NNI (NonNegativeInteger) should need any changes,
since there's no difference when the arguments are positive...
Maybe it's worth writing some code to check that the generated .lisp
files are the same as the cached ones? Or is that already written?
> BTW, I noticed that in the algebra/Makefile.pamphlet Tim
> SETCAT -> SINT -> UFD -> GCDDOM -> COMRING -> RING ->
> RNG -> ABELGRP -> CABMON -> ABELMON -> ABELSG -> SETCAT
> as an example of cycle in Axiom's type system. It occurs
> to me that perhaps changes such as you suggested (removing
> the Latex stuff from SETCAT) might help to eliminate *some*
> of this sort of thing.
Well, this one would go away if the 'hash' function were removed from
SETCAT. It's the obvious weak link in that chain; the others are all
very reasonable. (Except that integers mod a power of 2
are not actually a UFD...)
I thought at first that the 'hash' function was better than 'latex',
but now I see that that's not true: if the type doesn't support proper
equality testing, it's not safe to use hash, and if it does, then
there's always a fall-back (although slower) algorithm, and by having
a separate 'Hashable' class and checking 'if T has Hashable then ...'
you could arrange for all algorithms to run as fast in practice.
> I am still not sure whether cycles of this kind are a
> good thing or a bad thing ...
There may be cases when cycles are necessary, but I don't think this