Obtains various properties of the given engine. The engine may be currently running or stopped (to wait for the engine to stop, use engine_join/3).
The different properties are
A term indicating the current engine state. Unless the engine is running, the status is the same as the one returned by the most recent engine_resume/3 or engine_join/2. A non-running engine will retain its state until it is resumed again. A status can be one of:
true or false, indicating whether the engine was created with the detached(true) option.
The size limit of the engine's global/trail stack in KiB. This value was either given as global(KiBytes) option during engine creation, or was inherited from the creator.
The size limit of the engine's local/control stack in KiB. This value was either given as local(KiBytes) option during engine creation, or was inherited from the creator.
An integer indicating the number of entities currently holding a reference to the engine. The engine will be garbage collected once this count reaches zero.
The record handle that the engine uses to report when it is ready to be joined. This property only exists when the engine was created with the report_to(RecordHandle) option, otherwise it fails.
A handle for a unique 'store' object associated with the engine. Such a store is automatically created (via implicit store_create/1) the first time the property is requested. It is useful for storing nonlogical engine/thread-local information.
true or false, indicating whether the engine has its own thread. The thread may have been created eagerly at engine creation, or lazily on the first engine_resume_thread/2.
?- engine_create(E, []), get_engine_property(E, status, Status). E = $&(engine,"375am7") Status = false Yes (0.00s cpu) ?- engine_create(E, []), engine_resume(E, writeln(hello), Status1), get_engine_property(E, status, Status2). hello E = $&(engine,"375am7") Status1 = true Status2 = true Yes (0.00s cpu) ?- engine_create(E, [thread]), engine_resume_thread(E, (writeln(hello),sleep(1),writeln(done))), get_engine_property(E, status, Status1), writeln(Status1), engine_join(E, block, Status2). running hello done Status1 = running Status2 = true Yes (0.00s cpu) ?- engine_create(E, []), get_engine_property(E, global, GlobalSize), get_engine_property(E, thread, HasThread), get_engine_property(E, references, NumRefs). E = $&(engine,"376oe7") GlobalSize = 524288 HasThread = false NumRefs = 1 Yes (0.00s cpu) ?- engine_create(E, []), get_engine_property(E, all, Properties). E = $&(engine,"376oe7") Properties = [status(false), references(1), thread(false), detached(false), local 131072, global 524288] Yes (0.00s cpu)