Explainable Artificial Intelligence (XAI) for all_distinct/1

How would one write a “why” component for
SWI-Prolog CLP(FD) all_distinct/1 global constraint?
Maybe visualize the conflict in a GUI?

Here is a striking example, Peter Norvig’s impossible Sudoku,
which he claims took him 1439 seconds (ca. 24 minutes)
to show that it is unsolvable:

/* Peter Norvig */
problem(9, [[_,_,_,_,_,5,_,8,_],

Solving Every Sudoku Puzzle

whereby SWI-Prolog with all_distinct/1 does
it in a blink, even without labeling:

?- problem(9, M), time(sudoku(M)).
% 316,054 inferences, 0.016 CPU in 0.020 seconds

A.9.7 Example: Sudoku

Pretty cool!

1 Like

Now I have the feeling there are no difficult 9x9 Sudokus for the
computer. At least not for computers running SWI-Prolog and
using CLP(FD) with the global constraint all_distinct/1.

I was fishing among the 17-clue Sudokus, and the hardest
I could find so far was this one:

/* Gordon Royle #3668 */

But SWI-Prolog still does it in around 3 seconds. SWI-Prolog
does other 17-clue Sudokus in less than 100ms.

Are there any 17-clue Sudokus that take more time?