- Documentation
- Reference manual
- Packages
- Pengines: Web Logic Programming Made Easy
- Pengine libraries
- library(pengines): Pengines: Web Logic Programming Made Easy
- pengine_create/1
- pengine_ask/3
- pengine_next/2
- pengine_stop/2
- pengine_abort/1
- pengine_destroy/1
- pengine_destroy/2
- pengine_self/1
- pengine_application/1
- current_pengine_application/1
- pengine_property/2
- pengine_output/1
- pengine_debug/2
- pengine_pull_response/2
- pengine_input/2
- pengine_respond/3
- pengine_event_loop/2
- pengine_rpc/2
- pengine_rpc/3
- pengine_user/1
- library(pengines): Pengines: Web Logic Programming Made Easy
- Pengine libraries
- Pengines: Web Logic Programming Made Easy
Availability:
:- use_module(library(pengines)).
Options is a list of options:
- template(+Template)
- Template is a variable (or a term containing variables) shared with the query. By default, the template is identical to the query.
- chunk(+Integer)
- 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.
- bindings(+Bindings)
- Sets the global variable '$variable_names' to a list of
Name = Var
terms, providing access to the actual variable names.
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 terms.
- 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 is
either
true
orfalse
, indicating whether we can expect the pengine to be able to return more solutions or not, would we call pengine_next/2. - failure(ID)
- 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 the prompt.
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).