current_prolog_flag(?flag, ?term) [ISO]

With this built-in predicate  the value of a processor flag can be queried. The predicate is re-executable if the Flag parameter is a variable.

see also: database views // /2 rem/2 set_prolog_flag/2 show_console/0 

The possible Prolog flags are:

Flag name Possible return values Description
bounded true Integer arithmetic is bounded, there is a minimum and maximum integer (ISO).
dbview immediate, logical Returns the current view mode of the database, for more information see: the database views. (not standard prolog)
debug on, off this flag has no effect in Trinc-Prolog (ISO).
double_quotes chars, codes, atom This flag has effect how double quoted lists are prepared for execution. If the value is chars a double quoted list is input as a list of one character atoms. If the value is codes a double quoted list is input as a list of character codes and if the value is atom a double quoted list is input as an atom (ISO). The default value is atom.
char_conversion on, off If the value is on, unquoted characters in Prolog texts being prepared for execution or when inputting terms are converted according to the current character conversion table (ISO).
unknown error, warning, fail This flags determines the behavior of the Prolog processor when it encounters a goal for which no predicate exists (ISO).
  • error: an existence_error/2 exception is thrown
  • warning: a run-time warning is created and failing starts
  • fail: failing of the current clause is started.
integer_rounding_function down, toward_zero The results of the integer division operator and the integer remainder built-in-clause are always rounded toward zero or rounded down. Trinc-Prolog always rounds toward zero (ISO).
max_arity <a positive integer> Returns the maximum number of arguments for a functor of a clause (ISO).
max_integer <an integer> The largest integer possible is returned (ISO).
min_integer <an integer> The smallest integer possible is returned (ISO).
max_float <a floating point number> The largest floating point number possible is returned. (not standard prolog)
min_float <a floating point number> The smallest float is returned. (not standard prolog)
max_printdepth <a positive integer> Returns the maximum depth Trinc-Prolog will go to while converting an internal expression to a string, per value of a variable printed the level is incremented with 1 (not standard prolog).
max_matchdepth <a positive integer> Returns the maximum depth Trinc-Prolog will go to while matching two expressions (not standard prolog).
unknown error, warning, fail Indicates the response of the prolog processor after it encounters a goal for which there is no predicate (ISO).
console_newline on, off This flag controls if the console window will remove newline characters or leave them in the input stream of the console window. The default value of this flag is on; newline characters are inserted into the input stream.
see also: show_console/0 clear_console/0 prolog streams
iso_prolog on, off This flag determines if the ISO Prolog mode is on or off. If this mode is on then only built-in predicates defined in the ISO Prolog standard are recognized as built-in predicates and the OO extensions of Trinc-Prolog are regarded as syntax errors.
lco on, off This flag determines if the last-call optimization is on or off. If this optimization is on then Trinc-Prolog will attempt to detect if a certain goal can be redone and if this is not the case then it will remove choicepoints for that goal from the inference stack. Enabling this optimization can reduce the amount of memory required for proving a goal.
num_digits <a positive integer> Set the maximum number of digits for converting a floating-point number to a string. This is done if the result of an arithmetic expression is converted to a readable representation. This parameter thus determines how many characters are used for representing a number, the default value is 15. This value must be increased when working with very large numbers.
argument_indexing on, off Check if argument indexing optimalisation is on or off. If argument indexing is on then clauses that for certain will cause a mismatch with the current goal are not considered. This option will speed up program execution.
max_send_http_server < integer larger than 0> The maximum number of attempts for sending a request for proving a goal to a HTTP server. The default number is 3.
print_double_quotes <none> Provided for backwards compatibility but has no effect anymore since R3B.
expand_backslash <none> Provided for backwards compatibility but has no effect anymore since R3B.

The maximum print depth and the maximum match depth protect the prolog processor from infinite recursive expressions while it is matching two expressions or printing an expression.

Exceptions  
Flag is neither a variable nor an atom a type_error(atom, Flag) exception is thrown

 

 

info@trinc-prolog.com