Re: [eclipse-clp-users] eplex: Unable to linearise / type error

From: Joachim Schimpf <jschimpf_at_...127...>
Date: Thu, 11 Sep 2008 00:27:29 +0100
Kish Shen wrote:
> Ulrich Scholz wrote:
>> Dear all,
>>
>> I try to write a CP problem with the eplex constraint solver.  Below you
>> find my code.
>>
>> I use decision variables to select one of a list of values.  On the call
>>
>>   :- generateSubcomponents(3, S). 
>>
>> I get the following error:
>>
>> Eplex warning: Unable to linearise my_instance : Utility =:= [3, 1, 6] * [_184, _186, _188]
>> type error in eplex : (my_instance : Utility =:= [3, 1, 6] * [_184, _186, _188])
>> Abort
>>
...
>>     
>>     my_instance: Utility $= Utilities * DVs,
>>     
>>     Subcomponent = [Utility, DVs, Utilities].
>> --------------
>>
> Hi,
> 
> You are not using the correct syntax -- you cannot simply use lists in 
> expression.


Actually, the List*List syntax is legal in lib(eplex) and lib(ic).
The problem is the relative precedence of the : and the $= operator.
The : binds stronger than the $=, so you have to add parentheses like

  my_instance:(Utility $= Utilities * DVs)


Cheers,
-- Joachim
Received on Wed Sep 10 2008 - 16:28:26 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 16 2024 - 09:13:20 CEST