asp4.lp 411 B

12345678910111213141516
  1. % Possibilities
  2. suspect(ms_scarlet; colonel_mustard).
  3. weapon(revolver; candle).
  4. place(kitchen; hall; dining_room).
  5. % One possibility only
  6. 1{murderer(X) : suspect(X)}1.
  7. 1{weapon_of_crime(X) : weapon(X)}1.
  8. 1{place_of_crime(X) : place(X)}1.
  9. % Card deduction
  10. :- place_of_crime(kitchen).
  11. place_of_crime(hall) :- murderer(colonel_mustard), not weapon_of_crime(revolver).
  12. weapon_of_crime(candle).
  13. #show murderer/1.