%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%					%
% Artificial Intelligence Project	%
% Fall 1999				%
%					%
% by Margit Lang			%
% 					%
%                                    	%
%                                    	%
% Domain and Actions for Blockworld    	%
%					%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%initial state

%domain attributes are: 

% for the blocksworld:

%	on(X,Y) -> thing X is on thing Y
%	clear(X) -> there is nothing on thing X
%	block(X) -> X is a block
%	slot(X) -> X is a slot

%
% Blockworld=[on(a,a1),on(b,a),clear(b),clear(a2),on(c,a3),clear(c)].

%
%	b
%	a		c
%	__	__	__
%	a1	a2	a3

%To start the planning: plan(+Blockworld,+Goal,-Plan,-Endstate)

%Goal1=[on(a,c)].
%Goal2=[on(c,a)].

block(a).
block(b).
block(c).
slot(a1).
slot(a2).
slot(a3).


%1) move(What,From,To) :- moves What from the place From to To 
	can(move(What,From,To), [on(What,From), clear(What), clear(To)]):- block(What),
							What\==From,
							What\==To,
							From\==To. 
	add(move(What,From,To),[on(What,To),clear(From)]):- From\== To,From \== What,What\== To. 
	del(move(What,From,To),[on(What,From), clear(To)]):- From\== To,From \== What,What\== To. 


