Solving Einstein Riddle in Prolog
问题 I am trying to solve Einstein Riddle in Prolog. I am having a difficulty with the program I wrote, the basic method was to add all constraints and let Prolog figure out the only possible solutions. The problem is that Prolog finds 0 solutions. I have isolated the constraint that makes the program go from a given solution to no solutions, but I don't understand why. /*There are five houses*/ exists(A, list(A,_,_,_,_)). exists(A, list(_,A,_,_,_)). exists(A, list(_,_,A,_,_)). exists(A, list(_,_,