/* -------------------------------------------------------------- * "Agatha Christie" Problem -- facts & rules but no solution * Who was the killer? * * Alice, her husband, son, daughter, * and brother are involved in a murder. * One of the five killed one of the other * four. * * 1. A man and a woman were together in the bar * at the time of the murder. * 2. The victim and the killer were together * on the beach at the time of the murder. * 3. One of the children was alone at the * time of the murder. * 4. Alice and her husband were not together * at the time of the murder. * 5. The victim's twin was innocent. * 6. The killer was younger than the victim. *----------------------------------------------------------------------*/ /*----- Facts -----*/ person(alice). person(husband). person(son). person(daughter). person(brother). child(son). child(daughter). male(husband). male(son). male(brother). female(alice). female(daughter). twin(alice, brother). twin(brother, alice). twin(son, daughter). twin(daughter, son). /*----- Rules -----*/ istwin(X) :- twin(X, _). older(alice, son). older(alice, daughter). older(husband, son). older(husband, daughter). inbar(M, N) :- person(M), person(N), male(M), female(N). together(S, T) :- S=alice, T=husband. together(S, T) :- T=alice, S=husband. alone(P) :- person(P), child(P).