Saturday 15 January 2011

clpfd - Sicstus prolog: labeling a list in a list -


It's been a long time since I'm dealing with labeling problems in Sicstus prolog. I want to create an array of 7 , Where each item is again an array of 4 integers I tried the following code, but it does not work and gives an instant error.

 : - use_module (library (CLPFD)). Schedule (SS): - Length (SS, 7), SS = [[A, B, C, D] | T], Hull_din (SS), labeling ([], SS). Solve_days ([]). Solution_daily ([[A, B, C, D] | T]): - A in 1..3, B. in 4.7, C 7..9, in C. 6, .   

Can someone advise me how to solve them? Thanks a lot!

The reasoning for labeling should be a plain list. One way to fix this is to use Append / 3 to level A / D and T, for example Annex ([A, B, C, D], T, Wars) .

No comments:

Post a Comment