Implementation defined hooks

This predicate enables a program to find the current value for any flag, and to change the current value of some flags.

Whatever happens when a processor executes the predicates halt/0 and halt/1 is completely implementation dependent.

1. set_prolog_flag/2

A goal set_prolog_flag(Flag, Value) enables the value associated with a Prolog flag to be altered.

Templates and modes for the predicate are as follows:

set_prolog_flag(+flag, @nonvar)

1.1 Example tests

Let's start with some tests verifying success or failure of single goals.

Goal Theory success(String goal,String theory)
set_prolog_flag(unknown, fail). null false

The remaining tests cover the cases when an error or exception is thrown by the engine while solving a query.

Tests With Exception

Goal Theory success(String goal) Type Of Error
set_prolog_flag(X, off). null true
set_prolog_flag(5, decimals). null true
set_prolog_flag(date, 'July 1988'). null true
set_prolog_flag(debug, trace). null true

2. current_prolog_flag/2

current_prolog_flag(Flag, Value) is true iff Flag is a flag supported by the processor, and Value is the value currently associated with it.

Templates and modes for the predicate are as follows:

current_prolog_flag(?flag, ?term)

current_prolog_flag(Flag, Value) is re-executable.

2.1 Example tests

Let's start with some tests verifying success or failure of single goals.

Goal Theory success(String goal,String theory)
current_prolog_flag(debug, off). null true

Goal Theory success(String goal,String theory)
current_prolog_flag(F, V). null false

Tests With Exception

Goal Theory success(String goal) Type Of Error
current_prolog_flag(5, _). null true