Declarativa Declarativa

Interprolog version 2.1.2

21 October 2005

Changes since last version

Please see below.

How to download and install

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

Java Technology Home Page

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:

java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)

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 
 

2

XSB Logo

YAP

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

Declarativa

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:
chmod a+x *.sh

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)

%JAVA_BIN%\java  -DXSB_BIN_DIRECTORY=%XSB_BIN_DIRECTORY%  -classpath ..\interprolog.jar com.declarativa.interprolog.examples.SudokuWindow

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 testit; when finished successfully (after about a couple of minutes in a 400MHz Pentium) the following window will appear:

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

%JAVA_BIN%\java -classpath %CLASSPATH%;..\interprolog.jar com.declarativa.interprolog.gui.SWISubprocessEngineWindow -debug

 

4

Using 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 browseTerm(vp(np(interprolog),verb(working))), which should display a tree. You may drag your Prolog source files into the listener window for consulting, or use the menu "File/Consult" . Edit the files with you favorite editor.

Some documentation:

Please let us know what you're using it for: interprolog@declarativa.com. Enjoy!

Miguel Calejo
Declarativa

Improvements over version 2.1.1

Improvements over version 2.03

Known limitations:

Use at your own risk; bug reports welcome except for the following.

The information and InterProlog software referred in this page are © Declarativa/XSB Inc. and are provided to you under the terms of the GNU Library License, no warranties, authorship reference mandatory etc. Other items are © their legitimate owners. For further or more actual  information please contact interprolog@declarativa.com