2.12 Environment Control (Prolog flags)

The predicates current_prolog_flag/2 and set_prolog_flag/2 allow the user to examine and modify the execution environment. It provides access to whether optional features are available on this version, operating system, foreign code environment, command line arguments, version, as well as runtime flags to control the runtime behaviour of certain predicates to achieve compatibility with other Prolog environments.

[ISO]current_prolog_flag(?Key, -Value)
The predicate current_prolog_flag/2 defines an interface to installation features: options compiled in, version, home, etc. With both arguments unbound, it will generate all defined Prolog flags. With Key instantiated, it unifies Value with the value of the Prolog flag or fails if the Key is not a Prolog flag.

Flags marked changeable can be modified by the user using set_prolog_flag/2. Flag values are typed. Flags marked as bool can have the values true or false. The predicate create_prolog_flag/3 may be used to create flags that describe or control behaviour of libraries and applications. The library library(settings) provides an alternative interface for managing notably application parameters.

Some Prolog flags are not defined in all versions, which is normally indicated in the documentation below as “if present and true’. A boolean Prolog flag is true iff the Prolog flag is present and the Value is the atom true. Tests for such flags should be written as below:

        (   current_prolog_flag(windows, true)
        ->  <Do MS-Windows things>
        ;   <Do normal things>
        )

Some Prolog flags are scoped to a source file. This implies that if they are set using a directive inside a file, the flag value encountered when loading of the file started is restored when loading of the file is completed. Currently, the following flags are scoped to the source file: generate_debug_info and optimise.

A new thread (see section 10) copies all flags from the thread that created the new thread (its parent).15This is implemented using the copy-on-write technique. As a consequence, modifying a flag inside a thread does not affect other threads.

abi_version(dict)
The flag value is a dict with keys that describe the version of the various Application Binary Interface (ABI) components. See section 2.21 for details.
access_level(atom, changeable)
This flag defines a normal‘user’view (user, default) or a‘system’view. In system view all system code is fully accessible as if it was normal user code. In user view, certain operations are not permitted and some details are kept invisible. We leave the exact consequences undefined, but, for example, system code can be traced using system access and system predicates can be redefined.
address_bits(integer)
Address size of the hosting machine. Typically 32 or 64. Except for the maximum stack limit, this has few implications to the user. See also the Prolog flag arch.
agc_close_streams(boolean, changeable)
When true (default false16Future versions are likely to change the default to true.), that atom garbage collector streams that are garbage collected while being open. In addition, a warning is printed. Below is an example of such a warning.
WARNING: AGC: closed <stream>(0x560e29014400)

Note that closing I/O streams should not be left to the (atom) garbage collector because it may take long before the atom garbage collector runs and because that atom garbage collector is conservative, which implies that it is not guaranteed that all garbage atoms are reclaimed. Code that uses I/O streams should use setup_call_cleanup/3 using the skeleton below, where process/1 is a predicate that reads from or writes to Stream.

    setup_call_cleanup(
        open(..., Stream),
        process(Stream),
        close(Stream)),
    ...

Note that the setting for this flag in the main thread applies.

agc_margin(integer, changeable)
If this amount of atoms possible garbage atoms exist perform atom garbage collection at the first opportunity. Initial value is 10,000. May be changed. A value of 0 (zero) disables atom garbage collection. See also PL_register_atom().17Given that SWI-Prolog has no limit on the length of atoms, 10,000 atoms may still occupy a lot of memory. Applications using extremely large atoms may wish to call garbage_collect_atoms/0 explicitly or lower the margin.
allow_dot_in_atom(bool, changeable)
If true (default false), dots may be embedded into atoms that are not quoted and start with a letter. The embedded dot must be followed by an identifier continuation character (i.e., letter, digit or underscore). The dot is allowed in identifiers in many languages, which can make this a useful flag for defining DSLs. Note that this conflicts with cascading functional notation. For example, Post.meta.author is read as .(Post,’meta.author’ if this flag is set to true.
allow_variable_name_as_functor(bool, changeable)
If true (default is false), Functor(arg) is read as if it were written ’Functor’(arg). Some applications use the Prolog read/1 predicate for reading an application-defined script language. In these cases, it is often difficult to explain to non-Prolog users of the application that constants and functions can only start with a lowercase letter. Variables can be turned into atoms starting with an uppercase atom by calling read_term/2 using the option variable_names and binding the variables to their name. Using this feature, F(x) can be turned into valid syntax for such script languages. Suggested by Robert van Engelen. SWI-Prolog specific.
android(bool)
If present and true, it indicates we are running on the Android OS. The flag is not present in other operating systems.
android_api(integer)
If running on Android, it indicates the compile-time API Level defined by the C macro __ANDROID_API__. It is not defined if running on other operating systems. The API level may or may not match the API level of the running device, since it is the API level at compile time.
answer_write_options(term, changeable)
This flag is used by the interactive toplevel to print the value if bindings (answers). The flag value is passed to write_term/2 when printing an answer queries. Default is [quoted(true), portray(true), max_depth(10), attributes(portray)].
apple(bool)
If present and true, the operating system is MacOSX. Defined if the C compiler used to compile this version of SWI-Prolog defines __APPLE__. Note that the unix is also defined for MacOSX.
apple_universal_binary(bool)
If present and true, SWI-Prolog has been build as a universal binary. Universal binaries contain native executable code for multiple architectures. Currently the supported architectures are x86_64 and arm64. The archirecture prefix for components is fat-darwin while the arch depends on the actual CPU type.
arch(atom)
Identifier for the hardware and operating system SWI-Prolog is running on. Used to select foreign files for the right architecture. See also section 12.2.3 and file_search_path/2. For Apple, see also apple_universal_binary.
argv(list, changeable)
List is a list of atoms representing the application command line arguments. Application command line arguments are those that have not been processed by Prolog during its initialization. Note that Prolog's argument processing stops at -- or the first non-option argument. See also os_argv.18Prior to version 6.5.2, argv was defined as os_argv is now. The change was made for compatibility reasons and because the current definition is more practical.
associated_file(atom)
Set if Prolog was started with a prolog file as argument. Used by e.g., edit/0 to edit the initial file.
autoload(atom, changeable)
This flag controls autoloading predicates based on autoload/1 and autoload/2 as well as predicates from autoload libraries. It has the following values:
false
Predicates are never auto-loaded. If predicates have been imported before using autoload/[1,2], load the referenced files immediately using use_module/[1,2]. Note that most of the development utilities such as listing/1 have to be explicitly imported before they can be used at the toplevel.
explicit
Do not autoload from autoload libraries, but do use lazy loading for predicates imported using autoload/[1,2].
user
As false, but to autoload library predicates into the global user module. This makes the development tools and library implicitly available to the toplevel, but not to modules.
user_or_explicit
Combines explicit with user, providing lazy loading of predicates imported using autoload/[1,2] and implicit access to the whole library for the toplevel.
true
Provide full autoloading everywhere. This is the default.
back_quotes(codes,chars,string,symbol_char, changeable)
Defines the term-representation for back-quoted material. The default is codes. If --traditional is given, the default is symbol_char, which allows using ` in operators composed of symbols.19Older versions had a boolean flag backquoted_strings, which toggled between string and symbol_char See also section 5.2.
backtrace(bool, changeable)
If true (default), print a backtrace on an uncaught exception.
backtrace_depth(integer, changeable)
If backtraces on errors are enabled, this flag defines the maximum number of frames that is printed (default 20).
backtrace_goal_depth(integer, changeable)
The frame of a backtrace is printed after making a shallow copy of the goal. This flag determines the depth to which the goal term is copied. Default is‘3’.
backtrace_show_lines(bool, changeable)
If true (default), try to reconstruct the line number at which the exception happened.
bounded(bool)
ISO Prolog flag. If true, integer representation is bound by min_integer and max_integer. If false integers can be arbitrarily large and the min_integer and max_integer are not present. The flag max_integer_size may be used to enforce an arbitrary limit rather than exhausting memory. See section 4.27.2.1.
break_level(integer)
Current break-level. The initial top level (started with -t) has value 0. See break/0. This flag is absent from threads that are not running a top-level loop.
c_cc(atom, changeable)
Name of the C compiler used to compile SWI-Prolog. Normally one of gcc, clang or cc. See section 12.5.
c_cflags(atom, changeable)
CFLAGS used to compile SWI-Prolog. See section 12.5.
c_cxx(atom, changeable)
Name of the C++ compiler used to test the SWI-Prolog C++ binding. This is the default C++ compiler used by swipl-ld (see section 12.5) as well as compiling packs using the default setup. Note that SWI-Prolog itself does not contain C++ code and the C++ binding is header only. This implies that C++ ABI compatibility issues can not occur.
c_ldflags(atom, changeable)
LDFLAGS used to link SWI-Prolog. See section 12.5.
c_libplso(atom, changeable)
Libraries needed to link extensions (shared object, DLL) to SWI-Prolog. Typically empty on ELF systems and -lswipl on COFF-based systems. See section 12.5.
c_libs(atom, changeable)
Libraries needed to link executables that embed SWI-Prolog. Typically -lswipl if the SWI-Prolog kernel is a shared (DLL). If the SWI-Prolog kernel is in a static library, this flag also contains the dependencies.
char_conversion(bool, changeable)
Determines whether character conversion takes place while reading terms. See also char_conversion/2.
character_escapes(bool, changeable)
If true (default), read/1 interprets \ escape sequences in quoted atoms and strings. May be changed. This flag is local to the module in which it is changed. See section 2.15.1.3.
character_escapes_unicode(bool, changeable)
If true (default), write/1 and friends write escaped characters using the \uXXXX or \UXXXXXXXX syntax rather than the ISO Prolog \x<hex>\ syntax. SWI-Prolog reads both.
cmake_build_type(atom, changeable)
Provides the cmake build type used to build this version of SWI-Prolog.
colon_sets_calling_context(bool, changeable)
Using the construct <module>:<goal> sets the calling context for executing <goal>. This flag is defined by ISO/IEC 13211-2 (Prolog modules standard). See section 6.
color_term(bool, changeable)
This flag is managed by library library(ansi_term), which is loaded at startup if the two conditions below are both true. Note that this implies that setting this flag to false from the system or personal initialization file (see section 2.2 disables colored output. The predicate message_property/2 can be used to control the actual color scheme depending in the message type passed to print_message/2.

  • stream_property(current_output, tty(true))
  • \+ current_prolog_flag(color_term, false)
compile_meta_arguments(atom, changeable)
This flag controls compilation of arguments passed to meta-calls marked‘0’or‘^’(see meta_predicate/1). Supported values are:
false
(default). Meta-arguments are passed verbatim. If the argument is a control structure ((A,B), (A;B), (A->B;C), etc.) it is compile to an temporary clause allocated on the environment stack when the meta-predicate is called.
control
Compile meta-arguments that contain control structures to an auxiliary predicate. This generally improves performance as well as the debugging experience.
always
Always create an intermediate clause, even for system predicates.20This may be used in the future for replacing the normal head of the generated predicate with a special reference (similar to database references as used by, e.g., assert/2) that provides direct access to the executable code, thus avoiding runtime lookup of predicates for meta-calling.
compiled_at(atom)
Describes when the system has been compiled. Only available if the C compiler used to compile SWI-Prolog provides the __DATE__ and __TIME__ macros.
conda(bool)
Set to true when built in a Conda environment.
console_menu(bool)
Set to true in swipl-win.exe to indicate that the console supports menus. See also section 4.35.4.
cpu_count(integer, changeable)
Number of physical CPUs or cores in the system. The flag is marked read-write both to allow pretending the system has more or less processors. See also thread_setconcurrency/2 and the library library(thread). This flag is not available on systems where we do not know how to get the number of CPUs. This flag is not included in a saved state (see qsave_program/1).
dde(bool)
Set to true if this instance of Prolog supports DDE as described in section 4.44.
debug(bool, changeable)
Switch debugging mode on/off. If debug mode is activated the system traps encountered spy points (see spy/1) and break points. In addition, last-call optimisation is disabled and the system is more conservative in destroying choice points to simplify debugging.

Disabling these optimisations can cause the system to run out of memory on programs that behave correctly if debug mode is off.

debug_on_error(bool, changeable)
If true, start the tracer after an error is detected. Otherwise just continue execution. The goal that raised the error will normally fail. See also the Prolog flag report_error. Default is true.
debug_on_interrupt(bool, changeable)
If true, start the debugger on Control-C.21More precisely when receiving SIGINT. The initial value is false and the value is set to true when entering the interactive top level. See --debug-on-interrupt to start handling interrupts immediately.
debugger_show_context(bool, changeable)
If true, show the context module while printing a stack-frame in the tracer. Normally controlled using the‘C’option of the tracer.
debugger_write_options(term, changeable)
This argument is given as option-list to write_term/2 for printing goals by the debugger. Modified by the‘w’,‘p’and‘<N> d’commands of the debugger. Default is [quoted(true), portray(true), max_depth(10), attributes(portray)].
determinism_error(atom, changeable)
This flag defines the behaviour when the predicate determinism is not according to its declaration. See det/1. Possible values are error (default), warning and silent.
dialect(atom)
Fixed to swi. The code below is a reliable and portable way to detect SWI-Prolog.
is_dialect(swi) :-
        catch(current_prolog_flag(dialect, swi), _, fail).
dir_sep(atom)
Separator for directories in a file name the OS. Normally /, but \ on Windows.
double_quotes(codes,chars,atom,string, changeable)
This flag determines how double quoted strings are read by Prolog and is ---like character_escapes and back_quotes--- maintained for each module. The default is string, which produces a string as described in section 5.2. If --traditional is given, the default is codes, which produces a list of character codes, integers that represent a Unicode code-point. The value chars produces a list of one-character atoms and the value atom makes double quotes the same as single quotes, creating a atom. See also section 5.
editor(atom, changeable)
Determines the editor used by edit/1. See section 4.4.1 for details on selecting the editor used.
emacs_inferior_process(bool)
If true, SWI-Prolog is running as an inferior process of (GNU/X-)Emacs. SWI-Prolog assumes this is the case if the environment variable EMACS is t and INFERIOR is yes.
encoding(atom, changeable)
Default encoding used for opening files in text mode. The initial value is deduced from the environment. See section 2.18.1 for details.
executable(atom)
Pathname of the running executable. Used by qsave_program/2 as default emulator.
executable_format(atom)
Format of the SWI-Prolog executable, e.g. elf for when swipl is an ELF binary file.
exit_status(integer)
Set by halt/1 to its argument, making the exit status available to hooks registered with at_halt/1.
file_name_case_handling(atom, changeable)
This flag defines how Prolog handles the case of file names. The flag is used for case normalization and to determine whether two names refer to the same file.bugNote that file name case handling is typically a properly of the filesystem, while Prolog only has a global flag to determine its file handling. It has one of the following values:
case_sensitive
The filesystem is fully case sensitive. Prolog does not perform any case modification or case insensitive matching. This is the default on Unix systems.
case_preserving
The filesystem is case insensitive, but it preserves the case with which the user has created a file. This is the default on Windows systems.
case_insensitive
The filesystem doesn't store or match case. In this scenario Prolog maps all file names to lower case.
file_name_variables(bool, changeable)
If true (default false), expand $\arg{varname} and ~ in arguments of built-in predicates that accept a file name (open/3, exists_file/1, access_file/2, etc.). The predicate expand_file_name/2 can be used to expand environment variables and wildcard patterns. This Prolog flag is intended for backward compatibility with older versions of SWI-Prolog.
file_search_cache_time(number, changeable)
Time in seconds for which search results from absolute_file_name/3 are cached. Within this time limit, the system will first check that the old search result satisfies the conditions. Default is 10 seconds, which typically avoids most repetitive searches for (library) files during compilation. Setting this value to 0 (zero) disables the cache.
float_max(float)
The biggest representable floating point number.
float_max_integer(float)
The highest integer that can be represented precisely as a floating point number.
float_min(float)
The smallest representable floating point number above 0.0. See also nexttoward/2.
float_overflow(atom, changeable)
One of error (default) or infinity. The first is ISO compliant. Using infinity, floating point overflow is mapped to positive or negative Inf. See section 4.27.2.4. This flag also affects read_term/3 and friends, causing them to read too large floating point number as infinity.
float_rounding(atom, changeable)
Defines how arithmetic rounds to a float. Defined values are to_nearest (default), to_positive, to_negative or to_zero. For most scenarios the function roundtoward/2 provides a safer and faster alternative.
float_undefined(atom, changeable)
One of error (default) or nan. The first is ISO compliant. Using nan, undefined operations such as sqrt(-2.0) is mapped to NaN. See section 4.27.2.4.
float_underflow(atom, changeable)
One of error or ignore (default). The second is ISO compliant, binding the result to 0.0.
float_zero_div(atom, changeable)
One of error (default) or infinity. The first is ISO compliant. Using infinity, division by 0.0 is mapped to positive or negative Inf. See section 4.27.2.4.
gc(bool, changeable)
If true (default), the garbage collector is active. If false, neither garbage collection, nor stack shifts will take place, even not on explicit request. May be changed.
gc_thread(bool)
If true (default if threading is enabled), atom and clause garbage collection are executed in a separate thread with the alias gc. Otherwise the thread that detected sufficient garbage executes the garbage collector. As running these global collectors may take relatively long, using a separate thread improves real time behaviour. The gc thread can be controlled using set_prolog_gc_thread/1, which either enables the gc thread or kills the gc thread and waits for it to die.
generate_debug_info(bool, changeable)
If true (default) generate code that can be debugged using trace/0, spy/1, etc. Can be set to false using the --no-debug. This flag is scoped within a source file. Many of the libraries have :- set_prolog_flag(generate_debug_info, false) to hide their details from a normal trace.22In the current implementation this only causes a flag to be set on the predicate that causes children to be hidden from the debugger. The name anticipates further changes to the compiler.
gmp_version(integer)
If Prolog is linked with GMP, this flag gives the major version of the GMP library used. See also section 12.4.11. This flag is not present when linked to LibBF. Use non-existence of the Prolog flag bounded to test for big integer and rational number support.
gui(bool)
Set to true if XPCE is around and can be used for graphics.
heartbeat(integer, changeable)
If not zero, call prolog:heartbeat/0 every N inferences. N is rounded to a multiple of 16.
history(integer, changeable)
If integer> 0, support Unix csh(1)-like history as described in section 2.8. Otherwise, only support reusing commands through the command line editor. The default is to set this Prolog flag to 0 if a command line editor is provided (see Prolog flag readline) and 15 otherwise.
home(atom)
SWI-Prolog's notion of the home directory. SWI-Prolog uses its home directory to find its startup file as <home>/boot.prc and to find its library as <home>/library. Some installations may put architecture independent files in a shared home and also define shared_home. System files can be found using absolute_file_name/3 as swi(file). See file_search_path/2.
hwnd(integer)
In swipl-win.exe, this refers to the MS-Windows window handle of the console window.
integer_rounding_function(down,toward_zero)
ISO Prolog flag describing rounding by // and rem arithmetic functions. Value depends on the C compiler used.
iso(bool, changeable)
Include some weird ISO compatibility that is incompatible with normal SWI-Prolog behaviour. Currently it has the following effect:
  • The //2 (float division) always returns a float, even if applied to integers that can be divided.
  • In the standard order of terms (see section 4.6.1), all floats are before all integers.
  • atom_length/2 yields a type error if the first argument is a number.
  • clause/[2,3] raises a permission error when accessing static predicates.
  • abolish/[1,2] raises a permission error when accessing static predicates.
  • Syntax is closer to the ISO standard:
    • Within functional notation and list notation terms must have priority below 1000. That means that rules and control constructs appearing as arguments need bracketing. A term like [a :- b, c]. must now be disambiguated to mean [(a :- b), c]. or [(a :- b, c)].
    • Operators appearing as operands must be bracketed. Instead of X == -, true. write X == (-), true. Currently, this is not entirely enforced.
    • Backslash-escaped newlines are interpreted according to the ISO standard. See section 2.15.1.3.
large_files(bool)
If present and true, SWI-Prolog has been compiled with large file support (LFS) and is capable of accessing files larger than 2GB. This flag is always true on 64-bit hardware and true on 32-bit hardware if the configuration detected support for LFS. Note that it may still be the case that the file system on which a particular file resides puts limits on the file size.
last_call_optimisation(bool, changeable)
Determines whether or not last-call optimisation is enabled. Normally the value of this flag is the negation of the debug flag. As programs may run out of stack if last-call optimisation is omitted, it is sometimes necessary to enable it during debugging.
libswipl(atom, changeable)
Path where the SWI-Prolog shared library libswipl, the SWI-Prolog shared object that provides Prolog, resides. On some systems this can be determined reliably from the running system. On these systems the flag is read-only. On other systems it is the configured target installation location and thus this value can be wrong if the installation has been relocated. As we do not have a cross-platform reliable way to compute this path the flag is read-write on such platforms.23When running from the build environment, this flag is adjusted to reflect the location in the build tree.

Currently, this flag is reliable on Windows and POSIX systems providing the dladdr() function. This function is provided on Linux and MacOS.

malloc(atom)
Set after a successful identification of the used malloc() implementation. Currently possibly values are tcmalloc and ptmalloc. See section 4.43.2 for details.
max_answers_for_subgoal(integer, changeable)
Limit the number of answers in a table. The atom infinite clears the flag. By default this flag is not defined. See section 7.10 for details.
max_answers_for_subgoal_action(atom, changeable)
The action taken when a table reaches the number of answers specified in max_answers_for_subgoal. Supported values are bounded_rationality, error (default) or suspend.
max_arity(unbounded)
ISO Prolog flag describing there is no maximum arity to compound terms.
max_char_code(integer)
Highest (Unicode) code point that is supported. SWI-Prolog supports all Unicode code points from 0 (zero) upto and including the value of this flag. Currently 0xffff on Windows (UCS-2) and 0x10ffff on most other platforms.
max_integer(integer)
Maximum integer value if integers are bounded. See also the flag bounded and section 4.27.2.1.
max_integer_size(integer, changeable)
When this tripwire is set, memory allocation on behalf of big integers and rational numbers is limited to given number of bytes. The minimum value is 1,000. When unset, the allocation limit is determined by the stack limit as we cannot represent larger numbers or malloc() failures. Notably services that may process arbitrary arithmetic expressions on behalf of a client may set this limit to avoid resource exhaustion.
max_procedure_arity(integer)
Maximum arity for a predicate. An attempt to define or call such a predicate results in a representation_error(max_procedure_arity) exception. Currently set to 1024.
max_rational_size(integer, changeable)
Limit the size in bytes for rational numbers. This tripwire can be used to identify cases where setting the Prolog flag prefer_rationals to true creates excessively big rational numbers and, if precision is not required, one should use floating point arithmetic. Note that rationals are also implicitly limited by the Prolog flag max_integer_size.
max_rational_size_action(atom, changeable)
Action when the max_rational_size tripwire is exceeded. Possible values are error (default), which throws a tripwire resource error and float, which converts the rational number into a floating point number. Note that rational numbers may exceed the range for floating point numbers.
max_table_answer_size(integer, changeable)
Limit the size of an answer substitution for tabling. The atom infinite clears the flag. By default this flag is not defined. See section 7.10 for details.
max_table_answer_size_action(atom, changeable)
The action taken if an answer substitution larger than max_table_answer_size is added to a table. Supported values are error (default), bounded_rationality, suspend and fail.
max_table_subgoal_size(integer, changeable)
Limit the size of a goal term accessing a table. The atom infinite clears the flag. By default this flag is not defined. See section 7.10 for details.
max_table_subgoal_size_action(atom, changeable)
The action taken if a tabled goal exceeds max_table_subgoal_size. Supported values are error (default), abstract and suspend.
max_tagged_integer(integer)
Maximum integer value represented as a‘tagged’value. Tagged integers require one word storage. Larger integers are represented as‘indirect data’and require significantly more space.
message_context(list(atom), changeable)
Context information to add to messages of the levels error and warning. The list may contain the elements thread to add the thread that generates the message to the message, time or time(Format) to add a time stamp. The default time format is %T.%3f. The default is [thread]. See also format_time/3 and print_message/2.
min_integer(integer)
Minimum integer value if integers are bounded. See also the flag bounded and section 4.27.2.1.
min_tagged_integer(integer)
Start of the tagged-integer value range.
mitigate_spectre(bool, changeable)
When true (default false), enforce mitigation against the Spectre timing-based security vulnerability. Spectre based attacks can extract information from memory owned by the process that should remain invisible, such as passwords or the private key of a web server. The attacks work by causing speculative access to sensitive data, and leaking the data via side-channels such as differences in the duration of successive instructions. An example of a potentially vulnerable application is SWISH. SWISH allows users to run Prolog code while the swish server must protect the privacy of other users as well as its HTTPS private keys, cookies and passwords.

Currently, enabling this flag reduces the resolution of get_time/1 and statistics/2 CPU time to 20μs.

WARNING: Although a coarser timer makes a successful attack of this type harder, it does not reliably prevent such attacks in general. Full mitigation may require compiler support to disable speculative access to sensitive data.

msys2(bool)
If present, SWI-Prolog is the MS-Windows version running under a MSYS2 shell.
occurs_check(atom, changeable)
This flag controls unification that creates an infinite tree (also called cyclic term) and can have three values. Using false (default), unification succeeds, creating an infinite tree. Using true, unification behaves as unify_with_occurs_check/2, failing silently. Using error, an attempt to create a cyclic term results in an occurs_check exception. The latter is intended for debugging unintentional creations of cyclic terms. Note that this flag is a global flag modifying fundamental behaviour of Prolog. Changing the flag from its default may cause libraries to stop functioning properly.
on_error(atom, changeable)
Determines how to act on an error printed using print_message/2, i.e., an error that is reported to the user. The possible values are print (default), status and halt. Using halt the process halts immediately with status 1. Otherwise execution continues. Using status halt/0 exits with status 1 if one or more errors were printed by the process. In compile mode (see -c) the default is status. This flag can be set from the commandline using --on-error. See also section 4.3.2.1.
on_warning(atom, changeable)
As on_error, but for warnings. The default is always print. The commandline option is --on-warning.
open_shared_object(bool)
If true, open_shared_object/2 and friends are implemented, providing access to shared libraries (.so files) or dynamic link libraries (.DLL files).
optimise(bool, changeable)
If true, compile in optimised mode. The initial value is true if Prolog was started with the -O command line option. The optimise flag is scoped to a source file.

Currently optimised compilation implies compilation of arithmetic, and deletion of redundant true/0 that may result from