Release notes for SICStus Prolog release 3.10.0, December 2002. Copyright 2002 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.
These notes summarize the changes in release 3 wrt. previous SICStus Prolog releases as well as changes introduced by minor releases and their patch releases. Platform specific information pertaining to certain parts of the system are also documented herein.
Release 3.10 is actively being supported on the following platforms:
In addition, earlier versions of SICStus have been verified to run on a number of other platforms. Contact sicstus-support@sics.se if you have any questions about a particular platform (listed or not listed).
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"
Installation of SICStus on UNIX is performed by an installation (Shell)
script InstallSICStus
which interacts with the user to obtain
options such as where to install SICStus. As of SICStus 3.9.1, the Java
based SICStus Installer Tool is a graphical front-end to the
installation script which automates downloading
and
installation. The SICStus Installer Tool is available from the download
page. Use of the SICStus Installer Tool is strictly optional but may be
convenient, especially on platforms such as Mac OS X, that, by default,
lack C compiler.
A full SICStus installation requires a C compiler and a linker to perform final link steps on the installation machine.
If a C compiler is not available, it is possible to use a pre-built installation on some platforms (e.g. Mac OS X, 64bit SPARC Solaris).
Pre-built installation is only recommended as a last resort; it is
available from the SICStus Installer Tool or by invoking
InstallSICStus
with the --all-questions
argument.
A disadvantage with the pre-built installation is that SICStus
libraries that interface to third-party products (Tcl/Tk, Berkeley DB,
Java) may not work, or may require environment variables such as
LD_LIBRARY_PATH
to be set. Another disadvantage is that
spld
and splfr
may not work unless you manually adjust the
spld
configure file. Of course, neither spld
nor
splfr
will work anyway if you do not have a C compiler.
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. As an alternative, the SICStus Installer Tool can be used to download the SICStus files and invoke the installation script.
During 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.
Invoke InstallSICStus
with the --help
argument to get a
list of options.
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.
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 spconfig-version
. Follow these instructions:
spconfig-version
. It should be located
in the same directory as splfr
and spld
.
spconfig-version
; let's call it
hacked_spld.config
. Do not edit the original file.
CFLAGS=-g
-O2
. Edit these according to your needs. Do not add or remove any
flags.
spconfig-version
together with
spld
or splfr
like this:
% spld [...] --config=/path/to/hacked_spld.configReplace
/path/to
with the actual path to the hacked configuration
file.
The only supported method for building foreign resources is by compiling
and linking them with splfr
. However, this is sometimes
inconvenient, for instance when writing a Makefile for use with UNIX
make
. To figure out what needs to be done to build a foreign
resource, you should build it once with splfr --verbose --keep ...
,
note what compiler and linker flags are used, and save away any generated
files. You can then mimic the build commands used by splfr
in
your Makefile, or similar. You should repeat this process each time you
upgrade SICStus, even if only the revision part of the SICStus version
changes.
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.
This section describes how to distribute runtime systems on target machines, i.e. machines which do not have SICStus installed. An alternative approach to what is presented here is to package the whole application as an all-in-one executable; see All-in-one Executables.
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 (absolute) paths into
the executable.
Next, in order for SICStus to be able to locate all relevant files, the following directory structure should be used.
myapp.exe sp-3.10.0/ +--- libsprt310.so +--- sicstus-3.10.0/ +--- bin/ | +--- sprt.sav +--- library/ +--- <files from $SP_PATH/library>
If support for multiple SICStus instances is needed, then the run-times
named e.g. libsprt310_instance_01_.so
, need to be available as
well, in the same place as libsprt310.so
.
If SICStus is installed on the target machine, a symbolic link named
sp-3.10.0
can be used, in which case it should point at the
directory of the SICStus installation that contains the
libsprt310.so
(or equivalent).
myapp.exe
is typically created by a call to spld
:
% spld --main=user --moveable [...] -o ./myapp.exe
On most platforms, the above directory layout will enable the executable
to find the SICStus run-time (libsprt310.so
) as well as the boot
file sprt.sav
(spre.sav
). In addition, application specific files, e.g. a
.sav
file, can be found using the automatically set environment variables
SP_APP_DIR
or SP_RT_DIR
. On some platforms a
wrapper script, generated by spld
, is needed to ensure that the
files are found.
On some platforms, the executable will not be able to locate
sprt.sav
(spre.sav
) unless the environment variable SP_PATH
is set.
If the example above is rooted in /home/joe
, then SP_PATH
should be set to /home/joe/lib/sicstus-3.10.0
. This is not needed
on platforms where SP_APP_DIR
or SP_RT_DIR
can be used,
e.g. on Linux, Solaris or Win32 and most others.
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 libsprt310.so
. If the --static
option is used,
this is not necessary. Setting LD_LIBRARY_PATH
is not needed, nor
recommended, on Linux and Solaris (and Win32).
This section contains some installation notes which are platform specific under UNIX.
gcc
. You need to use the Sun Workshop/Forte
compiler. InstallSICStus will try to find it during installation but if
that fails, you can set the environment variable CC
to e.g.
/opt/SUNWspro/bin/cc
before invoking InstallSICStus.
library(bdb)
,
library(tcltk)
.
timeout
does not work with Java. The problems seems to be
a limitation in the Solaris setitimer
for process with multiple
threads. A possible workaround on Solaris 8 is to use an alternative
thread library by setting LD_LIBRARY_PATH
to
/usr/lib/lwp
. This alternative thread library is not available
prior to Solaris 8 and it is the default in Solaris 9.
library(tcltk)
requires Tk
which is
not installed on MacOS X by default (see Tcl/Tk Notes).
spld
will only work if there is a properly
configured
subdirectory sp-3.10.0
in the same directory as the executable; see
UNIX Runtime Systems on Target Machines.
Alternatively, the option --wrapper
can be passed to spld
.
In this case a wrapper script is created that will set up various
environment variables and invoke the real executable.
spld --resources ...
does not work, whereas
spld --static --resources ...
will. This is no great loss;
pre-linking dynamic foreign resources is pointless, at best.
Tcl/Tk
or BDB
, you may
need to set-up DYLD_LIBRARY_PATH
so that the MacOS X dynamic
linker can find them. When using the SICStus development executable
(sicstus
), a wrapper script does this automatically.
tcsh> limit data datasize 6144 kbytes bash> ulimit -d 6144This indicates that the maximum size of the data-segment is only 6 Mb. To remove the limit, do
tcsh> limit data unlimited datasize unlimited bash> ulimit -d unlimited bash> ulimit -d unlimitedPlease note:
limit
(ulimit
) is a shell built-in
in csh
/tcsh
(sh
/bash
). It may have a
different name in other shells.
spld --moveable
implies --wrapper
. This is due to
limitations in the IRIX run-time loader.
spld --moveable
. This should not be a
problem; pre-linked dynamic resources are not recommended anyway.
Large
Address-Space Model
. This is done automatically by spld
. If you
do not use spld
, you need to set this option yourself. This is
achieved by linking the executable using the -bmaxdata
option. An
alternative may be to set the environment variable LDR_CNTRL
appropriately. See the documentation for the AIX command ld
.
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.10.0
:
../*.{a,so,sl,dylib}
bin/sprt.sav
bin/spre.sav
bin/jasper.jar
library/*.{tcl,po,pl}
license.pl
!
library/*/*.{s.o,so,sl,dylib}
library/*/*.{po,pl}
sp_platform
InstallSICStus
)
This chapter assumes that the environment variable PATH
includes
%SP_PATH%\bin
, where SP_PATH
points to the SICStus
installation directory (typically
C:\Program Files\SICStus Prolog 3.10.0
.
Here, %SP_PATH%
is just a place-holder; you usually do
not need to set the environment variable SP_PATH
, but see
Setting SP_PATH under Windows. For example:
C:\> set PATH=C:\Program Files\SICStus Prolog 3.10.0\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).
spld
or
splfr
: Microsoft Visual C++ 6.0 or later.
As an unsupported alternative to the Microsoft Visual Studio tools, you
can use Microsoft eMbedded Visual C++ 4.0
or Microsoft
eMbedded Visual Tools 3.0
available for free at the download
area of <http://msdn.microsoft.com/
>. These tools come with
compilers and linkers not only for embedded platforms but also for the
ordinary x86 Windows environment. In addition to the compiler tools, you
will need the Microsoft Platform SDK available from the same place.
The development system comes in two flavors:
The distribution consists of a single, self-installing executable
(InstallSICStus.exe
) containing development system, runtime
support files, library sources, and manuals. Note that the installer
itself asks for a password, when started. This is different from the
license code.
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.10 ExpirationDate Codeon Windows NT/2000/XP
splm
must be run by a user with
Administrative rights. As of SICStus 3.10, the windowed version of
SICStus (spwin.exe
) has a menu item for license entry, making
splm
unnecessary on Windows.
splfr
and spld
should not have
embedded spaces. For file names with spaces, you can use the corresponding
short file name.
Start
menu (e.g.
Start\Programs\SICStus Prolog 3.10.0
) may not work immediately
after installation. Restarting after installing SICStus appears to cure
this. If this does not help, you can add your own shortcut to e.g.
C:\Program Files\SICStus Prolog 3.10.0\bin\spwin.exe
.
Manual
or Release Notes
item in the
Help
menu may give an error message similar to
... \!Help\100#!Manual.lnk could not be found
. This happens when
Adobe Acrobat Reader is not installed or if it has not been installed
for the current user. Open C:\Program Files\SICStus
Prolog\doc\pdf\
in the explorer and try opening
relnotes.pdf
. If this brings up a configuration dialog for
Adobe Acrobat, configure Acrobat and try the Help
menu
again. Alternatively, you may have to obtain Adobe Acrobat. It is
available for free from http://www.adobe.com/.
For All Users
.
If SICStus is installed for a single user, then SICStus will not find the
license information when started by another user.
In this case, the windowed version of SICStus (spwin.exe
) will
put up a dialog where a license can be entered.
Windows Installer
technology from
Microsoft. This will fail unless the user has administrative rights. A
typical symptom is an error message asking for msiexec
. The
Windows Installer technology is already part of Windows 2000 and later.
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. An alternative approach to what is presented here is to package the whole application as an all-in-one executable; see All-in-one Executables.
In order to locate all relevant files, the following directory structure should be used.
myapp.exe sprt310.dll sp310\ +--- bin\ | +--- sprt.sav +--- library\ +--- <files from %SP_PATH%\library>
if support for multiple SICStus instances is needed, then the run-times
named e.g. sprt310_instance_01_.dll
, need to be available as
well, in the same place as sprt310.dll
.
myapp.exe
is typically created by a call to spld
:
% spld --main=user [...] -o ./myapp.exe
If the directory containing sprt310.dll
contains a directory
called sp310
, SICStus assumes that it is part of a Runtime System
as described in the picture. The (extended) runtime library,
sprt.sav
(spre.sav
), is then looked up in the directory
(sp310/bin
), as in the picture. Furthermore, the initial
library_directory/1
fact will be set to the same directory with
sp310/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 sprt310.dll sp310\ +--- 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 sprt310.dll
can be
located by the DLL search.
The 310 in the file names above is derived from SICStus Prolog's major and minor
version numbers, i.e. currently 3 and 10. Naming the files with version
number enables applications using different SICStus versions to install
the sp*
files in the same directory.
There are three ready-made runtime systems provided with the
distributions, %SP_PATH%\bin\sprt.exe
,
%SP_PATH%\bin\sprtw.exe
, and
%SP_PATH%\bin\sprti.exe
. These have been created using spld
:
% spld --main=restore '$SP_APP_DIR/main.sav' -o sprt.exe % spld --main=restore '$SP_APP_DIR/main.sav' -i -o sprti.exe % spld --main=restore '$SP_APP_DIR/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
(located in the same folder as the program).
The saved state is 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 do not seem to be (useful under
Emacs, for example). sprtw.exe
is a windowed executable,
corresponding to spwin.exe
.
For more info on how spld
works,
see The spld tool.
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),
sprt.sav
, or spre.sav
(where <ver>
is "310" for
SICStus version 3.10(.x)). If SP_PATH
is used, SICStus expects it
to be set such that %SP_PATH%\bin
contains sprt.sav
or
spre.sav
. See Runtime Systems on Target Machines.
Command line editing supporting Emacs-like commands and IBM PC arrow keys is provided in the console-based executable. The following commands are available:
Options may be specified in the file %HOME%\spcmd.ini
as:
Option Value
on separate lines. Recognized options are:
lines
save
%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).
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.
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
rows
cols
x
y
On Windows 95 or 98, you will normally specify this in your autoexec.bat
file. Here is
an example:
% set CONSOLE=sl:600,x:400,y:400
On Windows NT and Windows 2000 or newer, you would use the System
Control Panel.
Many of these settings are also accessible from the menu Settings
of the console.
character_escapes
is set to off
.
absolute_file_name/3
.
sicstus.exe
and spwin.exe
.
spwin.exe
is in a blocking
read from the GUI window.
sicstus.exe
is attached to a console window. That is, if it is
started from a command prompt window.
library(sockets)
, are not interruptible by C-c in any kind
of SICStus executable.
user_error
stream is line buffered.
comint-interrupt-subprocess
) will not interrupt a
blocking read from standard input. The interrupt will be noted as soon
as some character is sent to SICStus. The characters typed will not be
discarded but will instead be used as debugger commands, sometimes
leading to undesirable results.
Send EOF
from the menu, i.e. comint-send-eof
),
closes the connection to the SICStus process. This will cause SICStus to
exit. This problem cannot be fixed in SICStus; it is a limitation of
current versions of FSF Emacs and XEmacs (at least up to FSF Emacs 20.7
and XEmacs 21.5).
Instead of sending and end of file, you can enter the symbol
end_of_file
followed by a period. Alternatively, a C-z can
be generated by typing C-q C-z.
statistics(runtime,
...)
measures user time of the thread running SICStus (the main thread)
instead of process user time. This makes statistics(runtime, ...)
meaningful also in a multi-threaded program. For a single-threaded
program this is the same as process user time.
top_level_events
option to tk_new/2
is not
supported.
library(timeout)
is supported. On Windows 95/98/ME time is measured in real
time (walltime), as opposed to process virtual time. As of SICStus 3.10.0,
the time is user time of the main thread on Windows NT/2000/XP.
library(sockets)
: The AF_UNIX
address family is (unsurprisingly)
not supported; socket_select/[5,6]
support only socket streams for
arg 4(5).
library(system)
: popen/3
is not supported.
kill/2
attempts to terminate the requested
process irrespectively of the 2nd arg. You should not use it as it
bypasses the killed process cleanup routines.
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\spre.sav
bin\jasper.jar
bin\*.dll
bin\*.po
library\*.{tcl,po,pl,bas}
license.pl
!
library\*\*.dll
library\*\*.{po,pl}
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
for MacOS X we installed Tcl/Tk (and the X windows system)
using fink
, available at:
http://fink.sourceforge.net
The Tcl/Tk interface module included in SICStus Prolog 3.10
(library(tcltk)
) is verified to work with Tcl/Tk 8.3. The current
version of the interface is expected to work with version 8.1 and newer.
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.3. 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.
Please note: You need to have the Tcl/Tk binaries accessible
from your PATH
environment variable, e.g.
C:\Program Files\Tcl\bin"
.
The GUI version of SICStus spwin
, like all Windows non-console
applications, lacks the C standard streams
(stdin
,stdout
,stderr
) and the Tcl command
puts
and others that use these streams will therefore give
errors. The solution is to use sicstus.exe
instead of
spwin.exe
if the standard streams are required.
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)
.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.
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://java.sun.com
>.
Except where indicated, Jasper is built with JDK 1.3.1. On Linux, Solaris and Win32, Jasper is also tested with 1.2.2.
As of SICStus 3.9.1, it is possible to configure SICStus to use JDK 1.4. This has not been extensively tested. Please report any problems to SICStus support.
Jasper is only supported under the following configurations:
Sun's JDK 1.2.2 does not support native threads and therefore does not work.
JDK 1.3 uses signals in a way that are incompatible with the way
signals are used by the SICStus development system (sicstus
).
Most of the signal handlers used by (sicstus
) are now turned off
automatically before library(jasper)
starts Java. This appears 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 do not use signals, and for this reason, JDK 1.3 works
e.g. when embedding SICStus in Java using the Jasper package.
-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 -mUsing
_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 the SICStus
development system.
DYLD_LIBRARY_PATH
be
set-up so that Java can find the SICStus run-time library. That is, you
may need to set DYLD_LIBRARY_PATH
to the location of the SICStus
run-time libsprt310.dylib
.
java -fast64
) of JDK 1.3.1 is
supported. Also see the Linux entry above.
LD_LIBRARY_PATH
to the directory where the SICStus run-time
library is located (e.g. /usr/local/lib
).
The AIX version of JDK 1.3.1 requires some environment variables to
be set before invoking an application that embeds the Java VM. For this
reason, the following environment variables should be set before starting
a SICStus executable that uses library(jasper)
:
bash$ export AIXTHREAD_SCOPE=S bash$ export AIXTHREAD_MUTEX_DEBUG=OFF bash$ export AIXTHREAD_RWLOCK_DEBUG=OFF bash$ export AIXTHREAD_COND_DEBUG=OFF bash$ export LDR_CNTRL=USERREGS bash$ sicstus -m ...
See the AIX JDK 1.3.1 readme (/usr/java131/README.HTML
) for futher details.
This section describes some tips and hints on how to get the interface started. This is actually where most problems occur.
Under Windows, you should add SICStus Prolog'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 3.10.0\bin
.
For Java, it is usually
C:\jdk1.3.1\jre\bin\hotspot
(for JDK
1.2.2 it would be C:\jdk1.2.2\jre\bin\classic
).
For example (Windows NT/2000/XP):
set PATH=C:\jdk1.3.1\jre\bin\hotspot;%PATH% set PATH=C:\Program Files\SICStus Prolog 3.10.0\bin;%PATH%
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
either the sicstus
executable or the jasper
foreign resource
so that it contains the necessary
information; the detail are platform dependent.
If you use spld
to relink SICStus or to build a
run-time system, you can use the command line option
--resource=-jasper
(note the minus sign).
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 spld
with the
--resource=-jasper
and --with-jdk=DIR
options to
generate a development system with embedded paths to another Java
directory tree. This will only work if the alternative directory tree has
the same structure as the JDK directory seen by InstallSICStus
.
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.
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 -mThe
-m
flag is not needed, and is ignored, on
Windows.
When Jasper is used in run-time systems, additional constraints apply as
described in Runtime Systems on Target Machines. The Java to
SICStus interface relies on dynamically loading the SICStus run-time
system. For this reason, it is not possible to use library(jasper)
from an executable that links statically with the SICStus run-time.
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 (libspnative.so
or spnative.dll
), which the
SICStus
class loads into the JVM by invoking the method
System.loadLibrary("spnative")
. The loadLibrary
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 spnative 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)
On UNIX, this can be fixed by explicitly setting the Java property
java.library.path
to the location of libspnative.so
, like this:
% java -Djava.library.path=/usr/local/lib [...]
On Windows, Java must be able to find spnative.dll
through the
PATH
environment variables and setting -Djava.library.path
can lead to problems if multiple versions of SICStus has been installed.
If this works properly, SICStus should have been loaded into the JVM
address space. The only thing left is to tell SICStus where the (extended) runtime
library, sprt.sav
(spre.sav
), is located. On those platforms where the
SICStus run-time system can determine its own location, e.g. Windows,
Solaris and Linux, the run-time system will find the runtime library
automatically. Otherwise, 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.10.0
If you do not specify any explicit path, SICStus will search for the runtime library itself.
If everything is set up 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.10.0" \ -classpath "/usr/local/lib/sicstus-3.10.0/bin/jasper.jar" \ se.sics.jasper.SICStus Trying to load SICStus. If you see this message, you have successfully initialized the SICStus Prolog engine.
On Windows, it would look something like this, depending on the shell used:
% java -classpath "C:/Program Files/SICStus Prolog 3.10.0/bin/jasper.jar" se.sics.jasper.SICStus Trying to load SICStus. If you see this message, you have successfully initialized the SICStus Prolog engine.
If more than one se.sics.jasper.SICStus
instance will be created,
then the SICStus run-times named e.g. libsprt310_instance_01_.so
,
need to be available as well. See Runtime Systems on Target Machines.
The following Java system properties can be set to control some features of the Jasper package:
se.sics.jasper.SICStus.checkSPTermAge
A boolean, true 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()
. This flag was false by default
in SICStus 3.8.
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
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
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)
Some exceptions thrown in multi threaded mode may be removed in the
future. The user should never catch specific exceptions, but instead
catch instances of PrologException
.
See Known Bugs and Limitations in Jasper, for details on the limitations of multi threaded Jasper.
native
. This is due to a
security-restriction enforced on applets by Java; they are not allowed to call
native code.
green threads
). This is the default under Windows. Under UNIX,
most JDKs use native threads per default in version 1.2.
On some platforms, you need to explicitly specify the -native
option when calling java
. The following error is an example of
what may happen if you do not specify -native
:
% java -classpath .:[...]/lib/sicstus-3.10.0/bin/jasper.jar \ -Djava.library.path=[...]/lib \ -Dsicstus.path=[...]./lib/sicstus-3.10.0 Simple *** panic: libthread loaded into green threads Abort (core dumped)
Instead, do
% java -native [...]this should not be neede with JDK 1.3 or newer.
See your JDK documentation for more info on command-line parameters to the JVM.
SPTerm
will leak memory on the Prolog side. This is
not really a bug but may come as a surprise to the unwary. See SPTerm and Memory.
% splfr simple.pl SICStus 3.8.7 (sparc-solaris-5.7): Mon Feb 21 10:43:17 MET 2000 Licensed to SICS {spk.ai82.c generated, 20 msec} yes In file included from /usr/local/jdk1.2/include/jni.h:35, from spk.ai82.c:94: /usr/local/jdk1.2/include/solaris/jni_md.h:20: warning: \ ignoring pragma: "@(#)jni_md.h 1.11 99/02/01 SMI
The warning can be safely ignored. You can suppress the warnings when
using gcc
by
passing the options --cflag=-Wno-unknown-pragmas
to splfr
.
There is an examples directory available in
$SP_PATH/library/jasper/examples
. See the file README
for
more info.
There are almost infinitely many Java resources on the Internet. Here is a list of a few which are related to Jasper and JNI.
The Visual Basic - SICStus Prolog interface consists of the following files:
vbsp.dll
(installed as SICStus\bin\vbsp.dll
)
vbsp.bas
(installed as SICStus\library\vbsp.bas
)
In order to use the interface, perform the following steps:
vbsp.bas
in your
Visual Basic project.
C:\Program Files\SICStus Prolog 3.10.0\bin
in the PATH
environment
variable. On Windows 2000 and later, PATH
is set in the
control panel System
. On Windows 9x/ME, this is set in
autoexec.bat
. Consult your OS documentation for details.
Note that when running your Visual Basic project in the Visual Basic debugger, the directory of the current application is the directory that contains the Visual Basic debugger and not the directory that contains your Visual Basic project.
In a target system, you need to make the SICStus runtime DLL
etc. available. See Runtime Systems on Target Machines. In this case,
vbsp.dll
should be located at the same place
as the SICStus run-time (sprt310.dll
).
If VB cannot find the SICStus run-time files, it will report something similar to
File not found: VBSP
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
4.1.24. It does not work with earlier versions.
When using Berkeley DB on Windows, you should set the PATH
environment variable to
contain the path to libdb40.dll
. Consult the Berkeley DB
documentation for further info.
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 http://www.gnu.org and http://www.xemacs.org, respectively.
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.10.0/emacs/
on UNIX platforms and
C:\Program Files\SICStus Prolog 3.10.0\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.
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.10.0/doc/info/
on UNIX platforms and
C:\Program Files\SICStus Prolog 3.10.0\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.
This chapter summarizes the changes in release 3 wrt. previous SICStus Prolog releases as well as changes introduced by patch releases.
0'
notation denote escape sequences. Character escaping can be switched off.
call_residue/2
has been modified so that
goals that are disjunctively blocked on several variables are returned
correctly in the second argument.
setarg/3
has been removed. Its
functionality is provided by the new built-ins create_mutable/2
,
get_mutable/2
, update_mutable/2
, and is_mutable/2
,
which implement a timestamp technique for value-trailing with low-level
support.
unix/1
and plsys/1
have been
removed. Their functionality is provided by
prolog_flag(argv,X)
, by the new halt/1
built-in, and
by the new library(system)
module which also contains several new
predicates.
library(sockets)
module.
time_out/3
has been moved to the new
library(timeout)
module.
term_hash/[2,4]
, subsumes_chk/2
, and
term_subsumer/3
have been moved to the new library(terms)
module, which also contains operations for unification with occurs-check,
testing acyclicity, and getting the variables of a term.
+chars
, -chars
and [-chars]
for fast conversion between
C strings and Prolog lists of character codes. Several new interface functions
are available.
SP_term_ref
,
making the functions SP_show_term()
and SP_hide_term()
obsolete.
library(gmlib)
has been replaced by
the Tcl/Tk based library(tcltk)
. A version of library(gmlib)
converted to SICStus Prolog release 3 is available from
ftp://ftp.sics.se/archive/sicstus3/gmlib.tar.gz
.
library(objects)
module has been enhanced.
self
.
Prolog goals in methods must be prefixed by :.
library(charsio)
, the open_chars_stream/[3,4]
predicates
have been replaced by open_chars_stream/2
and
with_output_to_chars/[2,3]
.
library(assoc)
module now implements AVL trees instead of
unbalanced binary trees.
library(atts)
implements
attributed variables, a general mechanism for associating logical variables
with arbitrary attributes. Comes with a number of hooks that make it
convenient to define and interface to constraint solvers.
library(clpb)
and is implemented on top of library(atts)
.
library(clpq)
) and reals
(library(clpr)
), implemented on top of library(atts)
.
user:goal_expansion/3
is a new hook predicate for macro-expansion.
bb_put/2
, bb_get/2
, bb_delete/2
, and bb_update/3
are new built-ins implementing blackboard primitives.
prolog_load_context/2
is a new built-in predicate
for accessing aspects of the context of files being loaded.
user:file_search_path/2
is a new hook predicate
providing an alias expansion mechanism for filenames.
gcd/2
is a new built-in function.
walltime
measures elapsed absolute time.
ensure_loaded/1
and use_module/[1,2,3]
have the same semantics as in development systems.
SP_foreign_reinit_hook
is not supported.
~/.sicstusrc
is not found, SICStus looks for
~/sicstus.ini
.
library(sockets): socket_select/5
arg 1 may be a, possibly empty,
list of passive sockets, arg 3 returns a, possibly empty, list of new
streams.
library(system)
: The following new predicates are provided:
tmpnam/1
, directory_files/2
, file_property/2
,
delete_file/2
, make_directory/1
.
library(clpfd)
),
implemented on top of library(atts)
.
open/4
, enables opening files in binary mode.
library(charsio)
: New predicate with_output_to_chars/4
.
library(heaps)
: New predicates delete_from_heap/4
, empty_heap/1
, is_heap/1
.
library(queues)
: New predicate is_queue/1
.
library(sockets)
: New predicates: socket_accept/3
, and
socket_select/6
provide address of connecting
client. hostname_address/2
resolves name/ip-number.
SP_atom_length
returns the print name length of a Prolog atom.
toplevel_print_options
and debugger_print_options
are new
Prolog flags controlling the toplevel's and debugger's printing behavior.
is_mutable/1
is a new built-in which is true for mutables.
~@
is a new spec in format/[2,3]
for arbitrary goals.
library(clpfd)
)
has been enhanced by a programming interface for global constraints,
improved compilation to library constraints and other performance
enhancements, and by a number of new exported constraints.
library(objects)
: New hook predicate user:method_expansion/3
.
library(sockets)
: socket_select/5
has extended functionality.
format/[2,3]
fixed.
save_program/[1,2]
with native code fixed.
library(chr)
fixed, and a couple of new constraint handlers
fixed.
module/2
decl.
library(tcltk)
.
library(chr)
: A new library module providing Constraint Handling
Rules; see
http://www.pst.informatik.uni-muenchen.de/~fruehwir/chr-solver.html
library(jasper)
.
garbage_collect_atoms/0
, and
controlled by the agc_margin
Prolog flag. New statistics
options: atoms
, atom_garbage_collection
.
New interface functions: SP_register_atom
, SP_unregister_atom
.
call_cleanup/2
, which
replaces undo/1
.
source_info
Prolog
flag.
zip
and built-ins zip/0
, nozip/0
; new debugger
commands out n, skip i, quasi-skip
i, zip, backtrace n, raise exception.
Modules can be declared as hidden which disables tracing of their
predicates.
save/[1,2]
are gone. In most cases, save_program/2
can be
used in their place, with a little rearrangement of your code.
Predicates can be declared as volatile.
SP_restore
is the C equivalent of
restore/1
, which now only restores the program state, leaving the
Prolog execution stacks unchanged.
read_term/3
option: layout(-Layout)
.
New hook predicate: user:term_expansion/4
.
random:randset/3
returns a set in standard order.
db:db_canonical/[2,3]
are new; can be used to check whether two
TermRefs refer to the same term.
clpfd:serialized_precedence/3
and
clpfd:serialized_precedence_resource/4
are new; model
non-overlapping tasks with precedence constraints or sequence-dependent
setup times.
:Goal
are
translated according to the manual. Earlier
versions treated arguments occurring in the :
position of
meta-predicates specially.
SP_raise_fault
and interface macro
SP_on_fault
are available for handling runtime faults that cannot
be caught as exceptions.
SP_set_memalloc_hooks
is available for
redefining the memory manager's bottom layer. Related to that, there is
a new command-line option -m
.
-B
command-line option is gone in the start-up script, and
some new options have appeared.
-base
to override the executable used by
the start-script.
reinitialise/0
does not load any initialization files given in
-i
or -l
command line flags.
-S
to spmkrs
and spmkds
to
link the SICStus Runtime Kernel (and development extensions for
spmkds
) statically into the executable.
[File1,File2,...]
was broken.
require/1
did not find all directories.
clp[qr]:dump/3
, clp[qr]:expand/0
,
clp[qr]:noexpand/0
.
arrays:arefa/3
, arrays:arefl/3
, heaps:min_of_heap/5
are now steadfast.
library(clpfd)
predicates now check the type of their arguments.
Bugs fixed in relation/3
, serialized/2
, all_distinct/1
.
frozen/2
could crash on an argument of the wrong type.
SP_get_list_n_chars
does not require a proper list.
load_files(Files, [compilation_mode(assert_all)])
.
load_files(Files, [if(changed)])
, a non-module file is
not considered to have been previously loaded if it was loaded into a
different module.
if/3
goals in DCG rules.
system:mktemp/2
sometimes returned filenames with
backslashes in them.
object
in Jasper has changed to
object(Class)
.
splfr
, spmkrs
, spmkds
.
format/[2,3]
fixed.
save_program/[1,2]
with native code fixed.
library(chr)
fixed, and a couple of new constraint handlers
fixed.
module/2
decl.
library(tcltk)
.
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.
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:
add_breakpoint/2
, spy/2
, current_breakpoint/4
,
remove_breakpoints/1
, disable_breakpoints/1
,
enable_breakpoints/1
, execution_state/1
, and
execution_state/2
. user:debugger_command_hook/2
is a new
hook predicate.
The predicates nospy/1
and nospyall/0
have slighty changed meaning.
The predicate spypoint_condition/3
has been removed.
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:
sicstus
execution mode is practically identical to 3.7.1, except for
minor changes in error term format.
iso
mode is fully compliant with ISO standard, but no strict
conformance mode is provided.
sicstus
execution
mode, unless they conflict with existing SICStus predicates or
functions. This expansion of the language carries a remote risk of name
clashes with user code.
spmkds
and spmkrs
utilities for creating stand-alone
executables have been replaced by a common spld
tool which
takes several new options. Runtime systems do not always need a main
program in C. On Windows, the resulting executable can optionally be
windowed. The splfr
tool takes several new options.
The development and runtime kernels have been merged into a single one.
save_files/2
, save_modules/2
, and save_predicates/2
respectively. These predicates create files in a binary format, by
default with the prefix .po
(for Prolog object file), which can
be loaded by load_files/[1,2]
. The load_type(Type)
option
of load_files/2
has been extended. Partial saved states render
.ql
files obsolescent.
trimcore/0
reclaims any dead clauses
and predicates, defragmentizes Prolog's memory, and attempts to return
unused memory to the operating system. It is called automatically at
every top level query.
host_type
is an atom identifying the platform, such as 'x86-linux-glibc2.1'
.
source_info
Prolog flag, introduced in
release 3.7, has been extended beyond the Emacs interface. Line number
information is now included in error exceptions whenever possible. This
information is displayed in debugging and error messages (outside Emacs)
or causes Emacs to highlight the culprit line of code. Valid values are
off
, on
, and emacs
.
spy/[1,2]
, nospy/1
, listing/1
, abolish/1
,
profile_data/4
, profile_reset/1
,
save_predicates/2
, and gauge:view/1
.
SP_chdir()
and SP_getcwd()
provide access to the current working directory.
SP_load()
has been generalized to
correspond to load_files/1
.
SP_deinitialize()
is now documented.
sprt<xx>.dll
. SP_PATH
is only used as a last
resort. See Windows notes.
README
and INSTALL
in the source
distribution for documentation.
library(bdb)
provides an interface to the Berkeley DB
toolset for persistent storage, and replaces library(db)
. The
programming interface of the new module is similar to that of the old
one, with some new concepts added such as iterators. The sources
of the old library module are available from:
ftp://ftp.sics.se/archive/sicstus3/libdb.tgz
library(db)
is obsolete and will be removed in the next major
release.
spld
and
exist in three flavors: generic character based (sprt.exe
),
generic character based interactive (sprti.exe
), and generic
windowed (sprtw.exe
). See Generic Runtime Systems.
library(tcltk)
has been rewritten and greatly
expanded.
library(clpq)
and library(clpr)
: new predicates inf/4
and sup/4
.
library(gcla)
has been removed.
initialization/[0,1]
have been replaced by ISO compliant
initializations.
library(jasper)
will not
work using JDK 1.1.x.
jasper
to se.sics.jasper
,
according to JavaSoft guidelines. See Getting Started.
jasper.jar
, which is located in
$SP_PATH/bin
. See Getting Started.
jasper.dll
or libjasper.so
)
is now located in the same directory as the runtime kernel (default
<installdir>/lib
under UNIX, <installdir>/bin
under
Windows). See Getting Started.
jasper_call_instance/6
,
jasper_call_static/6
, etc.). This makes it possible to call Java
without having to generate any glue-code (i.e. without a C-compiler).
jasper_create_global_ref/3
, jasper_delete_global_ref/2
,
jasper_delete_local_ref/2
).
SPException.term
declared protected
instead of private
.
SPCanonicalAtom
to handle canonical representations of
atoms and to make sure that they are safe with atom-gc. New methods
getCanonicalAtom
and putCanonicalAtom
. New constructor for
SPPredicate
. getAtom
and putAtom
deprecated.
IllegalCallerException
is thrown if the current
thread is not allowed to call SICStus.
fd_degree/2
is new; returns the number of constraints attached to
a variable.
labeling/2
requires the list of domain variables to have bounded
domains. User-defined variable and value choice heuristics can be
provided.
element/3
is interval-consistent in its second and third
arguments. Use relation/3
if domain-consistency is required.
serialized/3
is new and replaces serialized_precedence/3
and serialized_precedence_resource/4
. A number of new options
control the algorithm. The space complexity no longer depends on the
domain size.
cumulative/5
is new and takes the same options as
serialized/3
.
all_different/2
, all_distinct/2
and assignment/3
are new and take options controlling the algorithms.
absolute_file_name/2
: could crash under IRIX; nested compound terms allowed
call_cleanup/2
: efficiency
close/1
: efficiency; handling the standard streams
format/[2,3]
: ~N didn't work as expected;
are now meta-predicates--needed by the ~@ format spec
load_files/[1,2]
: avoid changing directory; don't loop on duplicate exports
load_foreign_resource/1
: filenames containing periods on Windows NT
print_message/2
: in runtime systems
prolog_load_context/2
: value of term_position
reinitialise/0
: sequencing of events
save_program/[1,2]
: fastcode handling; file mode creation masks; in runtime systems
write_term/[1,2]
: the indented(true)
option and non-ground terms
library(db)
: efficiency of term deletion
library(heaps)
: delete_from_heap/4
library(objects)
: the new/2
method; cyclic dependencies
library(random)
: determinacy and efficiency
library(sockets)
: noisy startup on Windows; block buffering is now the default;
socket_buffering/4
added
library(system)
: sleep/1
admits floats as well as integers
library(terms)
: subsumes_chk/2
and variant/2
now don't unblock goals
+chars
; syntax
error messages were suppressed
print_message/2
interface
.ql
files
load_files/[1,2]
=\=
). Note
that X is nan, X =:= X
fails.
Version 3.8.1 is a bugfix release only, no new features has been added.
configure.in
: Removed multiple occurences of the -n32
flag
under IRIX if cc
is used instead of gcc
.
configure.in
: FreeBSD 3.x is now handled correctly.
configure.in
: On Linux and Solaris, SICStus is now always linked
with the POSIX thread library.
InstallSICStus
: spld
did not log verbose output to logfile.
spld
, splfr
: Eliminated use of ..
to specify
relative paths. Caused problems on Windows 95/98.
library(jasper)
: Green threads JDKs not supported any longer.
library(tcltk)
: 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.
multifile
+ discontiguous
combination fix
listing/[0,1]
, tell/1
, see/1
fixes
stack_shifts
(statistics/2 option) manual fix
load_foreign_resource/1
search algorithm fix
a =.. [b|c]
SP_term_ref
leaks in some functions
all_distinct/[1,2]
, assignment/[2,3]
, circuit/[1,2]
,
serialized/[2,3]
, cumulative/[4,5]
, fdset_member/2
, arithmetic
Version 3.8.2 is a bugfix release only, no new features has been added.
call_residue/2
: fix bug when the goal called copy_term/2
.
listing/[1,2], portray_clause/[1,2]
, top-level: cope with constrained/attributed variables.
portray_clause/[1,2]
,
write_term/[2,3]
with indented(true)
: do not juggle module prefixes.
clpfd
SP_raise_exception
.
<sicstus/sicstus.h>
. Documented SP_to_os
, SP_from_os
.
SP_WcxOpenHook
: incorrect prototype.
library(bdb)
: a relative filename given in db_open/5
was
treated by SICStus as relative to the current working directory, but
should be relative to the given BDB environment.
library(clpfd)
: somewhat faster arithmetic, lingering bugs in
serialized/[2,3]
and cumulative/[4,5]
, labeling/2
options value/1
, variable/1
--with=<package>
options to spld
and splfr
to
override default installation path for third-party software packages.
spld
: Fixed bugs in argument handling. .pl
file arguments
are no longer compiled at spld
time, but passed directly to
SP_load()
.
library(jasper)
: Multiple threads are allowed to call SICStus
without IllegalCallerException
being thrown.
See Java Threads.
library(jasper)
: Argument-checking bug in
jasper_call_static/6
and jasper_call_instance/6
.
Version 3.8.3 is mainly a bugfix release. New features:
SP_calloc()
and SP_strdup()
.
pure
Prolog code, builtins
such as assert
are not affected although the Prolog part of
libraries are affected. (The change is in the byte code dispatch
mechanism).
spwin.exe
) can now save a transcript of the
interaction with the Prolog top-level. The command is under the
File
menu. You may wish to increase the
number of save lines
in the Windows Settings
(under the
Settings
menu).
library(clpfd)
: new constraints disjoint1/[1,2]
, disjoint2/[1,2]
model non-overlapping lines and rectangles.
Bug fixes:
All Files
should now work in file
selection dialogs.
spld
and splfr
from working on Windows
95/98 has been fixed.
spld
and splfr
.
spld
warns when input files are ignored
spld
return 0 when
user:runtime_entry/1
succeeds and 1 on failure or exception.
SP_chdir
declares its first argument as const char *
.
-l
and -r
files.
once/1
.
prolog_flag/[2,3]
: fix for runtime systems.
SP_unify()
: undo any bindings on failure.
library(bdb)
: relative filename handling fix.
library(clpfd)
: GC interaction, overflow detection, performance fixes.
libjasper.so
or jasper.dll
).
+atom
maps to SPCanonicalAtom
instead of SPTerm
.
+double
specifier did not work.
Version 3.8.4 is mainly a bugfix release. New features:
abort/0
returns to the innermost top-level, and does not
switch off the debugger.
library(clpfd)
: Given a term Term containing domain
variables, fd_copy_term(Term,Template,Body)
will compute Template and Body where Template is a
copy of the same term with all variables renamed to new variables such
that executing Body will post constraints equivalent to those that
Term is attached to.
library(tcltk))
:
list(CommandList)
to the possible command
formats. It creates a TCL list by, in effect, calling the TCL
command list
with the result of converting each element of
CommandList. The result is that Tcl will treat the result as
a list with the same length as CommandList even if the
elements contains spaces or other special characters.
Current code that uses ListOfCommands
should probably often be
better off using list(ListOfCommands)
. See the manual for
details.
writeq(Command)
and
write_canonical(Command)
as legal command
specifications. Documented that write_canonical
is the
preferred way of passing Prolog terms from Prolog to Tcl and back.
Now the value of variables named _
are ignored. This makes
it possible to avoid errors if some uninteresting result is not in
the special command format. This used to be less of a problem
since such errors were silently ignored. (Note: in SICStus 3.8.5
this was changed to ignore all variables with names
starting with underscore
.)
_
library(tcltk)
always use
UTF8 so that non seven bit characters gets recognized by Tcl. This
transfers character codes unchanged between SICStus and Tcl so it
assumes that SICStus interprets character codes as UNICODE (as this
is what Tcl does).
tk_num_main_windows/2
and tk_main_window/2
no
longer segfaults on Windows if tk_new/2
has not been
called. Added a "tk_new called" check to some other routines as
well. The segfault occurred when, due to a bug in Tk, Tk uses
stubs to access Tcl. Presently Tk uses Tcl stubs by default only
on Windows.
CommandList
now
becomes properly NUL terminated.
prolog_call
now resets the FLI stack to avoid space
leaks when Tcl/tk is the master and Prolog the slave.
library('linda/client')
: New predicate shutdown_server/0
.
The server keeps running after receiving this signal, until such time as all
the clients have closed their connections. Courtesy of Malcolm Ryan.
Bug fixes:
skip_line/1
, at_end_of_file/0
, tab/2
.
include/1
directive.
save_program/[1,2], save_files/[1,2]
: check for I/O errors;
problems with '$ref'/2
terms; problems with SICStus Objects.
unload_foreign_resource/1
: false alarm in prelinked binaries.
library(tcltk))
: Bug fixes and enhancements; see the New
Features
section above for details.
spld
/splfr
on Windows: Errors are now properly reflected in
the exit code from these programs.
library(clpfd)
: disequations speeded up, bugs in
disjoint1/[1,2]
, disjoint2/[1,2]
, element/3
,
propagation, entailment detection, backward compatibility.
spld --static
, load (non-prelinked) dynamic foreign
resources. With this workaround loading a dynamic foreign resource into
a static SICStus executable will still, unnecessarily, load the shared
version of the SICStus runtime system (libsprt310.so
) but the
shared runtime system will not be used. This will be fixed in a
forthcoming release.
Version 3.8.5 is mainly a bugfix release. New features:
copy_term/2
and call_residue/2
now support finite domain
variables.
terms:term_variables_bag/2
is like
terms:term_variables/2
, but its output argument is a list of
variables in order of first occurrence.
bdb:db_open/5
is generalized so that a cache size can be provided.
clpfd:fd_neighbors/2
is a new exported predicates. It is the relation
that clpfd:fd_closure/2
is the transitive closure of.
Bug fixes:
current_atom/1
now terminates correctly.
once/1
is now handled correctly in ISO mode.
predicate_property/2
now handles built-ins correctly.
prolog_flag/2
alias current_prolog_flag/2
now behave as pure
relations in SICStus execution mode.
read/[1,2]
now handle character code 0 correctly.
save_files/2
, save_predicates/2
, and save_modules/2
do not replace given output file extensions. A .po
extension
will be added if none is given. Note, however, that load_files/[1,2]
will only recognize files with a .po
extension as .po
files.
statistics(trail,L)
and statistics(choice,L)
are more
accurate.
stream_code/2
now handles errors correctly.
stream_interrupt/3
raises an existence error under Windows.
stream_property/2
now handles alias/1
property for standard
streams correctly.
stream_select/3
now returns a valid list of streams, and
raises an existence error under Windows.
call/1
.
SP_cons_list
and SP_cons_functor
.
SP_open_query()
are safe.
character_escapes
flag is obeyed in ISO execution mode.
prolog-comment-region
now
uses triple percent signs, to cater for indent-region
.
clpfd:full_answer
functionality has been repaired,
affecting frozen/2
, clpfd:attribute_goal/2
and clpfd:fd_copy_term/3
. clpfd:fd_global/3
is now
a meta-predicate.
sockets:socket_select/[5,6]
are now steadfast;
better error handling.
sockets:socket_select/[5,6]
now work correctly with non-socket
streams that use file descriptors on systems where sockets and file
descriptors are treated the same (i.e. not Windows).
system:working_directory/2
is now insensitive to any
loads in progress. Its arguments are not subject to
absolute_file_name/2
processing--that was never intended.
timeout:time_out/3
now cleans up properly after abort.
library(bdb)
now handles wide characters, e.g. in error messages.
library(clpfd)
now cleans up properly after integer overflows,
and does not assume a 32-bit architecture.
clpfd:cumulative/[4,5]
now check that the resource limit is not
exceeded by any single task.
[-term]
. The problem occurred if the foreign function
did many calls to SP_term_ref()
or if it raised an exception.
spld
and splfr
on Windows 95/98.
spld
and splfr
tried to use a nonexisting file. The
file (sprt.exp
) is now included in the distribution.
halt/0
and abort/0
are handled better in runtime systems
of type --main=load
and --main=restore
.
library(jasper)
and
se/sics/jasper/SICStus
etc.) has been improved:
SPTerm
and SPQuery
now properly detect improper usage and
raise exceptions instead of crashing in the Prolog runtime system.
jasper_call/4
makes foreign
resources and splfr
strictly optional when calling Java from
Prolog.
SPTerm()
is no longer public, it was always
documented as "should really have been private". Use the contructor
SPTerm(SICStus)
instead.
IllegalCallerException
is no longer used. You
should change your code to reflect this. One possible change is to
change throws IllegalCallerException
into throws
SPException
, this works for the 3.8.4 version as well.
IllegalTermException
is new. It is signalled when
attempting to use a SPTerm where the corresponding term ref is no longer
valid. You need to update your code (typically adding throws
IllegalTermException
). One possible change is to use the less specific
throws SPException
instead of throws IllegalTermException
,
this should work for the 3.8.4 version as well.
SICStus.readFromString()
and new versions of
SICStus.openQuery()
etc.
SPPredicate
is now deprecated. The preferred method is to supply
module and predicate name explicitly.
call(M:Goal)
where M
is the module specified when creating the query. This
makes goal expansion and meta argument expansion do the right thing,
i.e. behave as if entered interactively.
SPTerm
object, making
the Prolog side term-ref available for re-use. See
SPTerm.delete()
.
JavaServer
etc. is now more clearly marked as unsupported example
code. It represents an unfinished sockets based Jasper interface. It
does not belong in the se.sics.jasper
package and will be removed at a
later date.
library(tcltk)
. When Tcl/Tk calls Prolog, it now ignores the
returned values of all unbound variables and variables with names
starting with underscore _
. In 3.8.4, it used to
ignore only anonymous variables.
Version 3.8.6 is mainly a bugfix release. New features:
SP_atom
documented as a data type.
library(jasper)
and Java foreign resources now
support null object references.
See Jasper Library Predicates.
library(jasper)
now works with JDK 1.3 (with some restrictions)
and JDK 1.3.1 as well as JDK 1.2.2. See Supported Java Versions.
Bug fixes:
splfr
code generation bug for [-term]
and +boolean
.
spld --sicstus=<PATH>
now works. You are unlikely to need it
though.
library(jasper)
.
SPTerm.delete()
sometimes did not enable reuse of the
deleted term ref.
java.exe
is the main
application, Java tries to do use_module(library(jasper))
, the
short pathname of the SICStus Prolog\bin
folder is on the
PATH
environment variable. As a work-around for the underlying
Win32 LoadLibrary
bug SICStus will now always use the long
pathname when loading foreign resources.
"Exception: 0xc000008e
(EXCEPTION_FLT_DIVIDE_BY_ZERO)"
. This also happened for some
applications that use Visual Basic for Applications (VBA) with the
SICStus Visual Basic module (vbsp.dll). A thorough discussion of this
issue and a solution is available in
library/vbsp/sp_fpwrap.h
. This solution is now used by the
SICStus Visual Basic module. We have had reports of this issue affecting
FileMaker, Rational Rose and Visio.
library(bdb)
now complains if run with a different version of
Berkeley DB than what was used for building it (BDB 2.7.7).
malloc()
for memory allocation when invoking SICStus
from Java, also on Linux. The default memory allocation method (using
sbrk
/brk
) is not thread safe on any platform.
.po
files and saved states: work around GCC bug
affecting endianness conversion.
seek/4
.
dif/2
and friends: memory management bug.
format/[2,3]
: avoid spurious time-out exceptions.
freeze(V,V)
behavior bug.
number_chars/2, number_codes/2
: bug affecting empty lists.
library(bdb)
now verifies that BDB version 2.7.7 is used.
library(clpfd)
: missing distribution files; buggy action handling
of user-defined global constraints; wrong answers in
disjoint1/[1,2]
, disjoint2/[1,2]
, serialized/[2,3]
,
and cumulative/[4,5]
; integer overflow checks; error detection in
FD set operations; complexity of fd_closure/2
and
fd_copy_term/3
; entailment action in element/3
.
library(clpq,clpr)
: bug affecting bb_inf/3
and strict inequalities.
library(jasper)
now enforces the use of malloc
for
memory management, also on Linux.
sockets:socket_buffering/4
: bug handling 3rd arg.
library(tcltk)
: some demos depended on current working directory.
library(xref)
: handling of catch/3
.
Version 3.8.7 is mainly a bugfix release. New features:
Bugs fixed:
findall/3
and friends, sort/2
, keysort/2
.
atom_codes/2
, atom_chars/2
, number_codes/2
, and
number_chars/2
were not steadfast.
library(timeout)
: Some timeouts were ignored if they occurred during
exception handling.
library(timeout)
: If the timer cannot be set up (using setitimer
),
then a system error exception is raised. This happens on Solaris in
multi-threaded applications, e.g. when using SICStus with Java.
SP_deinitialize
not working properly.
~@
were not called as fully general goals.
listing/[0,1]
did not module prefix bodies of imported
predicates correctly.
library(clpfd)
: some Boolean constraints were incorrectly
macro-expanded; some type errors merely failed; over-zealous integer
overflow detection in arithmetic.
sockets:socket_select/[5,6]
will work correctly also for input
buffered socket streams. You no longer need to disable buffering with
sockets:socket_buffering/4
just to get
sockets:socket_select/[5,6]
to work.
library(sockets)
: A signal delivered to the process will no
longer cause any socket predicates to give an error (proper EINTR
handling). A downside to this is that SICStus no longer is interruptible
with ^C (SIGINT
) while blocking except in
sockets:socket_select/[5,6]
. In the case of
sockets:socket_select/[5,6]
, signal delivery will be treated as
if the select()
call had a zero timeout. Such spurious timeouts
are a potential backward compatibility issue.
sockets:socket_buffering/4
: A crashing bug introduced in 3.8.6.
Added argument validation so that it now fails on non-socket streams and
other incorrect arguments. Note that the primary reason for changing
socket buffering prior to 3.8.7 is gone since
sockets:socket_select/[5,6]
now work also for input buffered sockets.
system:file_property/2
failed to recognize symbolic links as such.
SPTerm.consFunctor
. This
also affected all read-from-string type methods.
SPTerm.getNumberChars
called an undefined native method.
library('clpqr/examples/mip')
would not load properly.
spld --static
used incorrect options when specifying
static linking to Sun Workshop C-compiler.
Every message issued by the Prolog system is displayed using the
built-in predicate print_message/2
. Similarly, all user input is
handled by the new built-in predicate ask_query/4
. The behavior
of these predicates can be customized by a number of new hooks. For
example, all I/O can be redirected from the standard streams to Tcl/Tk
or similar windows. The default appearance of system messages has also
changed.
The mapping from Prolog terms representing messages to printed messages
is now completely transparent and customizable. The new
library('SU_messages')
file defines the mapping rules.
Runtime systems can display system messages in standard format by
loading this file.
A number of new hooks have been added for the message and query system:
generate_message_hook/3
, generate_message/3
,
message_hook/3
, print_message_lines/3
,
query_hook/6
, query_class_hook/5
,
query_input_hook/3
, query_map_hook/4
.
See Messages and Queries.
The determinacy checker, spdet
, is a new, powerful tool
originally written by Dave Bowen and Peter Schachte.
The determinacy checker can help you spot unwanted nondeterminacy in your programs. This tool examines your program source code and points out places where unintended nondeterminacy may arise. Unintended nondeterminacy should be eradicated because
library(xref)
of previous releases has been replaced by a much
more powerful tool, spxref
, originally written by Tom Howland.
The main purpose of the cross-referencer is to find
unreachable code. To this end, it begins by looking for a definition
for user:runtime_entry/1
and also looks for initializations, hooks,
module export lists and
public
directives to start tracing the reachable code from.
A second function is to aid in the formation of module statements. It
can list all of the required module/2
and use_module/2
statements by file.
See The Cross-Referencer.
On Windows, library(comclient)
makes it possible to control COM
Automation objects.
See COM Client.
The PiLLoW library is a free Internet/WWW programming library which simplifies the process of writing applications for such environment. The library provides facilities for generating HTML or XML structured documents by handling them as Prolog terms, producing HTML forms, writing form handlers, processing HTML templates, accessing and parsing WWW documents (either HTML or XML), accessing code posted at HTTP addresses, etc. See PiLLoW.
Generally, performance has been improved, in terms of CPU time as well as memory. Specific new features:
assert/1
, findall/3
,
raise_exception/1
and friends are now safe to use on non-ground
terms containing domain variables.
labeling/2
takes a new option which supports limited discrepancy
search. To support this, the apply_bound/1
API has been replaced
by predicates called first_bound/2
and later_bound/2
.
knapsack/3
is a domain consistent special
case of scalar_product/4
.
global_cardinality/2
constrains the number of
occurrences of given integers in a list.
case/4
.
disjoint2/2
takes a new option which tells the constraint to
perform stronger reasoning if some rectangles have the same origin and
certain other conditions are fulfilled.
serialized/3
and cumulative/5
take a new option which
tells the constraint whether to only adjust domain bounds. This is
now the default.
precedences/1
option of the same constraints has a more
general format.
cumulatives/[2,3]
generalizes
cumulative/[4,5]
by considering multiple resources, positive and
negative resource consumption, and lower and upper bounds.
It is now possible to embed saved states into an executable. Together with static linking, this gives an executable which does not depend on external SICStus files. See All-in-one Executables.
It is now possible to have more than one SICStus run-time in a single process. See Multiple SICStus Run-Times, for details.
read_line/[1,2]
read one line of input into a
list of character codes.
stream_position_data/3
accesses the fields of a
stream position term.
goal_source_info/3
decomposes annotated goals
into a goal proper and a source position. Mostly used in displaying
error messages.
undo/1
, which posts a goal for execution on
backtracking, has been revived.
absolute_file_name/3
is a new variant of
absolute_file_name/2
taking a number of options to give full
control over the conversion from relative to absolute filename.
read_term/[2,3]
takes a new option which controls whether the
layout-text-item which follows the terminating . should be
consumed.
trimcore/0
trims the Prolog stacks.
,
, ;
, ->
, and \+
.
user:breakpoint_expansion/2
, has been added for user defined
breakpoint conditions.
library(bdb)
provides a way to flush all modified
records to disk after each operation.
library(charsio)
provides the new predicates
read_term_from_chars/3
and write_term_to_chars/[3,4]
.
library(system)
provides the new predicates now/1
and
datime/2
.
library(clpq,clpr)
provides the new predicate
projecting_assert/1
.
SP_set_read_hook()
is now obsolescent. See Hooks.
SP_event()
can now be called from arbitrary OS
threads. See Calling Prolog Asynchronously.
splfr
generates a header file from the foreign/[2,3]
declarations. This file should be included in the corresponding C file
to protect against incorrect foreign declarations and also to ensure
compatibility with various compile time settings used by splfr
.
The name of the file can be specified with
--header=NAME
. To produce the file and nothing more, you
can use the new --nocompile
flag as in
splfr --header=foo.h --nocompile foo.plThis is especially useful when
foo.h
is a Makefile
prerequisite.
splfr
and spld
now use descriptive names for generated
files, especially when the flag --keep
is specified.
spld --moveable
now produces an executable which can be moved,
together with its directory tree (see Runtime Systems on Target Machines) on Solaris and Linux (it always worked on Windows).
spld
options,
--lang
--main=load
and --main=restore
.
--memhook
SP_set_memalloc_hooks
).
spld --help
to get details on these and other
options.
sicstus
and, on Windows, spwin
)
now take option --iso
and --sicstus
to start up in ISO
Prolog mode and SICStus Prolog mode respectively.
<sicstus/sicstus.h>
. For SICStus 3.9.1, they are
defined as:
#define SICSTUS_MAJOR_VERSION 3 #define SICSTUS_MINOR_VERSION 9 #define SICSTUS_REVISION_VERSION 1 #define SICSTUS_BETA_VERSION 0 /* Two digit position for MAJOR, MINOR and REVISION */ #define SICSTUS_VERSION 30901
SP_read_from_string
takes a string
representation of a Prolog term and a table of variable values and
creates a Prolog term. By reading a goal from a string and passing the
resulting term to call/1
, this also gives a very simple way to call
arbitrary goals from C.
See Creating Prolog Terms.
SP_define_c_predicate
makes it possible to
dynamically define a Prolog predicate that calls a C
function. See Calling C.
SP_mutex_lock
, SP_mutex_unlock
, C type
SP_mutex
and static initializer
SP_MUTEX_INITIALIZER
. These provide a platform independant
(recursive) mutual exclusion lock. These are mainly useful when more than
one SICStus run-time is used (in different threads) in the same
process.
See Operating System Services.
SP_APP_DIR
and SP_RT_DIR
are set
(by SP_initialize
) to the folder containing the executable and
the folder containing the SICStus run-time, respectively. This provides
a location independent way to locate files (such as saved states) that
are located together with the application.
Also available as the file search aliases application
and runtime
.
See Input Output.
SIGBREAK
will cause halt/0
to be
called in a development system. This will ensure that halt/0
is
called in sicstus.exe
when the console window is closed or when
the user logs off. The windowed version of SICStus (spwin.exe
)
also sends itself a SIGBREAK
when the GUI window is closed, causing
halt/0
to be called.
absolute_file_name/2
has changed slightly.
It no longer looks for an existing file with a .pl
extension
if the given relative file name has no extension. The old behavior
can be achieved with:
old_absolute_file_name(RelFileSpec, AbsFileName) :- Options = [ file_type(source), access(exist), file_errors(fail) ], ( absolute_file_name(RelFileSpec, AbsFileName, Options) -> true ; absolute_file_name(RelFileSpec, AbsFileName, []) ).
debugger_command_hook/2
takes a different first
argument.
print_message/2
does not take a force/1
severity.
stream_interrupt/3
and stream_select/3
were unsafe, and have been removed. The latter can be replaced
by the following equivalent definition, which
works for file descriptor streams on UNIX and, for socket streams, on
Windows as well:
:- use_module(library(sockets)). stream_select(Streams, TimeOut, ReadStream) :- socket_select([], _, TimeOut, Streams, ReadStream).
splfr
. The removed predicates
are link_foreign_resource/6
,
are prepare_resource_table/2
, and
prepare_foreign_resource/3
. See The Foreign Resource Linker, for
details on using splfr
.
reinitialise/0
is gone.
--import
flag to splfr
is no longer supported.
apply_bound/1
API for branch & bound search has been
replaced by predicates called first_bound/2
and
later_bound/2
.
all_different/[1,2]
and
all_distinct/[1,2]
require bounded domains.
serialized/[2,3]
and
cumulative/[4,5]
only prune the bounds of domains,
not inside them, unless the bounds_only(false)
option is given.
library(db)
has been removed.
library(xref)
has been replaced.
library(flinkage)
is no longer supported. It is still present to
help porting really old code.
<sicstus/sicstus.h>
now uses stricter function
type prototypes. This may expose problems in code that used to
compile without warnings in previous versions of SICStus.
jasper_call/4
introduced in
SICStus 3.8.5 so you should migrate your code even if you are still
using SICStus 3.8.
libspnative.so
(spnative.dll
on Windows) where
it used to load libjasper.so
. This will probably be invisible to
most users.
se.sics.jasper
that operate on a SICStus
object will now throw an error if called from a thread other
than that which created the SICStus object. This is similar to the
behavior in early versions of 3.8.
SICStus 3.9 introduces a new thread safe Jasper API, which is not backwards compatible with the Jasper API of 3.8. However, the old API has been amended to be compatible with the thread safe API, making it possible to write Java programs that can run in both modes.
SP_signal
are now deferred until
Prolog can call them safely. This makes SP_signal
unsuitable for
handling synchronous signals such as SIGSEGV
. See Signal Handling.
at_end_of_stream/0
, get/1
, get0/1
, put/1
,
skip/1
, tab/1
incorrectly required that the current input
stream be a text stream.
stream_property(S, end_of_stream(...))
now works for tty streams.
user:goal_expansion/3
was called with the wrong second argument
for imported and built-in predicates.
require/1
was broken.
\c
could be misread.
charsio:format_to_chars/[3,4]
are now meta-predicates.
charsio:format_to_chars/[3,4]
is now re-entrant.
library(clpfd)
: some Boolean constraints were incorrectly
macro-expanded; some type errors merely failed; over-zealous integer
overflow detection in arithmetic; unifying domain variables did not
work reliably and failed silently when type errors were intended.
library(clpq,clpr)
:
Variables introduced via ordering/1
were not
initialized fully.
library('linda/client')
: shutdown_server/0
now raises an
existence error if there is no connection to the server available.
splfr
now converts the resource name to
lowercase. This is to match the fact that SICStus converts path names
to lowercase on Windows.
sockets:socket_select/[5,6]
, signal delivery will be
treated as if the select()
call had a zero timeout. Such
spurious timeouts are now handled invisibly within library(sockets)
and
will not be seen by user code.
library(bdb)
, library(tcltk)
) can only be loaded by one
SICStus run-time in the same process. The second run-time that attempts to load e.g.
library(bdb)
, will raise an exception. This only affects code
that loads several SICStus run-times (e.g. using the Java interface).
Version 3.9.1 is mainly a bugfix release. New features:
library('linda/server')
now also prints the address of connecting
clients.
library('linda/server')
can apply a user specified filter to
reject or accept incoming connections; see Server.
--moveable
option to splfr
.
--nocompile
option to spld
.
clpfd:case/4
takes a new option which effectively extends the
relation by one argument, corresponding to the ID of the leaf node
reached by a particular tuple. Every ID should be a unique integer.
Several consistency checks added.
clpfd:all_different/1
takes a new option consistency(C)
to control the level of consistency to be achieved. This supersedes the
old option global(Bool)
.
clpfd:sorting/3
is a new constraint, capturing the relation
between a list of values, a list of the values in ascending order,
and their positions in the original list.
clpfd:fd_var/1
is new;
checks that the argument is currently an unbound variable which is
known to the CLPFD solver.
SP_get_integer_bytes
, SP_put_integer_bytes
can be used to
pass arbitrarily sized integers (bignums) between C and
Prolog. See Accessing Prolog Terms.
Other changes:
$SP_APP_DIR/sp-3.9.1/
. If no such
directory can be found, the old name ($SP_APP_DIR/lib/
) is tried
as well.
Bugs fixed:
listing(_:_)
printing imported clauses multiple times.
knapsack/3
broken; problems with very large
domain bounds; bugs in disjoint2/2
with wrap/4
option;
missing solutions in case/4
; fd_copy_term/3
did not
preserve all domain variables.
--output
option to splfr
broken.
sp_GlobalSICStus
is now defined also when
--main=none
is passed to spld
.
spxref
: did not follow arbitrary directives;
problem with absolute file name resolution.
Jasper
: client thread did not detect failure of server thread to
create a SICStus object.
Jasper
: bugs in class Jasper$JasperProlog
:
consFunctor
and consList
gave
NoSuchMethodException
.
Jasper
: [-term]
in method meta-calls to Java from Prolog
did not work.
Jasper
: Java longs (64-bit signed ints) passed between Java and
Prolog are no longer truncated to 32 bits.
Jasper
: bugs in class Jasper$JasperTerm
: compare
,
getArg
, getDouble
, getFunctorArity
, getList
,
and unify
did not work properly.
Jasper
: bugs in class SICStus
: consFunctor(String,
Term[])
and newTerm(String, Term[])
gave
ClassCastException
.
Jasper
: Fixed bug causing ClassCastException
when doing
callbacks in thread safe Jasper. Jasper did not keep track of current
caller properly.
w
or W
.
--multi-sp-aware
foreign resources.
SP_raise_exception
) and failure
(SP_fail
) from foreign resource init
or deinit
functions are now handled; see
Init and Deinit Functions.
unload_foreign_resource(Name)
now raises an existence error
instead of merely failing if no foreign resource Name is loaded.
library(fastrw)
now raises an existence error when reading a term
from an already closed stream, similar to get/1
etc. It used to
give some arbitrary error in this case. The library still does not
handle end of file within terms.
library(fastrw)
is an (undocumented) support library used by
library('linda/client')
, library('linda/server')
and
library(bdb)
.
linda:linda/1
is now a meta-predicate.
library(comclient)
would crash for in/out arguments passed as a
mutable.
system:mktemp/2
, system:tmpnam/1
: Added error checking.
On some platforms the linker would complain about possibly unsafe use of
mktemp()
when linking statically with the system
foreign
resource. This has been worked around by using mkstemp()
internally when available. For this reason, file names created by
system:tmpnam/1
may differ from earlier releases.
The robustness and security issues surrounding the use of the ANSI C
mktemp()
and tmpnam()
routines also applies when using
system:mktemp/2
and system:tmpnam/1
.
library(sockets)
now ensures that SIGPIPE
is
ignored in run-time systems (It was always ignored on development
systems). This avoids having the process killed by SIGPIPE when SICStus
writes to a socket where the other end has closed the connection.
The fix involves a partial redesign of the memory allocator. The API
function SP_set_memalloc_hooks
has changed
incompatibly. See Initializing the Prolog Engine.
As a consequence of the changes to the memory allocator, the
sicstus
option -m
and the spld
option
--memhook
are no longer meaningful. They are ignored for
compatibility but will be removed in some future release.
As another consequence of the changes, the "aligned pointer" concept and all such requirements in the foreign language interface have been dropped.
On Windows and Linux the memory for the Prolog stacks are now pre-allocated when initializing the SICStus run-time. This makes it less likely that the memory allocations of other parts of the application, such as Java, will conflict with the allocation needs of SICStus.
This pre-allocation affects applications that use more than one SICStus
run-time in the same process, e.g. from Java. The first initialized
SICStus run-time will typically reserve all memory usable for Prolog
stacks. This means that subsequent SICStus run-times initialized in the
same process will fail. Set the environment variable
PROLOGMAXSIZE
to a suitable value to work around this
problem. See Environment Variables.
As part of the memory manager re-design, the SICStus API functions
SP_malloc
, SP_calloc
, SP_realloc
now take
size_t
size arguments instead of unsigned int
, just as
their standard C equivalents.
spld
option --more-memory
. This option modifies the linker
script on x86 Linux so that almost 256MB can be used by the Prolog
stacks. It is ignored on other platform. This option should be
considered experimental.
spld
takes new options:
--resources-from-sav
--no-resources-from-sav
.sav
file. Thus you do not need to know what foreign resources are used by
the loaded prolog code. This is now the default for static executables
when no other resources are specified apart from an embedded saved
state. To turn off this feature, use --no-resources-from-sav
.
-E
--extended-rt
SP_LIBRARY_DIR
is set during SICStus
initialization to the location of the SICStus library files. This is
similar to SP_APP_DIR
and SP_RT_DIR
. See Environment Variables.
toString(Term options)
. The implementing class SPTerm
calls
write_term/3
.
library(timeout)
now measures the user
mode time of the SICStus thread. On Windows 95/98/ME, the time is still
walltime.
statistics(runtime, ...)
now measures the
user time of the SICStus thread. This is the same as process user time
for a single-threaded program but makes statistics(runtime, ...)
meaningful also in a program with several threads (such as when using
Java or multiple SICStus runtimes).
library(bdb)
: now requires Berkeley DB 4.1.24
instead of 4.0.14. The predicate db_sync/1
is new.
library(clpfd)
:
assignment/2
and global_cardinality/2
take
new options, associating with the constraint a cost which is reflected
into a domain variable.
lex_chain/[1,2]
expresses the fact that several
vectors of domain variables are in ascending lexicographic order.
fd_global/3
has been extended with new options.
profiledcode
.
restore/1
when library(clpfd)
had been loaded
would sometimes crash SICStus with a memory access error.
library(comclient)
did not dispose of all references to COM
objects. comclient_garbage_collect/0
did not work correctly
(but should not be needed if you use comclient_release/1
).
SP_garbage_collect_external_objects
would reclaim live
objects. This affected comclient_garbage_collect/0
.
-Dsicstus.path
should no longer be needed when
using Jasper, except in exceptional circumstances. SICStus will use the
location of the SICStus run-time library, e.g.
libsprt310.so
to set this up automatically.
SP_initialize
will now return an error code if memory could not
be allocated. It used to terminate the process. Among other things this
ensures that creating a se.sics.jasper.SICStus
object will throw
an exception instead of terminating Java if there is insufficient
memory.
library(timeout)
is now more precise, in particular when calls to
time_out/3
are nested. The resolution has not been improved, it
is still on the order of a few tens of milliseconds.
library(timeout)
on Windows could sometimes deadlock or otherwise
behave erratically.
format/[2,3]
reported errors inconsistently.
undo/1
: missing meta-predicate declaration.
library(clpfd)
: constraints without arguments handled
incorrectly; inconsistent overflow handling; heap overflow detection;
bugs in element(X,L,Y)
with non-ground L
;
bugs in disjoint2/2
with margin/4
option.
library(chr)
: spurious error messages could occur when
loading CHR files from all-in-one executables.
library(objects)
:
Dangling pointer problems with instances if the class
was asserted to after the instance had been created.
library(jasper)
:
Memory leak when calling a Java method.
Segmentation fault on Solaris when passing arguments declared as +term
.
library(gauge)
: The help button did not work on Windows if
SICStus was installed in the default location or other folder with a
space in the path.
splfr --exclusive-access
could
not be loaded more than once into the same process. The only SICStus
library affected is library(system)
.
unload_foreign_resource/1
now takes the name of a
foreign resource. For backward compatibility it still accepts a file
name treated as for load_foreign_resource/1
. See Foreign Resources. unload_foreign_resource/1
is still a meta-predicate but
the module is ignored.
spdet
and spxref
tools now work also when installed
as part of a pre-built binary installation.
t
(backtrace n) showed too much.
SP_read_from_string
would leak memory.
D:\foo.exe
.
sprt310.lib
to sprt310_static.lib
. At the same time
the import library for the dynamic SICStus run-time has changed to
sprt310.lib
. This change should only affect those that do not use
spld
to build executables.
splm
obsolete on Windows.
vbsp.pl
and vbsp.po
are gone. A side benefit of
this is that you can call restore/1
from Visual Basic, even
though calling load_files/2
may be better.
On 32-bit architectures, the total size of the Prolog stacks cannot
exceed 256 MB. Under Linux, the default placement of the TEXT
segment constrains the Prolog stack address range, so in practice the
limit there is 128 MB unless the spld
option --more-memory
is used.
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.
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 mailing list for communication among users and implementors. To subscribe, write a message to majordomo@sics.se with the following line in the message body:
subscribe sicstus-users