[Next]
[Up]
[Previous]
[Contents]
Next: Language Reference
Up: Running Prolog
Previous: Command Line Options
  Contents
Prolog provides several directives that control the interpreter.
In this section we list them and drscribe how they work.
- #quit The #quit directive makes the interpreter stop running.
- #help The #help directive prints a help message explaining
basic commands.
- #type exp The #type directive typechecks its input
and, if the typechecking is successful, prints out a typing judgment
that shows the most general types of the expression's variables and names,
as well as the type of the expression itself.
- #trace n The #trace directive sets the trace level
of the interpreter, which is a number between 0 and 3 indicating how much
information is printed out during proof search. The default is
trace level 0, no information. Trace level 1 prints out each atomic goal
as it is solved, as well as backtracking information. Trace level 2 prints
out all goals. Trace level 3 prints out all attempted resolutions.
- #break sym The #break directive sets a breakpoint
at a given predicate named by sym. Execution will halt whenever a
successful resolution step with sym as its subject occurs. In concert
with #trace, this can be used for debugging. If no argument is
given, then all breakpoints are listed.
- #clear sym The #clear directive clears a breakpoint.
If no argument is given, all breakpoints are cleared.
- #use filename The #use directive instructs the intepreter to open and read
an external Prolog source file, processing all the declarations, clauses
and goals therein as if they had been typed at the interpreter prompt.
The main difference is that queries are printed out as they are executed
(to make the output more intelligible) and that the interpreter only looks
for at most one solution.
[Next]
[Up]
[Previous]
[Contents]
Next: Language Reference
Up: Running Prolog
Previous: Command Line Options
  Contents
James Cheney
2003-10-23