% P4

block(b0).
block(b1).
block(b2).
block(b3).
block(b4).
block(b5).
block(b6).
block(b7).
block(b8).
block(b9).
block(b10).

% planning problem

% initial state:

%   10 8
% 2 9  7
% 1 4  6 
% 0 3  5
%-------

on(b0 ,table,0).
on(b3 ,table,0).
on(b5 ,table,0).
on(b1 ,b0   ,0).
on(b2 ,b1   ,0).
on(b4 ,b3   ,0).
on(b9 ,b4   ,0).
on(b10,b9   ,0).
on(b6 ,b5   ,0).
on(b7 ,b6   ,0).
on(b8 ,b7   ,0).

% goal state: 

%     1
%     2
% 0 7 10
% 4 8 6
% 9 3 5 
%-----

:- not on(b9 , table, #maxint).
:- not on(b3 , table, #maxint).
:- not on(b5 , table, #maxint).
:- not on(b4 , b9   , #maxint).
:- not on(b0 , b4   , #maxint).
:- not on(b8 , b3   , #maxint).
:- not on(b7 , b8   , #maxint).
:- not on(b6 , b5   , #maxint).
:- not on(b10, b6   , #maxint).
:- not on(b2 , b10  , #maxint).
:- not on(b1 , b2   , #maxint).
