SP_open_query()
#include <sicstus/sicstus.h> SP_qid SP_open_query(SP_pred_ref predicate, SP_term_ref arg1, ...);
Sets up a query for use by SP_next_solution()
, SP_close_query()
, SP_cut_query()
.
The query identifier if successful, otherwise 0,
Note that if a new query is opened while another is already open, the new query must be terminated before exploring the solutions of the old one. That is, queries must be strictly nested.
Finding Multiple Solutions of a Call.