const n=12. \begin{verbatim} const b=5. num(1..n). box(1..b). not_in(X,B) :- num(X), box(B), box(BB), not eq(B, BB), in(X,BB). in(X,B) :- num(X), box(B), not not_in(X,B). :- num(X), box(B), in(X,B), in(X+X, B). :- num(X), num(Y), box(B), in(X,B), in(Y,B), in(X+Y, B). hide not_in(X,Y). hide num(X). hide box(Y). \end{verbatim}