Re: CLP(FD) and the Minimize labeling option

From: Michael Hanus <mh_at_informatik.uni-kiel.de>
Date: Tue, 24 Nov 2009 23:27:59 +0100

Luca Torella wrote:
> I will get the following error, which I can't understand...
> *
> ERROR:
> ! Instantiation error in argument 1 of user:labeling/2
> ! goal: labeling(user:[ff,minimize(_5959)],[10,10,10,11,9,11,8,11,7|...])*
>
> It says that the first parameter of the function *labeling* is wrong, but I
> can't figure out why. Does anyone see something that I'm not seeing?

I must admit that this error message (which is raised from the
underlying SICStus Prolog system) is not helpful.

Anyway, I see a problem: it seems that you have only constrained
your variables but have not provided the domain of them.
Without a domain having lower and upper bounds, the minimization
(based on a branch-and-bound algorithm) can't work.
Consider the following short protocol of PAKCS:

CLPFD> x =# y & labeling [FirstFail, Minimize x] [x,y]
Free variables in goal: x, y
ERROR: instantiation_error(labeling(user:[ff,minimize(_4365)],[_4365,_4365]),2)
CLPFD> domain [x,y] 1 3 & x =# y & labeling [FirstFail, Minimize x] [x,y]
Free variables in goal: x, y
Result: success
Bindings:
x=1
y=1

So, you should put a "domain" constraint at the beginning
(see also the CLPFD documentation and further examples shipped
with PAKCS).

I hope this helps.

Best regards,

Michael
_______________________________________________
curry mailing list
curry_at_lists.RWTH-Aachen.DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/curry
Received on Di Nov 24 2009 - 23:29:56 CET

This archive was generated by hypermail 2.3.0 : Do Jun 20 2024 - 07:15:10 CEST