caparol6991

Untitled

Jan 12th, 2020
791
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :- use_module(library(clpfd)).
  2.  
  3. knife(Sol) :-
  4.    Vars = [K,N,I,F,E,O,R,S,P,U],
  5.    Vars ins 0..9,
  6.    Sol = sol(k:K,n:N,i:I,f:F,e:E,o:O,r:R,s:S,p:P,u:U),
  7.    all_different(Vars),
  8.    K #\=0, F #\= 0, S #\=0,
  9.    K*10000 + N*1000 + I*100 + F*10 + E +
  10.              F*1000 + O*100 + R*10 + K +
  11.    S*10000 + P*1000 + O*100 + O*10 + N +
  12.              S*1000 + O*100 + U*10 + P #=
  13.    S*100000 + U*10000 + P*1000 + P*100 + E*10 + R,
  14.    labeling([ff],Vars).
RAW Paste Data