B-Prolog supports the the lazy strategy that allows a cluster of subgoals to return answers only after the fixpoint has been reached. The lazy consumption strategy is suited for finding all answers because of the locality of search. So, for example, when the subgoal p(Y) is encountered in the goal ``p(X),p(Y)'', the subtree for p(X) must have been explored completely. For certain applications such as planning it is unreasonable to find all answers either because the set is infinite or because only one answer is needed. For example, for the goal ``p(X),!,q(X)'' the lazy strategy produces all the answers for p(X) even though only one is needed; and table modes should be used to let p(X) generate the required number of answers.
Neng-Fa Zhou 2012-01-03