import CLPFD -- send more money puzzle in Curry with FD constraints: -- "send more money" puzzle in Curry with FD constraints: -- The argument xs is a list of variables representing the letters. smm xs = xs =:= [s,e,n,d,m,o,r,y] & -- define the letters of the puzzle domain xs 0 9 & -- define the domain of the letters s ># 0 & -- set up all constraints m ># 0 & allDifferent xs & 1000 *# s +# 100 *# e +# 10 *# n +# d +# 1000 *# m +# 100 *# o +# 10 *# r +# e =# 10000 *# m +# 1000 *# o +# 100 *# n +# 10 *# e +# y & labeling [] xs -- enumerate values for the letters where s,e,n,d,m,o,r,y free -- smm [s,e,n,d,m,o,r,y] where s,e,n,d,m,o,r,y free