Templates
Description
set_prolog_flag(Flag, Value) sets the value of the Prolog flag Flag to Value.
Prolog flags: a Prolog flag is an atom which is associated with a value that is either implementation defined or defined by the user. Each flag has a permitted range of values; any other value is a domain_error. The following two tables present available flags, the possible values, a description and if they are ISO or an extension. The first table presents unchangeable flags while the second one the changeable flags. For flags whose default values is machine independent, this value is underlined.
Unchangeable flags:
Flag | Values | Description | ISO |
an atom | name of the Prolog system | N | |
an atom | version number of the Prolog system | N | |
an atom | date of the Prolog system | N | |
an atom | copyright message of the Prolog system | N | |
an atom | fixed to gprolog | N | |
an integer | Major * 10000 + Minor * 100 + Patch | N | |
a structure | gprolog(Major,Minor,Patch,Extra) | N | |
true / false | are integers bounded ? | Y | |
an integer | greatest integer | Y | |
an integer | smallest integer | Y | |
toward_zero
down | Y | ||
an integer | maximum arity for compound terms (255) | Y | |
an integer | maximum number of atoms | N | |
an integer | maximum number of successive ungets | N | |
an atom | GNU Prolog home directory | N | |
an atom | Operating System identifier | N | |
an atom | Operating System vendor | N | |
an atom | processor identifier | N | |
an atom | a combination of the OS-vendor-cpu | N | |
an atom | a combination of the OS-cpu | N | |
an integer | address size of the machine (32 or 64) | N | |
on/off | is the architecture an Unix-like OS ? | N | |
an atom | compilation date using __DATE__ and __TIME__ C compiler macros | N | |
an atom | C compiler used to compile GNU Prolog (gcc, cc, clang, cl,...) | N | |
a structure | c_cc(Major,Minor,Patch,Extra) | N | |
an atom | CFLAGS used to compile GNU Prolog | N | |
an atom | LDFLAGS used to compile GNU Prolog | N | |
a list of atoms | list of command-line arguments | N |
Changeable flags:
Flag | Values | Description | ISO |
on / off | is
character conversion activated ? | Y | |
on / off | warn about named singleton variables ? | N | |
on / off | warn about suspicious predicate ? | N | |
on / off | warn about unsupported multifile directive ? | N | |
on / off | strict ISO behavior ? | N | |
on / off | is the debugger activated ? | Y | |
atom chars codes atom_no_escape chars_no_escape codes_no_escape | Y N | ||
atom chars codes atom_no_escape chars_no_escape codes_no_escape | a back quoted constant is returned as:
an atom a list of characters a list of character codes as atom but ignore escape sequences as chars but ignore escape sequences as code but ignore escape sequences | N | |
error warning fail | a predicate calls an unknown procedure:
an existence_error is raised a message is displayed then fails quietly fails | Y | |
error warning fail | a predicate causes a syntax error:
a syntax_error is raised a message is displayed then fails quietly fails | N | |
error warning fail | a predicate causes an O.S. error:
a system_error is raised a message is displayed then fails quietly fails | N |
The strict_iso flag is introduced to allow a compatibility with other Prolog systems. When turned off the following relaxations apply:
Errors
Flag is a variable | instantiation_error | |
Value is a variable | instantiation_error | |
Flag is neither a variable nor an atom | type_error(atom, Flag) | |
Flag is an atom but not a valid flag | domain_error(prolog_flag, Flag) | |
Value is inappropriate for Flag | domain_error(flag_value, Flag+Value) | |
Value is appropriate for Flag but flag Flag is not modifiable | permission_error(modify, flag, Flag) | |
Portability
ISO predicate. All ISO flags are implemented.
Templates
Description
current_prolog_flag(Flag, Value) succeeds if there exists a Prolog flag that unifies with Flag and whose value unifies with Value. This predicate is re-executable on backtracking.
Errors
Flag is neither a variable nor an atom | type_error(atom, Flag) | |
Flag is an atom but not a valid flag | domain_error(prolog_flag, Flag) | |
Portability
ISO predicate.
Templates
Description
set_bip_name(Functor, Arity) initializes the context of the error (section 6.3.1) with Functor and Arity (if Arity < 0 only Functor is significant).
Errors
Functor is a variable | instantiation_error | |
Arity is a variable | instantiation_error | |
Functor is neither a variable nor an atom | type_error(atom, Functor) | |
Arity is neither a variable nor an integer | type_error(integer, Arity) | |
Portability
GNU Prolog predicate.
Templates
Description
current_bip_name(Functor, Arity) succeeds if Functor and Arity correspond to the context of the error (section 6.3.1) (if Arity < 0 only Functor is significant).
Errors
Functor is neither a variable nor an atom | type_error(atom, Functor) | |
Arity is neither a variable nor an integer | type_error(integer, Arity) | |
Portability
GNU Prolog predicate.
Templates
Description
write_pl_state_file(FileName) writes onto FileName all information that influences the parsing of a term (section 8.14). This allows a sub-process written in Prolog to read this file and then process any Prolog term as done by the parent process. This file can also be passed as argument of the --pl-state option when invoking gplc (section 4.4.3). More precisely the following elements are saved:
read_pl_state_file(FileName) reads (restores) from FileName all information previously saved by write_pl_state_file/1.
Errors
FileName is a variable | instantiation_error | |
FileName is neither a variable nor an atom | type_error(atom, FileName) | |
an operating system error occurs and the value of the os_error Prolog flag is error (section 8.22.1) | system_error(atom explaining the error) | |
Portability
GNU Prolog predicate.