To use Grace on this program, we have to load the Grace library and to insert calls to Grace predicates into the program source, resulting in queensg.pl:
:- lib(grace). % Grace queens(N, List) :- grace_start(queens), % Grace % Define variables and their domains length(List, N), List :: 1..N, grace_matrix(List, queens), % Grace % Constraints %2 alldistinct(List), %3 constrain_queens(List), % Label the variables grace_label. % Grace
When we now call queens(8, L), we will see the following happen: