From the point of view of REL, such a variable is a
`constant' changeably associated with a term.

Global variables are useful in REL in two situations:

when computed values have to live longer than a query (this
is usually the case for programs with user interaction and/or
operating system access)

when computed values have to survive backtracking

The second situation occurs when all solutions of a query have to be
collected: bagof in PROLOG
or tupof in RELFUN.

In pure PROLOG and RELFUN, it is impossible to collect all solutions of a query:
intermediate results are reset when backtracking occurs,
which is used to
generate the next solution; thus all computed values are lost.
In order to overcome this difficulty, bagof in PROLOG and
tupof in RELFUN were introduced.

These extra-logicals can easily be implemented via global variables: a global
variable holds a stack of lists containing the intermediate results
(a stack is necessary because it is possible that in the
execution of a tupof another tupof call occurs).