[Aldor-l] Collapse of function signatures

Christian Aistleitner tmgisi at gmx.at
Tue Jan 4 04:35:35 EST 2005


On Mon, 03 Jan 2005 15:33:47 +0100, Ralf Hemmecke <ralf at hemmecke.de> wrote:

> 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 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 fully agree with that. But up to now, there is no problem. The compiler  
has to choose "somehow" what implementation to use. Since the compiler has  
to choose, the implementations should not contradict (or the developer  
should know which implementation is chosen and be pleased with that). And  
indeed in your case, they do not contradict, in what they _should_ do.

The fact that the resulting implementation in  
DistributedMultivariatePolynomial1(Integer,...) does not do what is  
expected, is not a problem of multiple inheritance per se.
As you already reported in
> http://www.aldor.org/pipermail/aldor-l/2004-December/000001.html
it is a problem of compiler optimization.

Sadly enough, compiler optimization bugs occur sometimes. They should get  
fixed. If such an optimization bug renders a library unusable that is  
shipped with the compiler, its especially interesting and annoying.

 From my point of view, its a compiler problem, not a problem about  
multiple inheritance or which implementation is to choose. (If it was a  
pure muhltiple inheritance problem, leaving out -q5 and using the debug  
versions of the libraries should not help. But indeed without -q5 and  
using the debug versions of the libraries helps for bug 1370 and also the  
file you sent in when starting this thread.)

Nevertheless I fully agree, that it might be a good idea to give the  
developer some way to assist the compiler in "choosing the most  
sppropriate implementation" for a function signature if more  
implementations are available.
At present state, it is tricky (although possible) to "inherit" the  
desired functions.

Best regards,
Christian



More information about the Aldor-l mailing list