Asks pengine NameOrID a query Query.
Options is a list of options:
- Template is a variable (or a term containing variables) shared
with the query. By default, the template is identical to the
- Retrieve solutions in chunks of Integer rather than one by one. 1
means no chunking (default). Other integers indicate the maximum
number of solutions to retrieve in one chunk.
- Sets the global variable '$variable_names' to a list of
Name = Var terms, providing access to the actual variable
Any remaining options are passed to pengine_send/3.
Note that the predicate pengine_ask/3 is deterministic, even for queries
that have more than one solution. Also, the variables in Query will not
be bound. Instead, results will be returned in the form of event
- success(ID, Terms, Projection, Time, More)
- ID is the id of the pengine that succeeded in solving the query.
Terms is a list holding instantiations of Template. Projection
is a list of variable names that should be displayed. Time is
the CPU time used to produce the results and finally, More
false, indicating whether we can expect the
pengine to be able to return more solutions or not, would we call
- ID is the id of the pengine that failed for lack of a solutions.
- error(ID, Term)
- ID is the id of the pengine throwing the exception.
Term is the exception's error term.
- output(ID, Term)
- ID is the id of a pengine running the query that called
pengine_output/1. Term is the term that was passed in the first
argument of pengine_output/1 when it was called.
- prompt(ID, Term)
- ID is the id of the pengine that called pengine_input/2 and Term is
Defined in terms of pengine_send/3, like so:
pengine_ask(ID, Query, Options) :-
partition(pengine_ask_option, Options, AskOptions, SendOptions),
pengine_send(ID, ask(Query, AskOptions), SendOptions).