I am new to Prolog and was using it to solve a cryptarithmetic problem CROSS+ROADS = DANGER .However when the code is run ,there is no output can anybody tell me what is wrong with the program? I will be very thankful.
Code:
:- use_module(library(clpfd)).
cr_puzzle([C,R,O,S,S] + [R,O,A,D,S] = [D,A,N,G,E,R]) :-
Puzzle = [ C,R ,O ,S ,A ,D, N ,G, E],
Puzzle ins 0..9,
all_different(Puzzle),
labeling([],Puzzle),
C*10000+R*1000+O*100+S*10+S+
R*10000+O*1000+A*100+D*10+S #=
D*100000 + A*10000+N*1000+G*100+E*10+R,
C #\=0,R #\=0.
I am using SWI-Prolog