#include <sicstus/sicstus.h> SP_qid SP_open_query(SP_pred_ref predicate, SP_term_ref arg1, …);
Sets up a query for use by
The predicate to call.
The arguments to pass.
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.