If the PrologJ system is started up by double-clicking the
prologj.jar file, or is started from the command line with the
-w[indow] option specified, a console window like the following is
displayed. The window can be used for interacting with the interpreter,
and a menu option is provided to allow compiling a file. Interactive user input
is typed in the main text area in the window, and program output is displayed
in this area as well.
The console window provides the following menus:
File menuOpen option can be used to load a database previously
saved using the Save option. An open file dialog is
displayed to allow the user to select a saved database to be loaded.
The library selection, predicate and operator definitions, flag and
character conversion settings, and loaded file and debugging state
read from the file completely replace the current values. The required
extension for a saved database is ".prs".Save option can be used to save a database to a file.
A save file dialog is displayed to allow the user to select the a
name for the file which will contain the saved database. Information
about the current library selection, current predicate and operator
definitions, current flag and character conversion settings, and the
current loaded file and debugging state is saved in the file. The
required extension for a saved database is ".prs".
asserta/1 are not saved on disk unless
explicitly saved by using this option.Quit option can be used to halt the PrologJ system.
Interpreter menuConsult option can be used to consult a source file.
An open file dialog is displayed to allow the user to choose a
source file to read, which is then processed as if by the built-in
predicate consult/1. The required extension for a Prolog
source file is ".pro".
Reconsult option can be used to reconsult a source file.
(The definition for any predicate that occurs in the file completely
replaces the existing definition for that predicate; but any predicate
not defined in the file is left unchanged.) An open file dialog is
displayed to allow the user to choose a source file to read, which is
then processed as if by the built-in predicate reconsult/1.
The required extension for a Prolog source file is ".pro".
Compiler menuCompile option can be used to compile a source file,
as described in the compiler documentation.
The compilation process is carried out in accordance with the
options specified by the remaining items in this menu.
The required extension for a Prolog source file is ".pro".
Java option is a checkbox option that controls whether
the compiler output is processed by javac to produce a
.class file (when this item is deselected - the default), or
whether the compilation process stops with the production of a Java
source file (when this item is selected). This checkbox is equivalent
to the command line -j[ava] option. Verbose option is a checkbox option that controls
whether verbose compiler output is produced. Verbose output, if
requested, is displayed in the console window. This checkbox is
equivalent to the command line -v[erbose] option.
Directory option can be used to specify a directory
to receive the compiler output (compiled .class file or
Java source code as the case may be.) When this option is selected,
a file dialog is displayed which allows the user to choose a directory.
If one is chosen, it becomes the directory for subsequent compiler
output, and this menu option is displayed as checked. (If the compiler
is producing a .class file as output, and the source file
contains a :- package/1 directive, the compiled file
will actually go into a subdirectory of the selected directory.) If the
user cancels the file dialog, the current working directory is used for
compiler output, and this menu option is displayed as unchecked.
This menu option is equivalent to the command line
-d[irectory] option. Library Components menu provides check-box options
allowing the user to enable/disable selected components of the library
of built-in predicates, as discussed in the
documentation for the built-in
predicates.Flags menu provides a single Show option
which displays a dialog box that shows - and allows the user to alter -
the settings of each of the changeable flags, and which simply shows
the settings of each of the unchangeable flags, as discussed in the
documentation for the flags. Once this dialog
box is displayed, it remains visible (and is updated whenever a flag's
value is changed) until the user dismisses it. (Note: the flags
denoting the availability of various library components are not
changeable through this dialog box, but are changed if changes are
made using the Library Components menu.)
Three buttons appear at the top of the window.
Clear button clears the text displayed in the console.
EOF button can be used to enter an end-of-file condition
to the console. If this button is pressed while consulting a file
interactively (as a result of entering the [user] command),
it terminates consultation mode and returns the console to interpretation
mode. If it is pressed while executing a break loop, it terminates the
break look and returns to the previous mode. If it is pressed when in
the "top level" interpretation loop, it terminates the program.
Abort button can be used to immediately terminate the
current computation. This includes computations started by choosing the
Consult, Reconsult, or Compile
menu options, as well as computations initiated by typing a goal or
file consultation command at the interpreter's ?- prompt.