Node:Top, Next:, Previous:(dir), Up:(dir)

SICStus Prolog Release Notes

Release notes for SICStus Prolog release 3.8.6, April 2001. Copyright 1988-2001 SICS, Sweden.

Permission is granted to make and distribute verbatim copies of these notes provided the copyright notice and this permission notice are preserved on all copies.

Permission is granted to copy and distribute modified versions of these notes under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one.

Permission is granted to copy and distribute translations of these notes into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by SICS.


Node:Overview, Next:, Previous:Top, Up:Top

Overview

These notes summarize the changes in release 3 wrt. previous SICStus Prolog releases as well as changes introduced by patch releases. Platform specific information pertaining to certain parts of the system are also documented herein.


Node:Release notes and installation guide for UNIX, Next:, Previous:Overview, Up:Top

Release notes and installation guide for UNIX

This chapter assumes that the environment variable PATH includes <prefix>/bin, where <prefix> points to the SICStus installation directory. The installation directory is specified during installation, see UNIX installation. For example:

csh,tcsh> setenv PATH "/usr/local/bin:$PATH"
sh,bash,ksh> export PATH="/usr/local/bin:$PATH"


Node:The Crypt Utility, Next:, Previous:Release notes and installation guide for UNIX, Up:Release notes and installation guide for UNIX

The Crypt Utility

The SICStus binary distributions are encrypted with the crypt program. If you do not have crypt on your machine, you can download a public domain crypt utility available via anonymous FTP from

ftp://ftp.sics.se/archive/sicstus3/aux/crypt.tar.gz

The enclosed README files describes how to compile it.


Node:UNIX installation, Next:, Previous:The Crypt Utility, Up:Release notes and installation guide for UNIX

Installation

Most users will install SICStus from a binary distribution. These are available for all supported platforms. Information on how to download and unpack the binary distribution is sent by email when ordering SICStus.

Binary distributions are installed by executing a interactive installation script called InstallSICStus. Type

% InstallSICStus

and follow the instructions on the screen.

During the installation, you will be required to enter your site-name and license code. These are included in the download instructions.

The installation program does not only copy files to their destination, it also performs final link steps for some of the executables and for the library modules requiring third-party software support (currently library(bdb), library(tcltk), and library(jasper)). This is done in order to adapt to local variations in installation paths and versions.

Compiling SICStus from the sources requires a source code distribution, available on request for customers with maintenance contract. Contact sicstus-support@sics.se for more info.

Instructions for compiling and installing SICStus from the source code is available in the files README and INSTALL in the source code distribution.


Node:UNIX foreign language interface, Next:, Previous:UNIX installation, Up:Release notes and installation guide for UNIX

Foreign language interface


Node:How to customize splfr, Next:, Previous:UNIX foreign language interface, Up:UNIX foreign language interface

How to customize splfr and spld

The utilities splfr and spld are implemented as Perl scripts and can be customized in order to adapt to local variations. Do not attempt this unless you know what you are doing. Customization is done by editing their common configuration file spld.config. Follow these instructions:

  1. Locate the configuration file spld.config. It should be located in the same directory as splfr and spld.
  2. Make a copy for spld.config, lets call it hacked_spld.config. Do not edit the original file.
  3. The configuration file contains lines on the form CFLAGS=-g -O2. Edit these according to your needs. Do not add or remove any flags.
  4. You may now use the modified spld.config together with spld or splfr like this
    % spld [...] --config=/path/to/hacked_spld.config
    
    Replace /path/to with the actual path to the hacked configuration file.


Node:How to create dynamic linked foreign resources manually, Next:, Previous:How to customize splfr, Up:UNIX foreign language interface

How to create dynamic linked foreign resources manually

To compile the glue code file and user code, use the compiler options assigned to INCR_CFLAGS (see spld.config) by ./configure. In addition also include -DSPDLL. To ensure an up-to-date compilation procedure run splfr with --verbose argument to see what it does.

The object files are then linked into a dynamic linked foreign resource. For this you will normally use the linker whose name was assigned to SHLD by ./configure and linker options assigned to SHLDFLAGS. The resource will consist of the file ResourceName.Suffix where Suffix is the value assigned to SHSFX by ./configure. The defaults are

SHLD= ld
SHLDFLAGS= -shared
SHSFX= so

E.g. on Sparc/SunOS 5.X:

% cc -c -DSPDLL glue_code.c
% cc -c -DSPDLL mycode.c
% ld -shared glue_code.o mycode.o -o myresource.so

Libraries needed by the resource should normally also be included in the link command line.


Node:Interfacing to Cplusplus, Next:, Previous:How to create dynamic linked foreign resources manually, Up:UNIX foreign language interface

Interfacing to C++

Functions in C++ files which should be called from Prolog must use C linkage, e.g.:

extern "C" {
void myfun(long i)
{...};
};

To build a dynamic linked foreign resource with C++ code, you may (depending on platform) have to explicitly include certain libraries. E.g., on Sparc/SunOS 5.X using gcc:

% splfr .... -LD -L/usr/gnu/lib/gcc-lib/sparc-sun-solaris2.4/2.7.0 -lgcc

The library path is installation dependent, of course.


Node:UNIX Runtime Systems on Target Machines, Previous:Interfacing to Cplusplus, Up:UNIX foreign language interface

Runtime Systems on Target Machines

This section describes how to distribute runtime systems on target machines, i.e., machines which do not have SICStus installed.

In order to build a runtime system for distribution on a target machine, the option --moveable must be passed to spld. This option prevents spld from hardcoding any paths into the executable.

Next, in order for SICStus to be able to locate all relevant files, the following directory structure is recommended.

myapp.exe
lib/
+--- libsprt38.so
+--- sicstus-3.8.6/
     +--- bin/
     |    +--- sprt.sav
     +--- library/
          +--- <files from $SP_PATH/library>

myapp.exe is typically created by a call to spld:

% spld --main=user --moveable [...] -o ./myapp.exe

In order for the executable to be able to locate sprt.sav, the variable SP_PATH needs to be set. If the example above is rooted in /home/joe, then SP_PATH should be set to /home/joe/lib/sicstus-3.8.6.

Unless the --static option is passed to spld, it might also be necessary to set LD_LIBRARY_PATH (or equivalent) to /home/joe/lib (in the example above) in order for the dynamic linker to find libsprt38.so. If the --static option is used, this is not necessary.


Node:Platform specific UNIX notes, Next:, Previous:UNIX foreign language interface, Up:Release notes and installation guide for UNIX

Platform specific notes

This section contains some installation notes which are platform specific under UNIX.


Node:Redistributable files UNIX, Previous:Platform specific UNIX notes, Up:Release notes and installation guide for UNIX

Files that may be redistributed with runtime systems

When a runtime system is redistributed to third parties, only the following files may be included in the distribution. All filenames are relative to <prefix>/lib/sicstus-3.8:

../*.{a,so,sl,dylib}
bin/sprt.sav
bin/jasper.jar
library/*.{tcl,po,pl}
library/*/*.{s.o,so,sl,dylib}
library/*/*.{po,pl}
sp_platform
(Located with InstallSICStus)


Node:Release notes and installation guide for Windows, Next:, Previous:Release notes and installation guide for UNIX, Up:Top

Release notes and installation guide for Windows

This chapter assumes that the environment variable PATH includes %SP_PATH%\bin, where SP_PATH points to the SICStus installation directory. For example:

C:\> set PATH=c:\Program Files\SICStus Prolog\bin;%PATH%

You may also want to include the paths to Tcl/Tk (see Tcl/Tk Notes), Java (see Getting Started), and Berkeley DB (see Berkeley DB notes).


Node:Windows Requirements, Next:, Previous:Release notes and installation guide for Windows, Up:Release notes and installation guide for Windows

Requirements


Node:Windows Installation, Next:, Previous:Windows Requirements, Up:Release notes and installation guide for Windows

Installation

The development system comes in two flavors:

  1. A console-based executable which is suitable to run from a DOS-prompt, from batch files, or under Emacs. See Command line editing.
  2. A windowed executable providing command line editing and menus.

The distribution consists of a single, self-installing executable (InstallSICStus.exe) containing development system, runtime support files, library sources, and manuals.

Installed files on a shared drive can be reused for installation on other machines.

SICStus Prolog requires a license code to run. You should have received from SICS your site name, the expiration date and the code. This information is normally entered during installation:

Expiration date: ExpirationDate
Site: Site
License Code: Code

but it can also be entered later on by executing the following commands at a command prompt:

% splm -i Site
% splm -a sicstus3.8 ExpirationDate Code


Node:Windows notes, Next:, Previous:Windows Installation, Up:Release notes and installation guide for Windows

Windows Notes


Node:Runtime Systems on Target Machines, Next:, Previous:Windows notes, Up:Windows notes

Runtime Systems on Target Machines

This section describes how to launch a runtime system on a so called target machine, i.e., a machine which does not have SICStus installed.

In order to locate all relevant files, the following directory structure is recommended.

myapp.exe
sprt38.dll
sp38\
+--- bin\
|    +--- sprt.sav
+--- library\
     +--- <files from %SP_PATH%\library>

myapp.exe is typically created by a call to spld:

% spld --main=user [...] -o ./myapp.exe

If the directory containing sprt38.dll contains a directory called sp38, SICStus assumes that it is part of a Runtime System as described in the picture. The runtime library (sprt.sav) is then looked up in the directory (sp38/bin), as in the picture. Furthermore, the initial library_directory/1 fact will be set to the same directory with sp38/library appended.

The directory structure under library/ should look like in a regular installed SICStus, including the platform-specific subdirectory (x86-win32-nt-4 in this case). If your application needs to use library(system) and library(random), your directory structure may look like:

myapp.exe
sprt38.dll
sp38\
+--- bin\
|    +--- sprt.sav
+--- library\
     +--- random.po
     +--- system.po
     +--- x86-win32-nt-4 \
          +--- random.dll
          +--- system.dll

The sp* files can also be put somewhere else in order to be shared by several applications provided the sprt38.dll can be located by the DLL search.

The 38 in the file names above is derived from SICStus's major and minor version numbers, i.e., currently 3 and 8. Naming the files with version number enables applications using different sicstus versions to install the sp* files in the same directory.


Node:Generic Runtime Systems, Next:, Previous:Runtime Systems on Target Machines, Up:Windows notes

Generic Runtime Systems

There are three ready-made runtime systems provided with the distributions, %SP_PATH%\bin\sprt.exe, %SP_PATH%\library\sprtw.exe, and %SP_PATH%\bin\sprti.exe. These are created using spld:

% spld --main=restore main.sav -o sprt.exe
% spld --main=restore main.sav -i -o sprti.exe
% spld --main=restore main.sav --window -o sprtw.exe

These are provided for users who do not have a C-compiler available. The programs launches a runtime system by restoring the saved state main.sav (created by save_program/[1,2]). If it was created by save_program/2, the given startup goal is run. Then, user:runtime_entry(start) is run. The program exits with 0 upon normal temination and with 1 on failure or exception.

The program sprti.exe assumes that the standard streams are connected to a terminal, even if they to not seem to be (useful under Emacs, for example). sprtw.exe is a windowed executable, corresponding to spwin.exe.

Note: the current working directory must be set to contain main.sav for these runtime systems to work. An easy way to achieve this is to use a short cut to start the runtime system. You can specify the working directory used as one of the properties of the the shortcut.

For more info on how spld works, see The spld utility.


Node:Setting SP_PATH under Windows, Previous:Generic Runtime Systems, Up:Windows notes

Setting SP_PATH under Windows

The use of the SP_PATH variable under Windows is discouraged, since Windows applications can find out for themselves where they were started from.

SP_PATH is only used if the directory where sprt<ver>.dll is loaded from does not contain sp<ver> (a directory) or sprt.sav (where <ver> is "38" for SICStus version 3.8(.x)). If SP_PATH is used, SICStus expects it to be set such that %SP_PATH%/bin contains sprt.sav. See Runtime Systems on Target Machines.


Node:Command line editing, Next:, Previous:Windows notes, Up:Release notes and installation guide for Windows

Command line editing

Command line editing supporting Emacs-like commands and IBMPC arrow keys is provided in the console-based executable. The following commands are available:

^h
erase previous char
^d
erase next char
^u
kill line
^f
forward char
^b
backward char
^a
begin of line
^e
end of line
^p
previous line
^n
next line
^i
insert space
^s
forward search
^r
reverse search
^v
view history
^q
input next char blindly
^k
kill to end of line

Options may be specified in the file %HOME%\spcmd.ini as:

Option Value

on separate lines. Recognized options are:

lines
Value is the number of lines in the history buffer. 1-100 is accepted; the default is 30.
save
Value is either 0 (don't save or restore history buffer) or 1 (save history buffer in %HOME%\spcmd.hst on exit, restore history from the same file on start up.

The command line editing is switched off by giving the option -nocmd when starting SICStus. Command line editing will be automatically turned off if SICStus is run with piped input (e.g., from Emacs).


Node:The console, Next:, Previous:Command line editing, Up:Release notes and installation guide for Windows

The console window

The console window used for the windowed executable is based on code written by Jan Wielemaker <jan@swi.psy.uva.nl>.

In SICStus 3.8 the console was enhanced with menu access to common prolog flags and file operations. Most of these should be self explanatory. The Reconsult item in the File menu reconsults the last file consulted with use of the File menu. It will probably be replaced in the future with something more powerful.

Note that the menus work by simulating user input to the prolog top level or debugger. For this reason it is recommended that the menus are only used when SICStus is waiting for a goal at the top-level (or in a break level) or when the debugger is waiting for a command.

Console Preferences

The stream-based console window is a completely separate library, using its own configuration info. It will look at the environment variable CONSOLE which should contain a string of the form name:value{,name:value} where name is one of:

sl
The number of lines you can scroll back. There is no limit, but the more you specify the more memory will be used. Memory is allocated when data becomes available. The default is 200.
rows
The initial number of lines. The default is 24.
cols
The initial number of columns. The default is 80.
x
The X coordinate of the top-left corner. The default is determined by the system.
y
The Y coordinate of the top-left corner. The default is determined by the system.

You will normally specify this in your autoexec.bat file. Here is an example:

% set CONSOLE=sl:600,x:400,y:400

Many of these settings are also accessible from the menu Settings of the console.


Node:Windows Emacs Interface, Next:, Previous:The console, Up:Release notes and installation guide for Windows

Emacs Interface

Choosing Send EOF from the menu seems to generate an eternal end of file state, typically causing SICStus to exit. Instead a C-d can be generated by typing C-q C-d. Alternatively you can enter the symbol end_of_file followed by a period.

Sometimes Send EOF from the menu or deleting the *prolog* buffer leaves a detached sicstus process running (not idle). You will have to terminate it with the task manager. The cause is an error in the SICStus interrupt handling code, present at least up to 3.8.6 (inclusive).


Node:Windows limitations, Next:, Previous:Windows Emacs Interface, Up:Release notes and installation guide for Windows

Limitations


Node:Redistributable files Windows, Previous:Windows limitations, Up:Release notes and installation guide for Windows

Files that may be redistributed with runtime systems

When a runtime system is redistributed to third parties, only the following files may be included in the distribution. All filenames are relative to %SP_PATH%:

bin\sprt.sav
bin\jasper.jar
bin\*.dll
bin\*.po
library\*.{tcl,po,pl,bas}
library\*\*.dll
library\*\*.{po,pl}


Node:Tcl/Tk Notes, Next:, Previous:Release notes and installation guide for Windows, Up:Top

Tcl/Tk Notes

Tcl/Tk itself is not included in the SICStus distribution. It must be installed in order to use the interface. It can be downloaded from the Tcl/Tk primary website:

http://dev.scriptics.com

The Tcl/Tk interface module included in SICStus Prolog 3.8 (library(tcltk)) is verified to work with Tcl/Tk 8.2 and 8.3 (with a few exceptions noted below). Previous versions of the interface have been verified to work with Tcl/Tk versions 7.3/3.6, 7.4/4.0, 7.5/4.1, 7.6/4.2, 8.0, and 8.1. The current version of the interface may or may not work with these versions.

Under UNIX, the installation program automatically detects the Tcl/Tk version (if the user does not specify it explicitly). The distributed files are compiled for Tcl/Tk 8.3.

Under Windows, the binary distribution is compiled against Tcl/Tk 8.2. If you need to use another version of Tcl/Tk you have to recompile library(tcltk), see Configuring the Tcl/Tk library module under Windows. Note: You need to have the Tcl/Tk binaries accessible from your PATH environment variable, e.g., C:\Program Files\Tcl\bin".

Note: The Tcl/Tk interface module is not supported under: Mac OS X Server

As of SICStus Prolog 3.8.1 Tcl_FindExecutable("") is called when the tcltk library is loaded, before any Tcl/Tk interpreter is created. This should fix errors related to not finding init.tcl and also improve support for international character sets.


Node:The TclTk Terminal, Previous:Tcl/Tk Notes, Up:Tcl/Tk Notes

The Tcl/Tk Terminal Window

The Tcl/Tk interface includes a experimental terminal window based on Tcl/Tk. It is opened by using the (undocumented) predicate:

tk_terminal(Interp, TextWidget, InStream, OutStream, ErrStream)
Given a TextWidget, e.g. .top.myterm, this predicate opens three prolog streams for which the text widget acts as a terminal.

There is also a library(tkconsol), making use of tk_terminal/5, which switches the Prolog top level to a Tk window. This is done by simply loading the library module.


Node:Jasper Notes, Next:, Previous:Tcl/Tk Notes, Up:Top

Jasper Notes


Node:Supported Java Versions, Next:, Up:Jasper Notes

Supported Java Versions

Jasper requires at least Java 2 (a.k.a. JDK 1.2) to run. Except on Windows the full development kit, not just the JRE, is needed. Jasper does not work with Visual J++ or Visual Café. Unless indicated otherwise you can download the JDK from <http://www.javasoft.com>.

Jasper is only supported under the following configurations:


Solaris 2.x (SPARC and x86)
JDK 1.2
Verified using Sun's JDK 1.2.2_06, earlier versions of 1.2 are also expected to work.
JDK 1.3
JDK 1.3 is now supported with some limitations, see the Linux entry below.
JDK 1.3.1
JDK 1.3.1 is now supported, see the Linux entry below.

Linux (x86)
JDK 1.2
Verified using Blackdown's JDK (Version 1.2.2 FCS for Linux). Downloadable from http://www.blackdown.org/java-linux.html.

Sun's JDK 1.2.2 does not support native threads and therefore does not work.

JDK 1.3.0_02
Other versions of JDK 1.3 are also expected to work.

JDK 1.3 uses signals in a way that are incompatible with the way signals are used by the sicstus development executable (sicstus). Most of the signal handlers used by (sicstus) are now turned off automatically before library(jasper) starts Java. This appear to make JDK 1.3 work with the sicstus development system. However, according to the JDK 1.3 documentation this may still cause problems. In JDK 1.3.1 the problem with conflicting uses of signals was recognized and a Java initialization option was added to reduce Java's use of signals, see the JDK 1.3.1 item below.

Note that this is a problem only with development systems. SICStus run-time systems does not use signals and for this reason JDK 1.3 works, e.g., when embedding SICStus in Java using the Jasper package.

JDK 1.3.1
Tested with JDK 1.3.1 beta 1. JDK 1.3.1 uses signals in the same way as JDK 1.3 resulting in the same conflicts with the sicstus development system as described above. However, JDK 1.3.1 supports the option -Xrs which makes JDK use signals in a way that is compatible with the sicstus development system.

There are several ways to pass this flag to Java. The recommended way is to pass it with jasper_initialize:

bash> sicstus -m
...
| ?- use_module(library(jasper)),
     jasper_initialize(['-Xrs', <other options here>], JVM).
Alternatively you can pass it using the (not documented in the JDK documentation) environment variable _JAVA_OPTIONS:
bash> export _JAVA_OPTIONS='-Xrs'
bash> sicstus -m
Using _JAVA_OPTIONS is currently the only way to pass this flag if you rely on the automatic Java initialization done when invoking a Java foreign resource.

Note that, also for JDK 1.3.1, this is only a problem with sicstus development system.


Windows 95/98/NT/2000
Verified using Sun's JDK 1.3 and JDK 1.2.2.
Other platforms
JDK 1.3 appears to be mature enough and widespread enough to make it feasible to support on other SICStus platforms as well if required. Your input on this issue is much appreciated, especially if you are familiar with linker issues and JDK installation on the platform in question.


Node:Getting Started, Next:, Previous:Supported Java Versions, Up:Jasper Notes

Getting Started

This section describes some tips and hints on how to get the interface started. This is actually where most problems occur.

Windows

Under Windows, it is recommended that you add SICStus's and Java's DLL directories to your %PATH%. This will enable Windows library search method to locate all relevant DLLs. For SICStus, this is the same as where sicstus.exe is located, usually C:/Program Files/SICStus Prolog/bin). For Java it is usually C:\jdk1.3\jre\bin\hotspot and C:\jdk1.3\bin (for JDK 1.2.2 it would be C:\jdk1.2.2\jre\bin\classic and C:\jdk1.2.2\bin).

For example (Windows NT):

set PATH=C:\jdk1.3\jre\bin\hotspot;C:\jdk1.3\bin;%PATH%
set PATH=C:\Program Files\SICStus Prolog\bin;%PATH%

Unix

When library(jasper) is used to embed Java in a SICStus development system or run-time system then the run-time linker needs to be told where to find the Java libraries (e.g., libjvm.so). During installation InstallSICStus will build the sicstus executable so that it contains the necessary information.

If you use spld to relink sicstus or to build a run-time system you can use the command line option --resource=-jasper. This tells spld to include the search path (rpath) in the executable needed to ensure that library(jasper) can find the Java libraries.

If you want to run sicstus with another Java than what was specified during installation you can use spld without the --resources option to get a sicstus executable without any embedded Java paths. In this case you need to set the environment variable LD_LIBRARY_PATH (or similar) appropriately. One example of this is to use the JDK 1.3 server version instead of the default (client) version.

Alternatively you can use the spld with both the --resource=-jasper option and --with-jdk=DIR to generate a development system with embedded paths to another Java directory tree.

Running Java from SICStus

If SICStus is used as parent application, things are usually really simple. Just execute the query | ?- use_module(library(jasper)).. After that, it is possible to perform meta-calls as described in Jasper Library Predicates, or load a foreign resource containing foreign(...,java,...) predicates.

On Unix, you may encounter the following error message:

% sicstus
SICStus 3.8 (sparc-solaris-5.5.1): Wed Sep 22 08:42:14 MET DST 1999
Licensed to SICS
| ?- use_module(library(jasper)).
[...]
{SYSTEM ERROR: 'Attempted to load Java engine into sbrk\'d
SICStus system (try starting SICStus with -m option)'}
[...]

Since most platforms don't allow sbrk() and malloc() (or threads) to coexist peacefully, SICStus refuses to load the JVM if not the -m flag was given to SICStus. The message can, as the error message suggests, be avoided if sicstus is started with the -m flag:

% sicstus -m
The -m flag is neither needed, nor recommended, on Windows.

Running SICStus from Java

If Java is used as parent application, things are a little more complicated. There are a couple of things which need to be taken care of. The first is to specify the correct class path so that Java can find the Jasper classes (SICStus, SPTerm, and so on). This is done by specifying the pathname of the file jasper.jar:

% java -classpath $SP_PATH/bin/jasper.jar ...

SP_PATH does not need to be set; it is only used here as a placeholder. See the documentation of the Java implementation for more info on how to set classpaths.

The second is to specify where Java should find the Jasper native library (libjasper.so or jasper.dll), which the SICStus class loads into the JVM by invoking the method System.loadLibrary("jasper"). This method uses a platform dependent search method to locate the Jasper native library, and quite often this method fails. A typical example of such a failure looks like:

% java -classpath [...]/jasper.jar se.sics.jasper.SICStus
Trying to load SICStus.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no jasper
in java.library.path
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1133)
	at java.lang.Runtime.loadLibrary0(Runtime.java:470)
	at java.lang.System.loadLibrary(System.java:745)
	at se.sics.jasper.SICStus.loadNativeCode(SICStus.java:37)
	at se.sics.jasper.SICStus.initSICStus(SICStus.java:80)
	at se.sics.jasper.SICStus.<init>(SICStus.java:111)
	at se.sics.jasper.SICStus.main(SICStus.java:25)

This can be fixed by explicitly setting the Java property java.library.path to the location of libjasper.so (or jasper.dll), like this:

% java -Djava.library.path=/usr/local/lib [...]

When Jasper is used in run-time systems, additional constraints apply as described in Runtime Systems on Target Machines.

If this works properly, SICStus should have been loaded into the JVM address space. The only thing left is to tell SICStus where the runtime library (i.e., sprt.sav) is located. You may choose to specify this explicitly by either giving a second argument when initializing the SICStus object or by specifying the property sicstus.path:

Example (UNIX):

% java -Dsicstus.path=/usr/local/lib/sicstus-3.8

Example (Win32):

% java -Dsicstus.path="c:\Program Files\SICStus Prolog"

If you do not specify any explicit path, SICStus will search for the runtime library itself.

If everything is setup correctly, you should be able to call main (which contains a short piece of test-code) in the SICStus root class, something like this:

% java -Djava.library.path="/usr/local/lib" \
       -Dsicstus.path="/usr/local/lib/sicstus-3.8" \
       -classpath "/usr/local/lib/sicstus-3.8/bin/jasper.jar" \
        se.sics.jasper.SICStus
Trying to load SICStus.
If you see this message, you have successfully
initialized the SICStus Prolog engine.

It is similar under Win32, with the exception that the paths look slightly different.


Node:Jasper Package Options, Next:, Previous:Getting Started, Up:Jasper Notes

Jasper Package Options

The following Java system properties can be set to control some recently added features of the Jasper package:

se.sics.jasper.SICStus.checkSPTermAge
This flag is unsupported.

You probably should not use it in production code. It may be ignored (or be made the default) in future releases. However, we strongly recommend that you use this flag during development and report any good or bad experiences to sicstus-support@sics.se.

A boolean, off by default. If true then run-time checks are performed that attempt to detect potentially dangerous use of the SPTerm.putXXX family of functions. The value of this flag can be set and read with SICStus.setShouldCheckAge() and SICStus.shouldCheckAge().

The run-time checks throws an IllegalTermException when there is risk that a SPTerm is set to point to a Prolog term strictly newer than the SPTerm. In this context strictly newer means that there exists an open query that was opened after the SPTerm object was created but before the Prolog term. See SPTerm and Memory, for more information.

java -Dse.sics.jasper.SICStus.checkSPTermAge=true ...
or, from Prolog:
jasper_initialize(
   ['-Dse.sics.jasper.SICStus.checkSPTermAge=true'],
   JVM)

se.sics.jasper.SICStus.reuseTermRefs
This flag is unsupported.

A boolean, on by default. If false then SPTerm.delete() will only invalidate the SPTerm object, it will not make the Prolog side term-ref available for re-use. The value of this flag can be set and read with SICStus.setReuseTermRefs() and SICStus.reuseTermRefs(). There should be no reason to turn it off.

To set this flag do:

java -Dse.sics.jasper.SICStus.reuseTermRefs=true ...
or, from Prolog:
jasper_initialize(
   ['-Dse.sics.jasper.SICStus.reuseTermRefs=true'],
   JVM)

se.sics.jasper.SICStus.debugLevel
This flag is unsupported.

You probably should not use it in production code. It may be removed or change meaning in future releases.

An integer, zero by default. If larger than zero then some debug info is output to System.out. Larger values produce more info. The value of this flag can be set and read with SICStus.setDebugLevel() and SICStus.debugLevel().

java -Dse.sics.jasper.SICStus.debugLevel=1 ...
or, from Prolog:
jasper_initialize(
   ['-Dse.sics.jasper.SICStus.debugLevel=1'],
   JVM)


Node:Known Bugs and Limitations in Jasper, Next:, Previous:Jasper Package Options, Up:Jasper Notes

Known Bugs and Limitations in Jasper


Node:Java Examples Directory, Next:, Previous:Known Bugs and Limitations in Jasper, Up:Jasper Notes

Java Examples Directory

There is an examples directory available in $SP_PATH/library/jasper/examples. See the file README for more info.


Node:Java Resources Online, Previous:Java Examples Directory, Up:Jasper Notes

Resources

There are almost infinitely many Java resources on the Internet. Here is a list of a few which are related to Jasper and JNI.


Node:Visual Basic notes, Next:, Previous:Jasper Notes, Up:Top

Visual Basic notes

The Visual Basic - SICStus Prolog interface consists of the following files:

In order to use the interface, perform the following steps:


Node:Berkeley DB notes, Next:, Previous:Visual Basic notes, Up:Top

Berkeley DB notes

As of SICStus 3.8, the library module library(db) has been replaced by library(bdb). The functionality is similar, but library(bdb) is built on top of Berkeley DB. Berkeley DB can be downloaded from:

http://www.sleepycat.com

library(bdb) has been verified to work using Berkeley DB version 2.7.7. It does not work with Berkeley DB 3.x versions.

When using Berkeley DB on Windows, you may want to set the PATH environment variable to contain the path to libdb.dll. Consult the Berkeley DB documentation for further info.


Node:The Emacs Interface, Next:, Previous:Berkeley DB notes, Up:Top

The Emacs Interface

The Emacs Interface was originally developed for GNU Emacs 19.34 and is presently being maintained using XEmacs 21.1 and tested with GNU Emacs 19.34.1. For best performance and compatibility and to enable all features we recommend that the latest versions of GNU Emacs or XEmacs are used. For information on obtaining GNU Emacs or XEmacs, see www.gnu.org and www.xemacs.org, respectively.


Node:Installing the Emacs Interface, Previous:The Emacs Interface, Up:The Emacs Interface

Installation

Starting with SICStus 3.8 the Emacs interface is distributed with SICStus and installed by default. The default installation location for the emacs files is <prefix>/lib/sicstus-3.8/emacs/ on UNIX platforms and C:\Program Files\SICStus Prolog\emacs\ on Windows.

For maximum performance the Emacs lisp files (extension .el) should be compiled. This can be done from within Emacs with the command M-x byte-compile-file. See Installation, for further details.


Node:Installing On-Line Documentation, Previous:Installing the Emacs Interface, Up:Installing the Emacs Interface

Installing On-Line Documentation

It is possible to look up the documentation for any built in or library predicate from within Emacs (using C-c ? or the menu). For this to work Emacs must be told about the location of the info-files that make up the documentation. This can be done for the entire emacs installation or on a per user basis, see Installation, for further details.

The default location for the info-files are <prefix>/lib/sicstus-3.8/doc/info/ on UNIX platforms and C:\Program Files\SICStus Prolog\doc\info\ on Windows.

More recent versions of GNU Emacs and XEmacs should be able to automatically incorporate info files from a subdirectory into the main Info documentation tree. It is therefore recommended that the SICStus Info files are kept together in their own directory.


Node:Revision history, Next:, Previous:The Emacs Interface, Up:Top

Revision history

This chapter summarizes the changes in release 3 wrt. previous SICStus Prolog releases as well as changes introduced by patch releases.


Node:Changes in release 3, Next:, Previous:Revision history, Up:Revision history

Changes in release 3


Node:Changes introduced in 3#4, Next:, Previous:Changes in release 3, Up:Revision history

Changes introduced in 3#4


Node:Changes introduced in 3#5, Next:, Previous:Changes introduced in 3#4, Up:Revision history

Changes introduced in 3#5


Node:Changes introduced in 3#6, Next:, Previous:Changes introduced in 3#5, Up:Revision history

Changes introduced in 3#6


Node:Changes introduced in version 3.7, Next:, Previous:Changes introduced in 3#6, Up:Revision history

Changes introduced in version 3.7


Node:Changes introduced in version 3.7.1, Next:, Previous:Changes introduced in version 3.7, Up:Revision history

Changes introduced in version 3.7.1


Node:Changes introduced in version 3.8, Next:, Previous:Changes introduced in version 3.7.1, Up:Revision history

Changes introduced in version 3.8


Node:3.8 WCX, Next:, Previous:Changes introduced in version 3.8, Up:Changes introduced in version 3.8

Wide character support

Wide character handling is introduced, with the following highlights:

For programs using the default ISO_8859_1 character set, the introduction of wide characters is transparent, except for the string format change in the foreign interface, see below.

In programs using the EUC character set, the multibyte EUC characters are now input as a single, up to 23 bit wide, character code. This character code can be easily decomposed into its constituent bytes, if needed. The encoding function is described in detail in the SICStus manual.

To support wide characters, the foreign interfaces now use UTF-8 encoding for strings containing non-ASCII characters (codes >= 128). This affects programs with strings that contain e.g. accented characters and which transfer such strings between Prolog and C. If such a string is created on the C side, it should be converted to UTF-8, before passing it to Prolog. Similarly for a string passed from Prolog to C, if it is to be decomposed into characters on the C side, the inverse transformation has to be applied.

Utility functions SP_code_wci and SP_wci_code are provided to support the conversion of strings between the WCI (Wide Character Internal encoding, i.e., UTF-8) format and wide character codes.


Node:3.8 Debugger, Next:, Previous:3.8 WCX, Up:Changes introduced in version 3.8

Breakpointing debugger

A new general debugger is introduced, with advanced debugging features and an advice facility. It generalizes the notion of spypoint to that of the breakpoint. Breakpoints make it possible to e.g. stop the program at a specified line, or in a specified line range, or to call arbitrary Prolog goals at specified ports, etc. Highlights:


Node:3.8 ISO, Next:, Previous:3.8 Debugger, Up:Changes introduced in version 3.8

ISO compliance

SICStus 3.8 supports standard Prolog, adhering to the International Standard ISO/IEC 13211-1 (PROLOG: Part 1--General Core). At the same time it also supports programs written in earlier versions of SICStus. This is achieved by introducing two execution modes iso and sicstus. Users can change between the modes using the Prolog flag language. Main issues:


Node:3.8 Generic, Next:, Previous:3.8 ISO, Up:Changes introduced in version 3.8

Generic new features


Node:3.8 Jasper, Next:, Previous:3.8 Generic, Up:Changes introduced in version 3.8

New features in library(jasper)


Node:3.8 CLPFD, Next:, Previous:3.8 Jasper, Up:Changes introduced in version 3.8

New features in library(clpfd)


Node:3.8 Bugs, Previous:3.8 CLPFD, Up:Changes introduced in version 3.8

Bugs fixed in version 3.8


Node:Changes introduced in version 3.8.1, Next:, Previous:Changes introduced in version 3.8, Up:Revision history

Changes introduced in version 3.8.1

Version 3.8.1 is a bugfix release only, no new features has been added.


Node:Changes introduced in version 3.8.2, Next:, Previous:Changes introduced in version 3.8.1, Up:Revision history

Changes introduced in version 3.8.2

Version 3.8.2 is a bugfix release only, no new features has been added.


Node:Changes introduced in version 3.8.3, Next:, Previous:Changes introduced in version 3.8.2, Up:Revision history

Changes introduced in version 3.8.3

Version 3.8.3 is mainly a bugfix release. New features:

Bug fixes:


Node:Changes introduced in version 3.8.4, Next:, Previous:Changes introduced in version 3.8.3, Up:Revision history

Changes introduced in version 3.8.4

Version 3.8.4 is mainly a bugfix release. New features:

Bug fixes:


Node:Changes introduced in version 3.8.5, Next:, Previous:Changes introduced in version 3.8.4, Up:Revision history

Changes introduced in version 3.8.5

Version 3.8.5 is mainly a bugfix release. New features:

Bug fixes:


Node:Changes introduced in version 3.8.6, Previous:Changes introduced in version 3.8.5, Up:Revision history

Changes introduced in version 3.8.6

Version 3.8.6 is mainly a bugfix release. New features:

Bug fixes:


Node:Generic limitations, Next:, Previous:Revision history, Up:Top

Generic limitations

On 32-bit architectures, the total data space cannot exceed 256 MB. The Linux implementation of sbrk() returns memory starting at 0x08000000, so in practice the limit there is 128 MB. An experimental workaround for the Linux 128 MB limit is available from sicstus-support@sics.se.

The number of arguments of a compound term may not exceed 255.

The number of atoms created may not exceed 262143 (33554431) on 32-bit (64-bit) architectures.

The number of characters of an atom may not exceed 65535.

NUL is not a legal character in atoms.

There are 256 "temporary" and 256 "permanent" variables available for compiled clauses.

Saved states are not portable between 32-bit and 64-bit architectures, or from a system built with native code support to a system without native code support for the same architecture.

Indexing on big integers or floats is coarse.


Node:Questions and answers, Previous:Generic limitations, Up:Top

Questions and answers

Current support status for the various platforms can be found at the SICStus Homepage:

http://www.sics.se/sicstus/

Information about and fixes for bugs which have shown up since the latest release can be found there as well.

Send requests for ordering information to

sicstus-request@sics.se

Report bugs through the web interface

http://www.sics.se/sicstus/bugreport/bugreport.html.
or to
sicstus-support@sics.se

Bugs tend actually to be fixed if they can be isolated, so it is in your interest to report them in such a way that they can be easily reproduced.

The mailing list

sicstus-users@sics.se

is a moderated mailing list for communication among users and implementors. To [un]subscribe, write to

sicstus-users-request@sics.se

Table of Contents