% problem-set/puzzles/space_state/mission.ver2.in
% created : 07/09/86.
% revised : 07/13/88.

% description:
%
% This run solves "The Missionaries and Cannibals Puzzle" using
% hyper-resolution.
%
%           The Missionaries and Cannibals Puzzle
%
%    There are three missionaries and three cannibals on the west
%    bank of a river. There is a boat on the east bank. But they
%    have a problem: If on either bank the cannibals ever outnumber
%    the missionaries, the outnumbered will be eaten. Is there a
%    way for the missionaries to get their wish - to get to the
%    east bank without losing anyone?  
%
% representation:
%
% Procedural version
		
set(hyper_res).


list(axioms).

-Config(Left(M(3),C(3)),Right(M(0),C(0)),BoatOnLeft) | 
    Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnRight).
-Config(Left(M(3),C(3)),Right(M(0),C(0)),BoatOnLeft) | 
    Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnRight).

-Config(Left(M(3),C(2)),Right(M(0),C(1)),BoatOnLeft) | 
    Config(Left(M(3),C(0)),Right(M(0),C(3)),BoatOnRight).
-Config(Left(M(3),C(2)),Right(M(0),C(1)),BoatOnLeft) | 
    Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnRight).
-Config(Left(M(3),C(2)),Right(M(0),C(1)),BoatOnLeft) | 
    Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnRight).

-Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnLeft) | 
    Config(Left(M(1),C(1)),Right(M(2),C(2)),BoatOnRight).
-Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnLeft) | 
    Config(Left(M(3),C(0)),Right(M(0),C(3)),BoatOnRight).

-Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnLeft) | 
    Config(Left(M(1),C(1)),Right(M(2),C(2)),BoatOnRight).
-Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnLeft) | 
    Config(Left(M(0),C(2)),Right(M(3),C(1)),BoatOnRight).

-Config(Left(M(1),C(1)),Right(M(2),C(2)),BoatOnLeft) | 
    Config(Left(M(0),C(0)),Right(M(3),C(3)),BoatOnRight).
-Config(Left(M(1),C(1)),Right(M(2),C(2)),BoatOnLeft) | 
    Config(Left(M(0),C(1)),Right(M(3),C(2)),BoatOnRight).

-Config(Left(M(0),C(3)),Right(M(3),C(0)),BoatOnLeft) | 
    Config(Left(M(0),C(1)),Right(M(3),C(2)),BoatOnRight).
-Config(Left(M(0),C(3)),Right(M(3),C(0)),BoatOnLeft) | 
    Config(Left(M(0),C(2)),Right(M(3),C(1)),BoatOnRight).

-Config(Left(M(0),C(2)),Right(M(3),C(1)),BoatOnLeft) | 
    Config(Left(M(0),C(0)),Right(M(3),C(3)),BoatOnRight).
-Config(Left(M(0),C(2)),Right(M(3),C(1)),BoatOnLeft) | 
    Config(Left(M(0),C(1)),Right(M(3),C(2)),BoatOnRight).

-Config(Left(M(0),C(1)),Right(M(3),C(2)),BoatOnLeft) | 
    Config(Left(M(0),C(0)),Right(M(3),C(3)),BoatOnRight).

-Config(Left(M(0),C(1)),Right(M(3),C(2)),BoatOnRight) | 
    Config(Left(M(0),C(3)),Right(M(3),C(0)),BoatOnLeft).
-Config(Left(M(0),C(1)),Right(M(3),C(2)),BoatOnRight) | 
    Config(Left(M(0),C(2)),Right(M(3),C(1)),BoatOnLeft).
-Config(Left(M(0),C(1)),Right(M(3),C(2)),BoatOnRight) | 
    Config(Left(M(1),C(1)),Right(M(2),C(2)),BoatOnLeft).

-Config(Left(M(0),C(2)),Right(M(3),C(1)),BoatOnRight) | 
    Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnLeft).
-Config(Left(M(0),C(2)),Right(M(3),C(1)),BoatOnRight) | 
    Config(Left(M(0),C(3)),Right(M(3),C(0)),BoatOnLeft).

-Config(Left(M(1),C(1)),Right(M(2),C(2)),BoatOnRight) | 
    Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnLeft).
-Config(Left(M(1),C(1)),Right(M(2),C(2)),BoatOnRight) | 
    Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnLeft).

-Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnRight) | 
    Config(Left(M(3),C(3)),Right(M(0),C(0)),BoatOnLeft).
-Config(Left(M(2),C(2)),Right(M(1),C(1)),BoatOnRight) | 
    Config(Left(M(3),C(2)),Right(M(0),C(1)),BoatOnLeft).

-Config(Left(M(3),C(0)),Right(M(0),C(3)),BoatOnRight) | 
    Config(Left(M(3),C(2)),Right(M(0),C(1)),BoatOnLeft).
-Config(Left(M(3),C(0)),Right(M(0),C(3)),BoatOnRight) | 
    Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnLeft).

-Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnRight) | 
    Config(Left(M(3),C(3)),Right(M(0),C(0)),BoatOnLeft).
-Config(Left(M(3),C(1)),Right(M(0),C(2)),BoatOnRight) | 
    Config(Left(M(3),C(2)),Right(M(0),C(1)),BoatOnLeft).

-Config(Left(M(3),C(2)),Right(M(0),C(1)),BoatOnRight) | 
    Config(Left(M(3),C(3)),Right(M(0),C(0)),BoatOnLeft).

end_of_list.


list(sos).

Config(Left(M(3),C(3)),Right(M(0),C(0)),BoatOnLeft).
-Config(Left(M(0),C(0)),Right(M(3),C(3)),BoatOnRight).
 
end_of_list.
