SWI-Prolog 5.6.53 Reference Manual: Section 1.6

## 1.6 Release Notes

Collected release-notes. This section only contains some highlights. Smaller changes to especially older releases have been removed. For a complete log, see the file `ChangeLog` from the distribution.

### 1.6.1 Version 1.8 Release Notes

Version 1.8 offers a stack-shifter to provide dynamically expanding stacks on machines that do not offer operating-system support for implementing dynamic stacks.

### 1.6.2 Version 1.9 Release Notes

Version 1.9 offers better portability including an MS-Windows 3.1 version. Changes to the Prolog system include:

- Redefinition of system predicates
  Redefinition of system predicates was allowed silently in older versions. Version 1.9 only allows it if the new definition is headed by a :- redefine_system_predicate/1 directive.top-level
- `Answer' reuse
  The top-level maintains a table of bindings returned by top-level goals and allows for reuse of these bindings by prefixing the variables with the $ sign. See section 2.8.
- Better source code administration
  Allows for proper updating of multifile predicates and finding the sources of individual clauses.

### 1.6.3 Version 2.0 Release Notes

New features offered:

- 32-bit Virtual Machine
  Removes various limits and improves performance.
- Inline foreign functions
  `Simple' foreign predicates no longer build a Prolog stack-frame, but are directly called from the VM. Notably provides a speedup for the test predicates such as var/1, etc.
- Various compatibility improvements
- Stream based I/O library
  All SWI-Prolog's I/O is now handled by the stream-package defined in the foreign include file `SWI-Stream.h`. Physical I/O of Prolog streams may be redefined through the foreign language interface, facilitating much simpler integration in window environments.

### 1.6.4 Version 2.5 Release Notes

Version 2.5 is an intermediate release on the path from 2.1 to 3.0. All changes are to the foreign-language interface, both to user- and system-predicates implemented in the C-language. The aim is twofold. First of all to make garbage-collection and stack-expansion (stack-shifts) possible while foreign code is active without the C-programmer having to worry about locking and unlocking C-variables pointing to Prolog terms. The new approach is closely compatible to the Quintus and SICStus Prolog foreign interface using the `+term` argument specification (see their respective manuals). This allows for writing foreign interfaces that are easily portable over these three Prolog platforms.

Apart from various bug fixes listed in the ChangeLog file, these are the main changes since 2.1.0:

- ISO compatibility
  Many ISO compatibility features have been added: open/4, arithmetic functions, syntax, etc.
- Win32
  Many fixes for the Win32 (NT, '95 and win32s) platforms. Notably many problems related to pathnames and a problem in the garbage collector.
- Performance
  Many changes to the clause indexing system: added hash-tables, lazy computation of the index information, etc.
- Portable saved-states
  The predicate qsave_program/[1,2] allows for the creating of machine independent saved-states that load very quickly.

### 1.6.5 Version 2.6 Release Notes

Version 2.6 provides a stable implementation of the features added in the 2.5.x releases, but at the same time implements a number of new features that may have impact on the system stability.

- 32-bit integer and double float arithmetic
  The biggest change is the support for full 32-bit signed integers and raw machine-format double precision floats. The internal data representation as well as the arithmetic instruction set and interface to the arithmetic functions has been changed for this.
- Embedding for Win32 applications
  The Win32 version has been reorganised. The Prolog kernel is now implemented as Win32 DLL that may be embedded in C-applications. Two front ends are provided, one for window-based operation and one to run as a Win32 console application.
- Creating stand-alone executables
  Version 2.6.0 can create stand-alone executables by attaching the saved-state to the emulator. See qsave_program/2.

### 1.6.6 Version 2.7 Release Notes

Version 2.7 reorganises the entire data-representation of the Prolog data itself. The aim is to remove most of the assumption on the machine's memory layout to improve portability in general and enable embedding on systems where the memory layout may depend on invocation or on how the executable is linked. The latter is notably a problem on the Win32 platforms. Porting to 64-bit architectures is feasible now.

Furthermore, 2.7 lifts the limits on arity of predicates and number of variables in a clause considerably and allow for further expansion at minimal cost.

### 1.6.7 Version 2.8 Release Notes

With version 2.8, we declare the data-representation changes of 2.7.x stable. Version 2.8 exploits the changes of 2.7 to support 64-bit processors like the DEC Alpha. As of version 2.8.5, the representation of recorded terms has changed, and terms on the heap are now represented in a compiled format. SWI-Prolog no longer limits the use of malloc() or uses assumptions on the addresses returned by this function.

### 1.6.8 Version 2.9 Release Notes

Version 2.9 is the next step towards version 3.0, improving ISO compliance and introducing ISO compliant exception handling. New are catch/3, throw/1, abolish/1, write_term/[2,3], write_canonical/[1,2] and the C-functions PL_exception() and PL_throw(). The predicates display/[1,2] and displayq/[1,2] have been moved to `library(backcomp)`, so old code referring to them will autoload them.

The interface to PL_open_query() has changed. The debug argument is replaced by a bitwise or'ed flags argument. The values `FALSE` and `TRUE` have their familiar meaning, making old code using these constants compatible. Non-zero values other than `TRUE` (1) will be interpreted different.

### 1.6.9 Version 3.0 Release Notes

Complete redesign of the saved-state mechanism, providing the possibility of `program resources'. See resource/3, open_resource/3, and qsave_program/[1,2].

### 1.6.10 Version 3.1 Release Notes

Improvements on exception-handling. Allows relating software interrupts (signals) to exceptions, handling signals in Prolog and C (see on_signal/3 and PL_signal()). Prolog stack overflows now raise the `resource_error` exception and thus can be handled in Prolog using catch/3.

### 1.6.11 Version 3.3 Release Notes

Version 3.3 is a major release, changing many things internally and externally. The highlights are a complete redesign of the high-level I/O system, which is now based on explicit streams rather then current input/output. The old Edinburgh predicates (see/1, tell/1, etc.) are now defined on top of this layer instead of the other way around. This fixes various internal problems and removes Prolog limits on the number of streams.

Much progress has been made to improve ISO compliance: handling strings as lists of one-character atoms is now supported (next to character codes as integers). Many more exceptions have been added and printing of exceptions and messages is rationalised using Quintus and SICStus Prolog compatible print_message/2, message_hook/3 and print_message_lines/3. All predicates described in Deransart et al., 1996 are now implemented.

As of version 3.3, SWI-Prolog adheres the ISO logical update view for dynamic predicates. See section 4.13.1 for details.

SWI-Prolog 3.3 includes garbage collection on atoms, removing the last serious memory leak especially in text-manipulation applications. See section 9.6.2.1. In addition, both the user-level and foreign interface supports atoms holding 0-bytes.

Finally, an alpha version of a multi-threaded SWI-Prolog for Linux is added. This version is still much slower than the single-threaded version due to frequent access to `thread-local-data' as well as some too detailed mutex locks. The basic thread API is ready for serious use and testing however. See section 8.

#### 1.6.11.1 Incompatible changes

A number of incompatible changes result from this upgrade. They are all easily fixed however.

- !/0, call/1
  The cut now behaves according to the ISO standard. This implies it works in compound goals passed to call/1 and is local to the condition part of if-then-else as well as the argument of \+/1.
- atom_chars/2
  This predicate is now ISO compliant and thus generates a list of one-character atoms. The behaviour of the old predicate is available in the ---also ISO compliant--- atom_codes/2 predicate. Safest repair is a replacement of all `atom_chars` into `atom_codes`. If you do not want to change any source-code, you might want to use

      user:goal_expansion(atom_chars(A,B), atom_codes(A,B)).

- number_chars/2
  Same applies for number_chars/2 and number_codes/2.
- feature/2 , set_feature/2
  These are replaced by the ISO compliant current_prolog_flag/2 and set_prolog_flag/2. The library `library(backcomp)` provides definitions for these predicates, so no source must be updated.
- Accessing command-line arguments
  This used to be provided by the undocumented '$argv'/1 and Quintus compatible library unix/1. Now there is also documented `current_prolog_flag(argv, Argv)`.
- dup_stream/2
  Has been deleted. New stream-aliases can deal with most of the problems for which dup_stream/2 was designed and dup/2 from the clib package can with most others.
- op/3
  Operators are now local to modules. This implies any modification of the operator-table does not influence other modules. This is consistent with the proposed ISO behaviour and a necessity to have any usable handling of operators in a multi-threaded environment.
- set_prolog_flag(character_escapes, Bool)
  This Prolog flag is now an interface to changing attributes on the current source-module, effectively making this flag module-local as well. This is required for consistent handling of sources written with ISO (obligatory) character-escape sequences together with old Edinburgh code.
- current_stream/3 and stream_position
  These predicates have been moved to `library(quintus)`.

### 1.6.12 Version 3.4 Release Notes

The 3.4 release is a consolidation release. It consolidates the improvements and standard conformance of the 3.3 releases. This version is closely compatible with the 3.3 version except for one important change:

- Argument order in select/3
  The list-processing predicate select/3 somehow got into a very early version of SWI-Prolog with the wrong argument order. This has been fixed in 3.4.0. The correct order is select(?Elem, ?List, ?Rest).

  As select/3 has no error conditions, runtime checking cannot be done. To simplify debugging, the library module `library(checkselect)` will print references to select/3 in your source code and install a version of select that enters the debugger if select is called and the second argument is not a list.

  This library can be loaded explicitly or by calling check_old_select/0.

### 1.6.13 Version 4.0 Release Notes

As of version 4.0 the standard distribution of SWI-Prolog is bundled with a number of its popular extension packages, among which the now open source XPCE GUI toolkit (see section 1.5). No significant changes have been made to the basic SWI-Prolog engine.

Some useful tricks in the integrated environment:

- Register the GUI tracer
  Using a call to guitracer/0, hooks are installed that replace the normal command-line driven tracer with a graphical front-end.

- Register PceEmacs for editing files
  From your initialisation file. you can load `library(emacs/swi_prolog)` that cause edit/1 to use the built-in PceEmacs editor.

### 1.6.14 Version 5.0 Release Notes

Version 5.0 marks a breakpoint in the philosophy, where SWI-Prolog moves from a dual GPL/proprietary to a uniform LGPL (Lesser GNU Public Licence) schema, providing a widely usable Free Source Prolog implementation.

On the technical site the development environment, consisting of source-level debugger, integrated editor and various analysis and navigation tools progress steadily towards a mature set of tools.

Many portability issues have been improved, including a port to MacOS X (Darwin).

For details, please visit the new website at http://www.swi-prolog.org

### 1.6.15 Version 5.1 Release Notes

Version 5.1 is a beta-serie introducing portable multi-threading. See chapter 8. In addition it introduces many new facilities to support server applications, such as the new `library(rlimit)` library to limit system resources and the possibility to set timeouts on input streams.

### 1.6.16 Version 5.2 Release Notes

Version 5.2 consolidates the 5.1.x beta series that introduced threading and many related modifications to the kernel.

### 1.6.17 Version 5.3 Release Notes

Version 5.3.x is a development series for adding coroutining, constraints, global variables, cyclic terms (infinite trees) and other goodies to the kernel. The package JPL, providing a bidirectional Java/Prolog interface is added to the common source-tree and common binary packages.

### 1.6.18 Version 5.4 Release Notes

Version 5.4 consolidates the 5.3.x beta series.

### 1.6.19 Version 5.5 Release Notes

Version 5.5.x provides support for wide characters with UTF-8 and UNICODE I/O (section 2.17.1). On both 32 and 64-bit hardware Prolog integers are now at minimum 64-bit integers. If available, SWI-Prolog arithmetic uses the GNU GMP library to provided unbounded integer arithmetic as well as rational arithmetic. Adding GMP support is sponsored by Scientific Software and Systems Limited, www.sss.co.nz. This version also incorporates clp(r) by Christian Holzbaur, brought to SWI-Prolog by Tom Schrijvers and Leslie De Koninck (section A.8).

### 1.6.20 Version 5.6 Release Notes

Version 5.6 consolidates the 5.5.x beta series.