% File : crossbar.pl % Author : Neng-Fa ZHOU % Date : 1994 top:- cross(List), write(List),nl. go:- statistics(runtime,[Start|_]), top, statistics(runtime,[End|_]), T is End-Start, write('%execution time ='), write(T), write(' milliseconds'),nl. cross(List):- List=[V1,V2,V3,V4,V5,V6,V7,V8,V9,V10, V11,V12,V13,V14,V15,V16,V17,V18,V19,V20], List in 0..20, V1 in [2,4,6,7,8,9,10,11,16,18,20], V2 in [2,3,4,8,10,12,17,19,20], V3 in [2,3,4,6,8,9,11,17,18], V4 in [1,3,4,5,6,7,9,10,11,13,18], V5 in [1,5,6,10,12,13,14,17,18,19,20], V6 in [1,3,10,12,15,16,19,20], V7 in [5,8,9,10,17], V8 in [1,2,5,6,7,12,14,15,16,17], V9 in [1,2,3,4,5,7,11,12,13,14,16,17,20], V10 in [4,5,8,9,10,11,13,17,18,19,20], V11 in [2,4,6,7,8,10,12,14,17,18,20], V12 in [3,7,8,9,10,13,14,15,18,20], V13 in [2,3,6,7,8,9,11,13,16,20], V14 in [2,3,5,6,8,9,12,13,15,16,17,18], V15 in [2,7,8,10,12,13,14,15,16,17,18,20], V16 in [1,2,6,11,13,16,17,19,20], V17 in [1,3,6,9,13,19], V18 in [1,3,6,7,8,10,13,14,19], V19 in [1,2,3,4,5,6,7,9,11,12,14,16,17,19,20], V20 in [3,5,6,7,8,9,11,12,13,14,16,18,20], alldifferent(List), labeling(List).