/* http://www.cs.kuleuven.be/~dtai/events/ASP-competition/Benchmarks/GolombRuler.shtml Program taken from PRACTICAL CONSTRAINTS: A TUTORIAL ON MODELLING WITH CONSTRAINTS, by ROMAN BARTÁK */ :-include(base). :-include(lib_bp). solve(As):- get_largest_atom(As,mark(M)), get_largest_atom(As,position(P)), Sol = [0|_], ruler(M,-1,P,Sol), last(Sol,XM), distances(Sol,1,M,XM,Dist), all_different(Dist), (Dist=[DF,_|_] -> last(Dist,DL), DF#
0, PrevX#