Add houses (aka zebra) puzzle example
use length/2 for a shorter and less error-prone solution
correct next/3

We cannot arbitrarily interpret "next to" and "near" as "to the right
of", because simply exchanging the first two arguments of next/3 might
yield no solution in that case.

However, there are now several possible arrangements of houses:

   ?- houses(Solution).
   %@ Solution = [h(norwegian, fox, kool, water, yellow), h(ukrainian, horse, chesterfield, tea, blue), h(english, snake, winston, milk, red), h(spanish, dog, lucky, juice, white), h(japonese, zebra, kent, coffee, green)] ;
   %@ Solution = [h(norwegian, fox, kool, water, yellow), h(ukrainian, horse, chesterfield, tea, blue), h(english, snake, winston, milk, red), h(japonese, zebra, kent, coffee, green), h(spanish, dog, lucky, juice, white)] ;
   %@ false.

The questions that are asked can still be answered satisfactorily:

   ?- setof(N, Hs^S^D^C^(houses(Hs),member(h(N,zebra,S,D,C), Hs)), Sols).
   %@ Sols = [japonese].

   ?- setof(N, Hs^A^S^C^(houses(Hs),member(h(N,A,S,water,C), Hs)), Sols).
   %@ Sols = [norwegian].
follow the conventions of the other examples

Lists are named with an "s" at the end, and a blank separates predicate
arguments.
remove determinism declaration

A priori, we do not know how many solutions there are. There might be none.

It turns out that houses/1 is an fact multi.

det would be: zebra_owner__tea_drinker/2, using setof/3 to reason over
all possible house arrangements.
explanation, layout and spacing
restore tabification
clarify houses/1 and add example queries

These queries illustrate a central point of the puzzle: While there is more
than one possible arrangement of houses that satisfies all hints, the
answers to the questions are unique. Therefore, the puzzle is still well-posed.
Updated ignore file
Fixed merge