Delayed goals

From: Tom Crowley <>
Date: Wed 16 Feb 2005 01:19:24 PM GMT
Message-ID: <000c01c5142a$223e5720$1c00000a@crowleydesktop>
Can you give me some advice on the following....?

:- use_module(library(fd)).
:- use_module(library(lists)).

roman(N, Solns) :-
     dim(Square, [N,N]),
     Square[1..N,1..N] :: 1..N,
     (for(I,1,N), param(Square,N) do
         Row is Square[I,1..N],
         Col is Square[1..N,I],
     Vars is Square[1..N,1..N],
     flatten(Vars, List),
     findall(_, labeling(List), As),
     length(As, Solns).

My program above solves the general problem of roman squares and produces the correct answer for all tested 1..5 size squares. However, when run Eclipse also indicates 'There are [X] delayed goals', where X is proportional to  the size of the square. I tried labeling results individually but these appear blank.

I have printed out Square, Row, Col, Vars and List as each is created and all seem to be working over the same uninstantiated variables, which coupled  with the fact that the solutions returned are correct indicate that the constraints are working as intended. Is there any reason why the constraints are being adhered to but remain delayed after all solutions have been found?


Received on Wed Feb 16 13:44:49 2005

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:33 PM GMT GMT