
%  Initial State  

on(b,c,s0). on(c,a,s0). on(a,d,s0). ontable(d,s0). 
clear(b,s0).


%  Goal  

goal(S) :-  on(d,c,S), on(c,a,S), on(a,b,S), ontable(b,S).


%  Good towers. 

goodTower(d,S) :- on(d,c,S), goodTower(c,S).
goodTower(c,S) :- on(c,a,S), goodTower(a,S).
goodTower(a,S) :- on(a,b,S), goodTower(b,S).
goodTower(b,S) :- ontable(b,S). 

