% File 'bw-serializable-test'
% Two queries in the blocks world with blocks a,b,c,d

:- include 'bw-serializable'.

:- objects
  a,b,c,d			:: block.

:- query

% Find the result of moving block a to the table in the state
%
%    a   c   
%    b   d   
%  --------- 

 label   :: 1;
 maxstep :: 1;

 anyFluentValues;
 constraint 0:
  loc(a)=b,
  loc(b)=table,
  loc(c)=d,
  loc(d)=table;

 cwaActions;
 constraint 0:
  move(a),
  destination(a)=table.

:- query

% Find a 2-step plan:
%
% initial condition       goal
%
%    a   c                b   d    
%    b   d                a   c
%  ---------            ---------

 label   :: 2;
 maxstep :: 2;

 anyHistory;
 constraint 0:
  loc(a)=b,
  loc(b)=table,
  loc(c)=d,
  loc(d)=table;
 constraint maxstep:
  loc(a)=table,
  loc(b)=a,
  loc(c)=table,
  loc(d)=c.






