File "session"
This file provides a Prolog REPL aka top-level. The top-level can
be started via the predicate prolog/0. It will repeatedly shows a
prompt “?- “, read a query and show the answer substitutions until
end_of_file is reached. The prompt can be used to issue Prolog
commands such as the make/0 utility, that automatically reconsults
modified files.
The file also provides an interactive debugger. The interactive
debugger can be invoked by the recognized top-level command
trace/0. The interactive debugger is implemented by means of meta
programming and therefore might executed slower than call/1. As a
main feature it allows inspecting the Byrd Box model by
interactive prompts at the ports.
The following session predicates are provided:
- abort:
- The predicate signals to abort the current query.
- exit:
- The predicate signals to abort the current session.
- make:
- The predicate ensures that all used Prolog text sources are
reloaded if their last modified has changed, or removed if they
are not anymore used
- version:
- The predicate succeeds. As a side effect, a banner is printed.
- prolog:
- The predicate succeeds. As a side effect, a REPL is run. The
following commands are available upon a port prompt:
- ;⏎: Creep to next port or answer substitution.
- ⏎: Terminate the current query.
- The following top-level commands are recognized:
trace: (top-level command)
- When used as a first goal in the top-level the subsequent
goals are run inside an interactive Byrd Box debugger. The port
prompts show the current goal using the variable names from the
top-level. The following commands are then available:
- a⏎: Abort the debugger and return to top-level.
- l⏎: Leap to the next answer substitution.
- s⏎: Skip to the next port of the current goal.
- ⏎: Creep to next port or answer substitution.