built-in predicate

threaded_engine_create/3

Description

threaded_engine_create(AnswerTemplate, Goal, Engine)

Creates a new engine for proving the given goal and defines an answer template for retrieving the goal solution bindings. A message queue for passing arbitrary terms to the engine is also created. If the name for the engine is not given, a unique name is generated and returned. Engine names shall be regarded as opaque terms; users shall not rely on its type.

Note

This predicate requires a backend Prolog compiler providing compatible multi-threading primitives. The value of the read-only engines flag is set to supported when that is the case.

Meta-predicate template

threaded_engine_create(*, 0, *)

Modes and number of proofs

threaded_engine_create(@term, @callable, @nonvar) - one
threaded_engine_create(@term, @callable, --nonvar) - one

Errors

Goal is a variable:
instantiation_error
Goal is neither a variable nor a callable term:
type_error(callable, Goal)
Engine is the name of an existing engine:
permission_error(create, engine, Engine)

Examples

% create a new engine to enumerate list elements:
| ?- threaded_engine_create(X, member(X, [1,2,3]), worker_1).