Prolog flags
A flag is an atom with an associated value. The following flags are supported currently:
- compiling: Instruct the compiler on what type of code to generate. This flag has three different values: compactcode (default), debugcode and profilecode.
- debug: Turn on or off the debugger.
- double_quotes: Possible values are chars, codes, and atom, and the default is codes. If the value is codes, then a string is represented as a list of codes; if chars, then a string is represented as a list of characters; and if atom, then a string is represented as an atom.
- gc: Turn on or off the garbage collector (see Garbage collection).
- gc_threshold: Set a new threshold constant (see Garbage collection).
- macro_expansion: Possible values are on and off, and the default value is on. Macroes (predicates defined with single clauses) in a program are expanded when compiled if this flag is on.
- max_arity: The maximum arity of structures (65535).
- max_integer: The maximum integer (268435455).
- min_integer: The minimum integer (-268435456).
- redefine_builtin:
The flag value can be either on or off. If it is on, then built-in predicates can be redefined; otherwise, cannot. The default value is off.
- singleton:
This flag governs whether or not warning messages about singleton variables will be emitted. The value is either on or off, and the default value is on.
- warning:
This flag governs whether or not warning messages will be emitted in general. The value is either on or off, and the default value is on.
- contiguous_warning:
This flag governs whether or not warning messages will be emitted when a program that contains discontiguously prefined predicates is compiled or consulted. The value is either on or off, and the default value is on.
- stratified_warning:
This flag governs whether or not warning messages will be emitted when a tabled program is compiled that contains undefined predicates. For a tabled program in a file, all predicates defined outside the file must be stratified, i.e., they cannot form a negative loop with any predicate defined in the file. The value is either on or off, and the default value is on.
- unknown:
The value is either fail, meaning that calls to undefined predicates will be treated as failure, or error, meaning that an exception will be raised. The default value for the flag is error.
You can change the value of a flag to affect the behavior of the system and access the current value of a flag.
- set_prolog_flag(Flag,Value):
Set value of Flag to be Value.
- current_prolog_flag(Flag,Value):
Value is the current value of Flag.
Neng-Fa Zhou
2012-01-03