= Solution
Use one <variable> $X_{r,c}$ for each cell, with $1\le r,c\le9$. An empty cell has <constraint domain> $\{1,\ldots,9\}$; a clue containing $d$ has singleton <constraint domain> $\{d\}$. Thus all clues are retained automatically.
For every row $r$ impose $\operatorname{AllDifferent}(X_{r,1},\ldots,X_{r,9})$, and for every column $c$ impose $\operatorname{AllDifferent}(X_{1,c},\ldots,X_{9,c})$. For each $a,b\in\{0,1,2\}$ impose an <all-different constraint> on
$$
\{X_{3a+i,3b+j}:1\le i,j\le3\}.
$$
These are the nine prescribed boxes. There are 27 <all-different constraints> altogether. Nine pairwise distinct values chosen from a <set> of nine values must use every value exactly once, so these restrictions are precisely the <Sudoku> requirements. Equivalently, expand each <all-different constraint> into pairwise <binary constraints> $X_{r,c}\ne X_{r',c'}$ for cells sharing a row, column, or box.
$$
\boxed{81\text{ variables, clue-restricted domains, and }27\text{ all-different constraints}.}
$$
Back to article page