[Aldor-l] Collapse of function signatures

Ralf Hemmecke ralf at hemmecke.de
Mon Jan 3 09:33:47 EST 2005


Hi Christian,

>> In DistributedMultivariatePolynomial1(R, V, E) there are two functions
>>        *: (Integer, %) -> %
>>        *: (R, %) -> %
>> The first is implemented in sm_dmp1.as and the second in sm_dmp0.as.
>> Fortunately, they do not contradict.

> I am not completely sure, what problem you are addressing.

Maybe I was not clear enough.

I was _not_ addressing the introduction of axioms into the Aldor 
language. Rather I wanted to say that with the two * functions above 
there is a case of multiple inheritance of implementations if R=Integer.

R=Integer happens at compile time and the compiler must decide for one 
of the two implementations.

I could imagine that with a good design of a library this should never 
be a problem, but it seems that the compiler has troubles to compile 
correctly for R=Integer.

Look at the bug described in xxx.as in
http://www.aldor.org/pipermail/aldor-l/2004-December/000001.html

>> Could the compiler at least warn if there is an _obvious_ collapse of
>> two function signatures, like with Integer or MachineInteger?

> This is likely to give a whole lot of warnings :)

I don't think so.

> Consider why you want to be warned. I suppose, because a functions  
> definition hides another functions definition.

No. At the category level, I don't care. The problem is with 
implementations. And such collapses usually happen at the moment only if 
a parameter of some domain is set to Integer or MachineInteger. In 
particular the polynomial coefficient domain is a candidate to be set to 
Integer.

Ralf



More information about the Aldor-l mailing list