accao(nome : go(X,Y),
 condicoes : [at(X)], 
   efeitos : [at(Y),-at(X)], 
restricoes : [(X\==Y)]).
 
accao(nome : buy(X),
 condicoes : [sell(L,X),at(L)],
   efeitos : [have(X)], 
restricoes : []).
 
inicial([at(home),sell(super,banana),sell(hws,drill),sell(super,milk)]).
 
objectivos([have(milk),have(drill),have(banana),at(home)]).
 
/* Alguns dos planos para este problema:
 
| ?- plano(L).
L = [go(home,super),buy(banana),buy(milk),go(super,hws),buy(drill),go(hws,home)];
L = [go(home,super),buy(milk),buy(banana),go(super,hws),buy(drill),go(hws,home)]
yes
| ?-
 
Já agora, um exemplo de execução do primeiro plano:
 
Initial Situation: [at(home),sell(super,banana),sell(hws,drill),sell(super,milk)]
Action performed: go(home,super)
Situation: [at(super),sell(super,banana),sell(hws,drill),sell(super,milk)]
Action performed: buy(banana)
Situation: [have(banana),at(super),sell(super,banana),sell(hws,drill),sell(super,milk)]
Action performed: buy(milk)
Situation: [have(milk),have(banana),at(super),sell(super,banana),sell(hws,drill),sell(super,milk)]
Action performed: go(super,hws)
Situation: [at(hws),have(milk),have(banana),sell(super,banana),sell(hws,drill),sell(super,milk)]
Action performed: buy(drill)
Situation: [have(drill),at(hws),have(milk),have(banana),sell(super,banana),sell(hws,drill),sell(super,milk)]
Action performed: go(hws,home)
Situation: [at(home),have(drill),have(milk),have(banana),sell(super,banana),sell(hws,drill),sell(super,milk)]
Goal [have(milk),have(drill),have(banana),at(home)] satisfied
 
*/