% problem-set/puzzles/carroll/animals.ver1.clauses
% created : 07/14/88
% revised : 07/14/88

% description:
%
% This run solves a puzzle called "The Animals" by Lewis Carroll
% using UR-resolution.
%
%                       The Animals
%
%    (1)  The only animals in this house are cats.
%    (2)  Every animal is suitable for a pet, that loves  to
%         gaze at the moon.
%    (3)  When I detest an animal, I avoid it.
%    (4)  No animals are carnivorous, unless they  prowl  at
%         night.
%    (5)  No cat fails to kill mice.
%    (6)  No animals ever take to me,  except  what  are  in
%         this house.
%    (7)  Kangaroos are not suitable for pets.
%    (8)  None but carnivora kill mice.
%    (9)  I detest animals that do not take to me.
%    (10) Animals that prowl at night always love to gaze at
%         the moon.
%    The problem is to prove that "I  always  avoid  a  kan-
%    garoo".
%                                        - Lewis Carroll


% representation:
% 
% declare_predicates(1,[INHOUSE,CAT,GAZER,SUITABLEPET,DETESTED,AVOIDED])
% declare_predicates(1,[CARNIVORE,PROWLER,MOUSEKILLER,TAKESTOME,KANGAROO])
% declare_constant(f1).   
% declare_variable(X).
% 
% Declarative version,  created by E. Lusk    
% PREDICATES : CAT(x) = x is a cat.
%    INHOUSE(x) = x is an animal in the house.
%    SUITABLEPET= an animal suitable for a pet.
%    PROWLER= animals who prowl at night.

set(binary_res).
set(prolog_style_variables).

list(axioms).

-inhouse(X) | cat(X).
-gazer(X) | suitablepet(X).
-detested(X) | avoided(X). 
-carnivore(X) | prowler(X).
-cat(X) | mousekiller(X).
-takestome(X) | inhouse(X).

-kangaroo(X) | -suitablepet(X). 
-mousekiller(X) | carnivore(X).
takestome(X) | detested(X).
-prowler(X) | gazer(X). 

end_of_list.

list(sos).

kangaroo(f1).
-avoided(f1).
 
end_of_list.
