Next: cpg-ref-SP_query_cut_fail, Previous: cpg-ref-SP_put_variable, Up: cpg-bif [Contents][Index]
SP_query()
#include <sicstus/sicstus.h> int SP_query(SP_pred_ref predicate, SP_term_ref arg1, …);
Calls a predicate, committing to its first solution.
The predicate to call.
The arguments to pass.
SP_SUCCESS
if the goal succeeded,
SP_FAILURE
if it failed, and
SP_ERROR
if an error condition occurred.
Use this if you are only interested in the first solution. It will
create a goal from the
predicate definition and the arguments, call it, and commit to the
first solution found, if any. If it returns SP_SUCCESS
, values in the
query arguments valid, and will remain so until
backtracking into any enclosing query.
Finding One Solution of a Call.