
c(red).
c(green).
c(blue).
c(yellow).

diff(X,Y) :-
    c(X),
    c(Y),
    X \= Y.

color(Myanmar,Thailand,Cambodia,Vietnam,Laos) :-
    diff(Myanmar,Thailand),
    diff(Myanmar,Laos),
    diff(Thailand,Laos),
    diff(Thailand,Cambodia),
    diff(Laos,Cambodia),
    diff(Laos,Vietnam),
    diff(Cambodia,Vietnam).


color(Myanmar,Thailand,Cambodia,Vietnam,Laos,China) :-
    diff(Myanmar,China),
    diff(Myanmar,Thailand),
    diff(Myanmar,Laos),
    diff(Thailand,Laos),
    diff(Thailand,Cambodia),
    diff(Laos,Cambodia),
    diff(Laos,Vietnam),
    diff(Laos,China),
    diff(Cambodia,Vietnam),
    diff(Vietnam,China).

