> < ^ Date: Tue, 28 Mar 1995 17:39:00 -0500
> < ^ From: Alexander Hulpke <hulpke@math.colostate.edu >
< ^ Subject: Re: Products of Elements of Different Fields

Lewis McCarthy wrote:

I haven't seen this phenomenon mentioned in the GAP Forum, so I'm hoping
this isn't old news.

At least to me it's new, as I never tried simultaneously with different
algebraic extensions.

elements of "unusual" domains in GAP, I've noticed a small bug in the code
for Rationals.operations.AlgebraicExtensionElmOps.\*:

[multiplication of elements in different AlgebraicExtensions leads to
infinite recursion, example omitted]

I think I have figured out why this happens. In the aforementioned routine,
this is what happens when the elements to be multiplied lie in different
domains:

elif a.domain <> b.domain then
return a.operations.\*( a, b );

I'm not sure what the intent of this particular line was, but it seems
bound to lead to an infinite recursion whenever it's reached. So I presume
the procedure call stack is overflowing, causing the segmentation fault.

Your diagnosis is completely correct. The original intention for this
line was to allow possibilities for multiplication with further
user-defined objects. By standard, the multiplication function of the
right multiplicand is called. If it does not know how to deal with this
object, the idea was to try the left multiplication function.
Unfortunately doing so, I laced my own shoes as this might lead to
infinite recursions as in your example.

Until the implementation of multiple extensions is ready, perhaps the above
lines should actually read:

elif a.domain <> b.domain then
Error("<a> and <b> lie in no common domain");

Actually, the function takes care beforehand of multiple extensions
(though they are not yet supported).
The case of very different objects with own operations did not yet
arise and will be dealt with differently in future versions of GAP;
therefore this fix should do no harm (unless you really want to define
weird objects) and will certainly save you from this crash.

Of course this is rather a cleanup and still does not give you the
possibility to execute your example multiplication. For doing so,
you'd need to define a new extension. Mail me directly if you want
help with this.

Yours,

Alexander Hulpke

-- Alexander Hulpke, Lehrstuhl D f"ur Mathematik, RWTH, 52056 Aachen,
ahulpke@bert.math.rwth-aachen.de ,
until April '95: Concordia University, Montreal, Canada
hulpke@abacus.concordia.ca


> < [top]