1 2 3 4 5 6 7 8
shaves(X, Y) :- barber(X), villager(Y), not shaves(Y, Y). villager(a). barber(b). villager(b) ; -villager(b). query :- not shaves(b, b).