User Session

The query answer loop of the Prolog interpreter repeatedly prompts a query and answers it by showing the variable bindings. The query answer loop can be entered recursively by the predicate break/0, or its synonym prolog/0. The query answer loop can be terminated by issuing an end of file. The query answer loop runs in its own input / output stream pair.

The system predicates abort/1, exit/1 and close/1 throw some well-known system errors. The system predicate exit/1 allows terminating the query answer loop similarly like issuing an end of file. The system predicate abort/1 only terminates the current query but continues the loop. The system predicate close/1 recursively terminates all query answering loops.

Top-level answers are displayed with the operator (=)/2. For custom forms delivered by a printable hook the operator (is)/2 is displayed. For custom constraints delivered by an equation hook the corresponding operator is displayed. For printable and equation hooks see the module residue.

The following user session predicates are provided:
prolog:
break:
The predicate prompts and answers queries until an end of file is encountered.
abort:
The predicate throws a system error of type user abort.
exit:
The predicate throws a system error of type user exit.
close:
The predicate throws a system error of type user close.

The following Prolog flags for user sessions are provided:

sys_attached_to:
The legal value is a graphic interface component per interpreter. The type depends on the current platform and toolkit. The value can be changed.
sys_belongs_to:
The legal value is a graphic interface component per knowledge base. The type de-pends on the current platform and toolkit. The value can be changed.
sys_break_level:
The legal value is an integer. The value indicates the number of currently entered breaks. The value cannot be changed.

Kommentare