threaded_engine_create/3 — The Logtalk Handbook v3.47.0 documentation

# `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.

## 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 for finding members of a list:
    | ?- threaded_engine_create(X, member(X, [1,2,3]), worker_1).

See also

threaded_engine_destroy/1, threaded_engine_self/1, threaded_engine/1, threaded_engine_next/2, threaded_engine_next_reified/2