% problem-set/puzzles/miscell/steamroller.ver1.clauses
% created : 07/07/88
% revised : 07/07/88

% description:
%
% This run solves a puzzle called "Schubert's Steamroller" using
% hyper-resolution.
%
%                 Schubert's Steamroller Puzzle
%
%     Wolves, foxes, birds, caterpillars, and snails are animals,
%         and there are some of each of them.
%     Also, there are some grains, and grains are plants.
%     Every animal either likes to eat all plants or all animals
%         much smaller than itself that like to eat some plants.
%     Caterpillars and snails are much smaller than birds, which
%         are much are much smaller than foxes, which in turn are
%         much smaller than wolves.
%     Wolves do not like to eat foxes or grains, while birds like
%         to eat caterpillars, but not snails.
%     Caterpillars and snails like to eat some plants.
%     Show that there is an animal that likes to eat a grain-
%     eating animal.

% representation:
%
% declare_predicates(1,[WOLF,ANIMAL,FOX,BIRD,SNAIL,CATERPILLAR]).
% declare_predicates(1,[PLANT,GRAIN]).
% declare_function(2,f3).
% declare_functions(1,[p1,p2]).
% declare_predicates(2,[EATS,SMALLER]).
% declare_constants([maggie,lupo,foxy,stalky,tweety,slimey]).
% declare_variables([x,y,x1,x2,x3,x4]).

-WOLF(x1) | ANIMAL(x1).
-FOX(x1) | ANIMAL(x1).
-BIRD(x1) | ANIMAL(x1).
-CATERPILLAR(x1) | ANIMAL(x1).
-SNAIL(x1) | ANIMAL(x1).
-GRAIN(x1) | PLANT(x1).
-ANIMAL(x1) | -PLANT(x2) | -ANIMAL(x3) | -SMALLER(x3,x1) | -PLANT(x4) | -EATS(x3,x4) | EATS(x1,x2) | EATS(x1,x3).
-CATERPILLAR(x1) | -BIRD(x2) | SMALLER(x1,x2).
-SNAIL(x1) | -BIRD(x2) | SMALLER(x1,x2).
-BIRD(x1) | -FOX(x2) | SMALLER(x1,x2).
-FOX(x1) | -WOLF(x2) | SMALLER(x1,x2).
-BIRD(x1) | -CATERPILLAR(x2) | EATS(x1,x2).
-CATERPILLAR(x1) | PLANT(p1(x1)).
-CATERPILLAR(x1) | EATS(x1,p1(x1)).
-SNAIL(x1) | PLANT(p2(x1)).
-SNAIL(x1) | EATS(x1,p2(x1)).
-WOLF(x1) | -FOX(x2) | -EATS(x1,x2).
-WOLF(x1) | -GRAIN(x2) | -EATS(x1,x2).
-BIRD(x1) | -SNAIL(x2) | -EATS(x1,x2).
-ANIMAL(x) | -ANIMAL(y) | -EATS(x,y) | GRAIN(f3(y,x)).
-ANIMAL(x) | -ANIMAL(y) | -EATS(x,y) | -EATS(y,f3(y,x)).
WOLF(Lupo).
FOX(Foxy).
BIRD(Tweety).
CATERPILLAR(Maggie).
SNAIL(Slimey).
GRAIN(Stalky).
