% Knight Noraml or Spy % Three people: A,B,C, one spy, one knight, one normal % spies lie, knights speak the truth, normals do both perm([],[]). perm(X,[Y|Z]):-select(X,Y,R),perm(R,Z). says(k,P):- P. says(s,P):- not P. says(n,_). problem(People):- People=[A,B,C], perm(People, [k,n,s]), says(A, C\=s), says(B, A\=k), says(C, B=k).