SWI-Prolog offers a query substitution mechanism called `history'.
The availability of this feature is controlled by set_prolog_flag/2,
using the history
Prolog flag. By default, history is available if the Prolog flag readline
false. To enable this feature, remembering the last 50
commands, put the following into your startup file (see section
:- set_prolog_flag(history, 50).
The history system allows the user to compose new queries from those typed before and remembered by the system. The available history commands are shown in table 1. History expansion is not done if these sequences appear in quoted atoms or strings.
|Repeat last query|
|Repeat query numbered <nr>|
|Repeat last query starting with <str>|
|Show history of commands|
|Show this list|
|Table 1 : History commands|