![]() |
21 October 2005
Please see below.
InterProlog installation does not require a compilation, as it can be installed by copying a directory and editing one file; but the Prolog system(s) to use may need to be compiled, namely under Unix. InterProlog is compatible with Windows XP/2000, Mac OS X and Linux. It requires Java 1.4 and either XSB Prolog 2.7.x, SWI 5.4.x or YAP 5.x.
Please follow the steps below for your system:
Step |
Comments |
Windows 2000, XP |
Mandrake Linux 10.2, Mac OS X |
1 |
The Java Runtime Environment will be sufficient if you don't plan to write any Java code AND you're using Windows. Otherwise you need the Java Development Kit |
Download J2SE from java.sun.com site (preferably version 1.4 or later), http://java.sun.com/j2se/1.4.2/download.html, and install it some directory MY_JAVA_DIR in your disk | |
See if it works in a command shell window, by typing MY_JAVA_DIR\bin\java -version | See if it works in a command shell window, by typing MY_JAVA_DIR/bin/java -version | ||
You should obtain something like this:
|
|||
Write down (or copy into the clipboard...) the path MY_JAVA_DIR.....bin, the directory where the java executable is. We'll use this below to define the JAVA_BIN environment variable | |||
2YAP |
You need to install either XSB Prolog or/and SWI Prolog or/and YAP Prolog |
To get and install XSB Prolog
2.7.1 with
built-in InterProlog support (interfacing through both sockets and JNI) follow these
instructions. XSB Prolog 2.6 is no longer supported, fall back to
InterProlog 2.1.1 if you must use it.
To get and install SWI Prolog (interfacing through sockets, no JNI) just install the standard version (5.4.6 or later) To get and install YAP Prolog (interfacing through sockets, no JNI) just install the standard version (5.0 or later) |
|
Write down (or copy into the clipboard...) the paths for the directories containing the executable images of Prolog. We'll use this below to define the XSB_BIN_DIRECTORY, SWI_BIN_DIRECTORY and YAP_BIN_DIRECTORY environment variables (or just one of them if you only need one Prolog). These will typically be something like |
|||
XSB_DIR...config.....bin SWI_DIR...bin \Program Files\Yap\bin |
XSB_DIR...config.....bin
/usr/lib/SWI_DIR/bin/i686-linux For Yap, /usr/bin |
||
3 |
InterProlog is installed by copying a file tree and editing some environment variables in a text file | Download the InterProlog zip file from here, which includes this page, and expand it into somewhere in your disk | |
Look into the windowsScripts directory. Edit windowsVariables.bat, changing the variables JAVA_BIN, XSB_BIN_DIRECTORY and/or SWI_BIN_DIRECTORY and/or YAP_BIN_DIRECTORY to the values you got in the install steps above |
Look into the unixScripts directory. Edit unixVariables.sh, changing the variables JAVA_BIN, XSB_BIN_DIRECTORY and/or SWI_BIN_DIRECTORY and/or YAP_BIN_DIRECTORY to the values you got in the install steps above Mac OS X note: uses some different system directory arrangements take a look at MacOSXVariables.sh for inspiration Make sure the script files are executable: |
||
That's it :-) See if it works by running a run....listener.bat scripts (./run...listener.sh in Unix). A Java window with a Prolog listener should appear, looking perhaps like this: Alternatively, if you're using XSB Prolog you can try the Sudoku puzzle editor/solver (change directory separators to / under Unix)
See the sources in com/declarativa/interprolog/examples for more information; subdirectory SudokuPuzzles contains... puzzles, in a simple Prolog format. If you installed ALL Prologs supported by InterProlog (currently
XSB, SWI and YAP), you can optionally run the standard test suite, using
the script
If things don't go well: first make sure the steps above were done properly; then open a command shell window, cd to the interprolog212 directly, run the failing script with -debug afterwards, and email the console log to interprolog@declarativa.com For example, to make runSWISPlistener.bat report debugging information edit the command line to
|
|||
4Using it |
For Prolog development, use
runXXXSPListener, which acts as a
simple graphical front-end to the full Prolog system through a
SubprocessEngine (using sockets), allowing you to get
multiple solutions, Prolog textual I/O etc. runNativeListener uses
the JNI interface (currently available only for XSB Prolog), which lacks
the traditional top level Try some Prolog goals, such as Some documentation:
|
Please let us know what you're using it for: interprolog@declarativa.com. Enjoy!
Miguel Calejo
Declarativa
SubprocessEngine
is now an abstract class, to accomodate the support of multiple Prolog implementations. The "old" SubprocessEngine is now
XSBSubprocessEngine
toString(PrologEngine engine)
in class TermModel, uses the standard startup (not necessarily current) operator definitions for the engine, rather than the common (engine) subset.PrologEngine.consultAbsolute(File)
: consults a Prolog file from an absolute path interprolog.defs
(a Properties file in the format described in
http://java.sun.com/j2se/1.4.2/docs/api/java/util/Properties.html
, in the directory where the jar file containing the InterProlog classes is) or in the global properties (by using the -D java switch). The properties should include XSB_BIN_DIRECTORY and/or
SWI_BIN_DIRECTORY, depending on which Prolog(s) you're usingNativeEngine
now requires as argument (either explicitly or implicitly through the above Properties mechanism) the path to the XSB binary directory as the constructor argument, rather than the base directory as before, to simplify configuration; notice that this has more information than the base directory, eg for XSB it embbeds the consequence of being in a certain operating system. PrologEngine
and subclasses,
loadFromJar. InterProlog startup files can now be loaded either from the jar file (as before) or from
classname-relative locations in the file system: interprolog.P from
...com/declarativa/interprolog/{xsb or swi} and visualization.P from
...com/declarativa/interprolog/gui/ . Loading from the file system can be useful while fiddling with InterProlog itself and testing changes to these files. There's a simple command line argument
("-nojar") that can be used in listener invocation scripts, see
ListenerWindow.commonMain().Use at your own risk; bug reports welcome except for the following.
long
then an actual parameter
with int
is not acceptable), only of object
types (e.g. the actual parameter can be a subclass of the formal parameter).