From tmgisi at gmx.at  Tue Dec  6 07:29:56 2005
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Tue, 06 Dec 2005 13:29:56 +0100
Subject: [Aldor-l] Bug: max of OrderedVariableList
Message-ID: <op.s1c3nojr3adhhr@mail.gmx.at>

Hello,

I just filed a bug about the function max of OrderedVariableList. max  
effectively gives the minimum of two elements not the maximum.

The attached file demostrates the bug.

The 1.0.2 Aldor compiler has been used along with the shipped aldor and  
algebra libraries.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: max.as
Type: application/octet-stream
Size: 740 bytes
Desc: not available
Url : http://aldor.org/pipermail/aldor-l_aldor.org/attachments/20051206/a4057739/attachment.obj 

From ralf at hemmecke.de  Tue Dec  6 08:40:15 2005
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 06 Dec 2005 14:40:15 +0100
Subject: [Aldor-l] Bug: max of OrderedVariableList
In-Reply-To: <op.s1c3nojr3adhhr@mail.gmx.at>
References: <op.s1c3nojr3adhhr@mail.gmx.at>
Message-ID: <439594BF.2020105@hemmecke.de>

That clearly is a bug.

The documentation of OrderedVariableList states

    For i,i = 1,...,n   variable i > variable j holds iff i < j holds.

So the order is inversed. The code says...

OrderedVariableList(t:List Symbol): FiniteVariableType with {
} == MachineInteger add {
         Rep == MachineInteger;
         -- WARNING: DO NOT REMOVE ANY OF THE FOUR DEFINITIONS
	(x: %) > (y: %): Boolean == rep x < rep y;
	(x: %) < (y: %): Boolean == rep x > rep y;
	(x: %) >= (y: %): Boolean == rep x <= rep y;
	(x: %) <= (y: %): Boolean == rep x >= rep y;
         ...
}

but does not redefine the max: (%,%) -> % and min: (%,%)->% functions. 
Thus these functions are inherited from MachineInteger and are thus not 
conforming the documentation.

Marc, that is your code, will you do the fix?

Ralf

Christian Aistleitner wrote:
> Hello,
> 
> I just filed a bug about the function max of OrderedVariableList. max 
> effectively gives the minimum of two elements not the maximum.
> 
> The attached file demostrates the bug.
> 
> The 1.0.2 Aldor compiler has been used along with the shipped aldor and 
> algebra libraries.


From tmgisi at gmx.at  Tue Dec  6 07:29:56 2005
From: tmgisi at gmx.at (Christian Aistleitner)
Date: Tue, 06 Dec 2005 13:29:56 +0100
Subject: [Aldor-l] Bug: max of OrderedVariableList
Message-ID: <op.s1c3nojr3adhhr@mail.gmx.at>

Hello,

I just filed a bug about the function max of OrderedVariableList. max  
effectively gives the minimum of two elements not the maximum.

The attached file demostrates the bug.

The 1.0.2 Aldor compiler has been used along with the shipped aldor and  
algebra libraries.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: max.as
Type: application/octet-stream
Size: 740 bytes
Desc: not available
URL: <http://mail.aldor.org/pipermail/aldor-l_aldor.org/attachments/20051206/a4057739/attachment-0001.obj>

From ralf at hemmecke.de  Tue Dec  6 08:40:15 2005
From: ralf at hemmecke.de (Ralf Hemmecke)
Date: Tue, 06 Dec 2005 14:40:15 +0100
Subject: [Aldor-l] Bug: max of OrderedVariableList
In-Reply-To: <op.s1c3nojr3adhhr@mail.gmx.at>
References: <op.s1c3nojr3adhhr@mail.gmx.at>
Message-ID: <439594BF.2020105@hemmecke.de>

That clearly is a bug.

The documentation of OrderedVariableList states

    For i,i = 1,...,n   variable i > variable j holds iff i < j holds.

So the order is inversed. The code says...

OrderedVariableList(t:List Symbol): FiniteVariableType with {
} == MachineInteger add {
         Rep == MachineInteger;
         -- WARNING: DO NOT REMOVE ANY OF THE FOUR DEFINITIONS
	(x: %) > (y: %): Boolean == rep x < rep y;
	(x: %) < (y: %): Boolean == rep x > rep y;
	(x: %) >= (y: %): Boolean == rep x <= rep y;
	(x: %) <= (y: %): Boolean == rep x >= rep y;
         ...
}

but does not redefine the max: (%,%) -> % and min: (%,%)->% functions. 
Thus these functions are inherited from MachineInteger and are thus not 
conforming the documentation.

Marc, that is your code, will you do the fix?

Ralf

Christian Aistleitner wrote:
> Hello,
> 
> I just filed a bug about the function max of OrderedVariableList. max 
> effectively gives the minimum of two elements not the maximum.
> 
> The attached file demostrates the bug.
> 
> The 1.0.2 Aldor compiler has been used along with the shipped aldor and 
> algebra libraries.


