% A simplest version of map colouring 

% n( X, Y )  - X, Y can be colours of neighbouring countries

n( C1, C2 ) :- d_c( C1, C2 ).
n( C1, C2 ) :- d_c( C2, C1 ).

d_c( red, green ).
d_c( red, blue ).
d_c( blue, green ).

/* Example queries

  n( S, N ), n( S, SF ), n( N, SF ), n( O, N ), n( O, S ), n( O, SF ).
  Fails when 3 colours.

  n( S, N ), n( S, SF ), n( N, SF ), n( O, N ), n( O, S ), S=green,
  write( (N, S, SF, O) ), nl, fail.
  Two answers
*/
