The file library/engines.pl contains some examples of how multiple engines can be used for implementing for instance all-solution predicates. Here is a re-entrant find_all/3.
find_all(X,Goal,Xs):- default_engine_params(H,S,T), find_all(H,S,T,X,Goal,Xs). find_all(H,S,T,X,Goal,Xs):- create_engine(H,S,T,Handle), load_engine(Handle,Goal,X), collect_answers(Handle,Xs), destroy_engine(Handle). collect_answers(Handle,[X|Xs]):-ask_engine(Handle,A),!, copy_term(A,X), collect_answers(Handle,Xs). collect_answers(_,[]). default_engine_params(128,32,32).