/* Crossbar problem Picat. Prolog/FD benchmark problem (crossbar.pl in B Prolog) Model created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import cp. main => go. go => N = 20, List= [V1,V2,V3,V4,V5,V6,V7,V8,V9,V10, V11,V12,V13,V14,V15,V16,V17,V18,V19,V20], List :: 0..N, V1 :: [2,4,6,7,8,9,10,11,16,18,20], V2 :: [2,3,4,8,10,12,17,19,20], V3 :: [2,3,4,6,8,9,11,17,18], V4 :: [1,3,4,5,6,7,9,10,11,13,18], V5 :: [1,5,6,10,12,13,14,17,18,19,20], V6 :: [1,3,10,12,15,16,19,20], V7 :: [5,8,9,10,17], V8 :: [1,2,5,6,7,12,14,15,16,17], V9 :: [1,2,3,4,5,7,11,12,13,14,16,17,20], V10 :: [4,5,8,9,10,11,13,17,18,19,20], V11 :: [2,4,6,7,8,10,12,14,17,18,20], V12 :: [3,7,8,9,10,13,14,15,18,20], V13 :: [2,3,6,7,8,9,11,13,16,20], V14 :: [2,3,5,6,8,9,12,13,15,16,17,18], V15 :: [2,7,8,10,12,13,14,15,16,17,18,20], V16 :: [1,2,6,11,13,16,17,19,20], V17 :: [1,3,6,9,13,19], V18 :: [1,3,6,7,8,10,13,14,19], V19 :: [1,2,3,4,5,6,7,9,11,12,14,16,17,19,20], V20 :: [3,5,6,7,8,9,11,12,13,14,16,18,20], all_different(List), solve(List), writeln(List), nl.