After I have seen these question, I have tried to solve below problem. But I could not solve it. Can anyone help me ?
predefined :
foo( X, Y ) bar( Y, Z )
^ ^ ^ ^
all of them is atomic, that is they only return or take one value at a time
sample example:
foo(john, brad).
bar(john, marry).
foo( Y, brad)
Y = john % after pressing a, all possibilities will be seen at terminal
bar(Y, Z )
Z = marry % after pressing a, all possibilities will be seen at terminal
%..................
For these case how can I run bar with all possibilities of Y, resulted after eash run of foo ?