% English  : Someone who lives in Dreadbury Mansion killed Aunt Agatha. 
%            Agatha, the butler, and Charles live in Dreadbury Mansion, 
%            and are the only people who live therein. A killer always 
%            hates his victim, and is never richer than his victim. 
%            Charles hates no one that Aunt Agatha hates. Agatha hates 
%            everyone except the butler. The butler hates everyone not 
%            richer than Aunt Agatha. The butler hates everyone Aunt 
%            Agatha hates. No one hates everyone. Agatha is not the 
%            butler. Therefore : Agatha killed herself.

set(prolog_style_variables).
set(auto).
clear(print_given).

list(usable).

% agatha, hypothesis.
 lives(agatha).

% butler, hypothesis.
 lives(butler).

% charles, hypothesis.
 lives(charles).

% poorer_killer, hypothesis.
-killed(X,Y) |
-richer(X,Y).

% different_hates, hypothesis.
-hates(agatha,X) |
-hates(charles,X).

% no_one_hates_everyone, hypothesis.
-hates(X,agatha) |
-hates(X,butler) |
-hates(X,charles).

% agatha_hates_agatha, hypothesis.
 hates(agatha,agatha).

% agatha_hates_charles, hypothesis.
 hates(agatha,charles).

% killer_hates_victim, hypothesis.
-killed(X,Y) |
 hates(X,Y).

% same_hates, hypothesis.
-hates(agatha,X) |
 hates(butler,X).

% butler_hates_poor, hypothesis.
-lives(X) |
 richer(X,agatha) |
 hates(butler,X).

% prove_neither_charles_nor_butler_did_it, negated_conjecture.
 killed(butler,agatha) |
 killed(charles,agatha).

end_of_list.

