Class janus.query() is
similar to the
janus.query_once()
function, but it returns a Python
iterator that allows for iterating over the answers to a
non-deterministic Prolog predicate.
- query janus.query(query,
bindings={}, keep=False)
- As janus.query_once(),
returning an iterator that provides an answer dict as janus.query_once()
for each answer to query. Answers never have
truth
False
.
See discussion above.
- Compatibility
- PIP. The
keep
is a SWI-Prolog extension.
- Query janus.Query(query,
bindings={}, keep=False)
- Deprecated. This class was renamed to janus.query(.)
- dict
|
None janus.query.next() - Explicitly ask for the next solution of the iterator. Normally, using
the
query
as an iterator is to be preferred. See discussion
above.
- None janus.query.close()
- Close the query. Closing a query is obligatory. When used as an
iterator, the Python destructor (__del__()) takes care of closing
the query.
- Compatibility
- PIP.