Hi every one ,I am happy to join you,,,,
I have question:
I have this database which is Blocks world.I am trying to define a predicate for finding all blocks to the right of a given block as list.The DataBase as follow:
on(b,c).
on(d,e).
on(e,g).
desk(a).
desk(b).
desk(d).
desk(f).
right_to(a,b).
right_to(b,d).
right_to(d,f).
I have struggled to find all right blocks for a given block and I have started like this:
all_right(X,Out):-
setof(X,right(X,Y),Out)
,but I need all blocks not just the blocks on the desk....
I will appreciate your help.
I have question:
I have this database which is Blocks world.I am trying to define a predicate for finding all blocks to the right of a given block as list.The DataBase as follow:
on(b,c).
on(d,e).
on(e,g).
desk(a).
desk(b).
desk(d).
desk(f).
right_to(a,b).
right_to(b,d).
right_to(d,f).
I have struggled to find all right blocks for a given block and I have started like this:
all_right(X,Out):-
setof(X,right(X,Y),Out)
,but I need all blocks not just the blocks on the desk....
I will appreciate your help.