Ann: SWI-Prolog 8.1.30

Dear SWI-Prolog user,

I’m happy to announce the release of SWI-Prolog 8.1.30. A lot happened
and we are getting ready for 8.2.0. Highlights:

  • Implemented the core XSB tabling restraints. Restraints set limits
    on the computation (# answers, size of call and size of an answer).
    If a limit is exceeded the computation may be aborted but can also
    be asked to be continued with a WFS undefined result. This completes
    the planned tabling support for 8.2

  • Sebastian Sardina did more cleanup and documentation of JPL, the
    Java interface. This should also be practically ready for 8.2.

  • Keri found a nasty issue in cleanup of failed nondet foreign
    predicates that can (typically) lead to double-free memory management
    errors.

  • A bug in saveWakeup(), used for Prolog callbacks from the core in
    several places, could crash the system due to a stack-shift/GC.

  • Package fixes for clib and sgml for extremely long URIs. Last found
    and fixed (mostly) by Matt Lilley.

  • Added interfaces and documentation that deals with understanding
    and reasoning about binary compatibility between versions.

  • Added a basic C API for dicts: PL_is_dict(), PL_put_dict() and
    PL_get_dict_key().

In addition, a lot of work happened for the development tools:

  • Added a library(prolog_deps) that can compute use_module/autoload
    directives for a file as well as perform minimal updates to existing
    declarations. Used by PceEmacs. Available from the Prolog menu,
    and the key binding ^c^d. Currently only finds dependencies from
    the autoload library index. This is planned to be extended to also
    find non-autoload library files as well as (somehow) dependencies
    from the application under development. Planned to be part of 8.2

  • PceEmacs to dump output from the Documentation menu on predicates
    into an Emacs buffer called *Documentation* instead of dumping
    the docs to the console (causing problems as PceEmacs runs in a
    background thread and thus cannot read user input).

  • XPCE to use the _NET_WM_ICON X property, fixing the display of
    window icons in docks provided by modern X11 window managers.

  • PceEmacs to group Emacs windows in the Ubuntu dock by using the
    _NET_WM_PID X property.

  • XPCE replaced the default 16x16 simplified Window icon with a
    cute 48x48 owl.

In addition to the normal channels this version is also released as
a snap, which should install on almost all Linux versions using

snap install swi-prolog

Thanks for all the comments and contributions.

Enjoy --- Jan

SWI-Prolog Changelog since version 8.1.29

  • ADDED: Prolog flag abi_version

  • ADDED: API to access dicts from C.

  • MODIFIED: Allow for both _ and - as word separators for commandline
    arguments.

  • FIXED: help/1 to produce valid html (missing

    around generated
    discriptions).
  • ADDED: Interfaces and documentation to access and understand binary
    compatibility of the various interfaces between SWI-Prolog versions.

  • ADDED: library(prolog_deps) to compute dependency directives for a
    file and optionally edit the file in-place to add the directives.

  • FIXED: portray_clause/1 layout for lists in wrapped terms.

  • DOC: maplist/1-4.

  • XSB: Activated test_negcycle.P test. Prevent tests from interacting.

  • TEST: Disabled tnot/1 floundering test.

  • TEST: Use .. as subgoal_abstract(N) instead of flag as we cannot
    change to abstract tabling at runtime.

  • FIXED: abolish_table_subgoals/1: check for goal to be acyclic and
    raise an error if it is cyclic (XSB compatibility).

  • FIXED: subgoal_size restraint for single threaded case.

  • XSB: Started set_prolog_flag/2 mapping. Mapping
    unify_with_occurs_check

  • XSB: Added close_open_tables/1 (dummy)

  • XSB: test_large_tabled_terms test: use bounded_rationality.
    Var limit tests succeeds for SWI as we do not have such a limit.

  • XSB: compiler emulation to deal with the flags max_table_subgoal_size
    and max_table_subgoal_size_action.

  • CLEANUP: xsb/source.pl compiler emulator to use a DCG and allow
    maintaining state.

  • TEST: Modified XSB test to be conform XSB docs rather than the
    implementation. Final behaviour needs to be decided upon.

  • ENHANCED: get_residual/2 returns system undefined goals without
    qualification.

  • FIXED: autoloading from term_expansion/2 leads ton autoload loop.

  • PORT: Allow SIGABRT not to be defined.

  • FIXED: saveWakeup() could crash because PL_open_foreign_frame()
    can shift the stacks.

  • FIXED: Possible assertion failure in deleteCanonicalDir().
    Lev Lamberov.

  • BUILD: Drop TIPC if threads are not enabled.

  • DOC: Issue#574: order_by/2 variable handling

  • ENHANCED: Performance of bagof and setof for variables in the
    existential variables. Reported by Jan Burse.

  • FIXED: split_string/4 on long strings (Jos de Roo).

  • ADDED: BUF_NORING to avoid text from being buffered in the text ring
    and thus possibly be overwritten.

  • FIXED: Non-deterministic foreign predicates returning FALSE still
    had their PL_PRUNED handler called, possibly leading to double free.
    Keri Harris.

  • ADDED: subgoal_abstract radial constraint. Currently only implements
    the tripwire actions. The action abstract is the next target

  • FIXED: Properly copy tabling restraints from parent when creating a
    new thread. Jacco van Ossenbruggen.

  • SANDBOX: Allow for size_abstract_term/3.

  • SANDBOX: Allow setting the tabling tripwire flags.

  • SNAP: Added tcmalloc

Package clib

  • FIXED: Possible crash in uri_query_components/2 due to text ring
    buffer overflow. Jacco van Ossenbruggen.

Package http

  • SNAP: Try to get the location for jquery correct.

Package jpl

  • FIXED: Added missing @Deprecated.

  • MODIFIED: refactored term methods from Util to Term

  • MODIFIED: JPL version from 7.5.0 to 7.6.0

  • ADDED: Documentation on lists in JPL

  • ADDED: textual toString() for list terms

Package pengines

  • ENHANCED: When printing the WFS residual program leave out undefined/0
    and friends.

Package semweb

  • DOC: rdf_update/4 cannot change a graph. Jacco van Ossenbruggen.

Package sgml

  • FIXED: Possible buffer overrun in format_location(). Matt Lilley.

  • SECURITY: Potential buffer overflow when raising gripes involving
    files with very long filenames (such as files loaded via a URL with
    a long search parameter). It turns out that swprintf does not always
    append a NULL if the buffer is too short - it does on macOS but not
    on minGW or Ubuntu

Package swipl-win

  • MODIFIED: Change Qt settings basename from SWI-Prolog to swi-prolog,
    which merges the Qt config files with the other swi-prolog config
    files. Also changes setting up the default font to use Monospace
    and set hinting such that we really want a monospaced font.

Package xpce

  • ENHANCED: Use application->icon_image to group the frame.

  • ADDED: application<->icon_image to try and group all frames of
    an application under the same icon. Works for PceEmacs using the
    Ubuntu Dock.

  • MODIFIED: @pce_image is now an 48x48 SWI-Prolog owl instead of a 16x16
    owl without background. This image is used as the default icon for
    XPCE windows.

  • FIXED: X11: Use _NET_WM_ICON property to make the frame icon
    available. This fixes icons for docks on modern window managers.

  • ENHANCED: X11: Set _NET_WM_PID Window property to facilitate window
    grouping in the Ubuntu desktop.

  • ENHANCED: PceEmacs: make Documentation menu on predicates dump the
    documentation in an Emacs buffer named *Documentaion*.

  • FIXED: Handle oblique to request a slanted font (X11).

  • ADDED: PceEmacs Prolog mode: ->check_dependencies and
    ->update_dependencies

5 Likes

Thank you so much for the faster CLI invocation, I have prolog scripts which start much faster now (I think this happened before 8.1.30 though).

1 Like

That is due to the migration from use_module/1 to autoload/2 for the internal dependencies (together with a few removed dependencies). That reduces the number of libraries actually loaded in small scripts a lot. Note that creating a saved state probably reduces startup time even further.

Yes, I had done this, and now it is even faster, coming close, from the user experience point-of-view, to the regular command line utilities. Congratulations on this great work!

I just downloaded the .dmg for one of my older macs (which is running 10.13 High Sierra) and replaced the old SWI Prolog app in applications. But upon launching swipl from the console I now get the following. Any idea for what I ought to be doing to rectify this?

Welcome to SWI-Prolog (threaded, 64 bits, version 8.1.30)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.

For online help and background, visit [https://www.swi-prolog.org](https://www.swi-prolog.org/)
For built-in help, use ?- help(Topic). or ?- apropos(Word).

dyld: lazy symbol binding failed: Symbol not found: ____chkstk_darwin
  Referenced from: /Applications/SWI-Prolog.app/Contents/MacOS/../Frameworks/libncurses.6.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: ____chkstk_darwin
  Referenced from: /Applications/SWI-Prolog.app/Contents/MacOS/../Frameworks/libncurses.6.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib

That was after upgrading from which version? The CMake config demands 10.12 and upward compatibility. This release was built using gcc instead of clang though because Apple’s Xcode 11 slows down SWI-Prolog by nearly 50% while gcc makes it faster than Xcode 10. This might be related.

The previous version was 7.6.3. I would have stuck with it but it seemed to have some hardwired dependency path when I tried to run a C executable compiled using swipl-ld:

dyld: Library not loaded: /Users/janw/stable/lib/swipl/lib/x86_64-darwin15.6.0/libswipl.dylib

Anyhow, I got it running after going down the homebrew path instead.

Then we still do not know what is wrong :frowning: Anyway, swipl-ld and the bundle do not cooperate properly (probably still don’t). If you want to program in C/C++ against SWI-Prolog you best use Homebrew, Macports or compile yourself. Note that Xcode 11 produces very slow SWI-Prolog executables.