The problem modelling code must:
A simple example is the “crypt-arithmetic” puzzle,
SEND+MORE = MONEY
.
The idea is to associate a digit (0-9) with each letter so that the
equation is true. The ECLiPSe code is as follows:
:- lib(ic). sendmore(Digits) :- Digits = [S,E,N,D,M,O,R,Y], % Assign a finite domain with each letter - S, E, N, D, M, O, R, Y - % in the list Digits Digits :: [0..9], % Constraints alldifferent(Digits), S # |