% For testing the BLOCKS_WORLD

% Load domain description
:- include 'bw-simple.cc'.

% Basic test to see if valid states exist
:- query
maxstep :: 0;
label :: 0.

% Basic test to see if a valid transition exists
:- query
maxstep :: 1;
label :: 1.

% Look for a plan to reverse the order
% of blocks in a tower
:- query
maxstep :: 0..10;
label :: 2;
0: support(b(1))=b(2),
   support(b(2))=b(3),
   support(b(3))=table;
maxstep: support(b(1))=table,
   support(b(2))=b(1),
   support(b(3))=b(2).

% Slightly more complicated than the previous query:
% Look for a plan to make a different tower.
:- query
maxstep :: 0..10;
label :: 3;
0: support(b(1))=b(2),
   support(b(2))=b(3),
   support(b(3))=table;
maxstep: support(b(2))=table,
   support(b(3))=b(2),
   support(b(1))=b(3).

% To check that the robot cannot pick up a block that is
% under another.
:- query
maxstep :: 1;
label :: 4;
0: support(b(1))=b(2),
   support(b(2))=b(3),
   support(b(3))=table;
% The following line makes solver grasp segfault, use mchaff
0: puton(b(2),table).

