CLP(FD) and the Minimize labeling option

From: Luca Torella <>
Date: Tue, 24 Nov 2009 10:38:04 +0100

I'm new to the list and I'm developing a program in Curry using CLP(FD).
This program will predict the shape of a protein. Actually it's a simplified
version which only uses two dimensions. Anyway, this is the main function:
pf :: [AminoAcid] -> [Int] -> Success
pf primary tertiary = constrain primary tertiary energy &
                    labeling [FirstFail, Minimize energy] tertiary
                        where energy free*

Shortly, the first parameter is the string of amino acids; the function *
constrain* will call the function *domain* and then it will apply several
constraints. Then there is the labeling part. It's worth noting that between
all the possible shapes, the protein will fold in the one which uses less
energy, that's why in the labeling function I'm minimizing the energy.
Calling, for instance, "*pf [list_of_amino_acids] xs where xs free*" the
user should get a list which contain the coordinates of the amino acids in a
2D space (so the second list will be the double of the first).

Ok, now that I've explained what I'm doing, I'll explain my issue.
Calling for example:

*pf [H,H,H,H,H,H,H,H,H,H] tertiary where tertiary free*

I will get the following error, which I can't understand...
! 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?

Thanks in advance for your help!

Luca Torella

curry mailing list
Received on Di Nov 24 2009 - 14:22:37 CET

This archive was generated by hypermail 2.3.0 : Do Dez 12 2019 - 07:15:09 CET