Changing or Querying System Parameters

Prolog flags enable you to modify certain aspects of Prolog's behavior, as outlined below. This is accomplished by using prolog_flag/3. If you simply want to query the value of a flag, use prolog_flag/2.

By using the prolog flags listed below, it is possible to:


Flag
Purpose
character_escapes
Enable or disable escaping of special characters in I/O operations. (See ref-syn-ces)
debugging
Turn on/off trace and debug mode by using prolog_flag/3 or by using the predicates trace/0, debug/0, notrace/0, and nodebug/0.
fileerrors
Set or reset the fileerrors flag by using prolog_flag/3 or by using the pair of predicates fileerrors/0 and nofileerrors/0.
gc
Turn on/off garbage collection by using prolog_flag/3 or by using the predicates gc/0 and nogc/0.
gc_margin
Set the number of bytes that must be reclaimed by a garbage collection in order to avoid heap expansion (not available on some systems; see ref-mgc)
gc_trace
Enable or disable diagnostic tracing of garbage collections.
multiple
on or off.
single_var
on or off.
syntax_error
Control Prolog's response to syntax errors. See ref-ere-err-syn.
unknown
Set the action to be taken on unknown procedures by using prolog_flag/3 or unknown/2 (see dbg-bas-con-unk). unknown/2 writes a message to user_output saying what the new state is. It is intended for use at the top level. prolog_flag/3 does not write a message. It is intended for use in code.

For further details, see the reference page. Also see ref-mgc for more detailed descriptions of the garbage collection flags.

To inspect the value of a flag without changing it, one can say

     | ?- prolog_flag(FlagName, Value).
     

You can use prolog_flag/2 to enumerate all the FlagNames that the system currently understands, together with their current values.