#include <quintus/quintus.h> int QP_close_query(qid) QP_qid qid;
Equivalent to the Prolog call:
The cut renders the current computation determinate, removing the
possibility of future backtracking. The following call to
then initiates backtracking to the first parent goal with
outstanding alternatives. In doing so it pops the Prolog heap to its
state when the parent goal succeeded, in effect throwing away any
terms created since that parent goal.
In the context of calling Prolog from foreign languages, terminating a
QP_close_query() generally means throwing away the last
solution that was calculated, unless that solution has been copied into
a more permanent place. (Of course, any previous solutions must also
be assumed to have been overwritten by subsequent solutions unless copied
elsewhere!) The converse of this behavior is that closing a query using
QP_close_query() automatically frees up the Prolog memory that holds
the last solution.