YAP Thread-local flags

Prolog flags that can take different values in different threads and/or modules.

Var:

1. allow_variable_name_as_functor: : Allow constructs such as 'Functor( V )'.

Functor is parsed as an atom. The token V is still understood as a variable.

Originally a SWI-Prolog flag.

1. autoload: : set the system to look for undefined procedures

1. break_level: : read-only flag, that tells if Prolog is in an inner top-level

1. call_counting: : Predicates compiled with this flag set maintain a counter on the numbers of proceduree calls and of retries.

These counters are decreasing counters, and they can be used as timers. Three counters are available:

calls: number of predicate calls since execution started or since system was reset; retries: number of retries for predicates called since execution started or since counters were reset;

calls_and_retries: count both on predicate calls and retries. These counters can be used to find out how many calls a certain goal takes to execute. They can also be force the computation to stop.

1. compiler_skip: : read-write flag, that allows skipping files

1. compiler_top_level: : read-write flag, that allows changing the compiler top_level if Prolog is in an inner top-level

1. compiling: : Indicates YAP is running within the compiler.

1. debug: : whether debugging is true or false.

If Value is bound to true enable debugging, and if it is bound to false disable debugging.

1. encoding: : support for coding systens, YAP relies on UTF-8 internally.

1. file_errors: : exit if failing to open a fail generates an excption; or fail otherwise.

1. language_mode: : whether native mode or trying to emulate a different Prolog.

1. open_expands_filename: : obtain the absolute file name before loading a file.

1. stream_type_check: : verify whether the stream was open correctly.

1. syntax_errors: : Control action to be taken after syntax errors when executing read_49 "read/1", \@ref read_50 \@"read/2", or \@ref read_term_51 \@"read_term/3":

  • dec10 Report the syntax error and retry reading the term.

  • fail Report the syntax error and fail.

  • error Report the syntax error and generate an error (default).

  • quiet Just fail

1. trace: : If this flag is true and debugging is true, YAP will debug at the next query.

1. typein_module: : If bound, set the current working or type-in module to the argument, which must be an atom.

If unbound, unify the argument with the current type-in module, that is, with the module YAP will execute goals by default.

1. verbose: : If normal allow printing of informational and banner messages, such as the ones that are printed when consulting.

If silent disable printing these messages. It is normal by default 1except if YAP is booted with the -q or -L flag.

1. verbose_file_search: : If true allow printing of informational messages when searching for file names.

If false disable printing these messages. It is false by default.

1. verbose_load: : If true allow printing of informational messages when consulting files.

If false disable printing these messages. It is true by default except if YAP is booted with the -L or L flags.

1. user_error: : If the second argument is bound to a stream, set user_error to this stream.

If the second argument is unbound, unify the argument with the current user_error stream. By default, the user_error stream is set to a stream corresponding to the Unix stderr stream. The next example shows how to use this flag:


 ?- open( '/dev/null', append, Error,
 [alias(mauri_tripa)] ).
 Error = '$stream'(3) ? ;
 no
 ?- set_prolog_flag(user_error, mauri_tripa).
 close(mauri_tripa).
 yes
 ?-

We execute three commands. First, we open a stream in write mode and give it an alias, in this case mauri_tripa. Next, we set user_error to the stream via the alias. Note that after we did so prompts from the system were redirected to the stream mauri_tripa. Last, we close the stream. At this point, YAP automatically redirects the user_error alias to the original stderr.

1. user_input: : If the second argument is bound to a stream, set user_input to this stream.

If the second argument is unbound, unify the argument with the current user_input stream. See the user_error_flag for more details.

1. user_output: : If the second argument is bound to a stream, set user_output to this stream.

If the second argument is unbound, unify the argument with the current user_output stream.