Search code examples
prologeclipse-clp

instantiation fault in indomain


I have a board solver which its general form of the solver likes the below:

solver(Board):-
    constraints(Board),
    search(Board).

It passes the constraint predicate, but there is an error in the search part which comes in the below:

search(Board):-
    term_variables(Board,Vars),
    sd:labeling(Vars).

The error occurs in the labeling predicate , and the error is:

instantiation fault in indomain(_258{[9 .. 13, 15 .. 20]})

So what is the problem? (I can't see inany problem in the indomain predicate).


Solution

  • As mentioned by @jschimpf in the comment, the vital point here is mixing features of two libraries might not be possible. Hence, the safe code is promoted to use the same features of the same library as it is possible. The same thing happens here. constraint(Board) using the #= (as an integer suspension) from the ic library, but in the labeling, the code tries using the sc library. That is the origin of the problem.

    You should notice that it could be one reason for this bug message.