Ann: SWI-Prolog 8.3.24

Dear SWI-Prolog user,

SWI-Prolog 8.3.24 is ready for download. Quite few things happened.

  • @peter.ludemann did a lot of work improving the Google protocol
    buffer implementation.
  • Various tabling enhancements:
    • MODIFIED: library(dialect/xsb/increval) is moved to library(increval)
    • Support to to monotonic tabling on external data sources rather than
      only on dynamic predicates.
    • Fix in monotonic propagation
    • Fixed a possible crash (invalid compiled table)
  • Improved handling of errors and warnings for batch processing and
    -c compilation.
  • Improved escape sequences when writing quoted atoms and strings.
  • Fixed problem with nested reconsult (shows in expanded maplist/N
    being undefined on every even load).
  • Added undo/1 to push goals onto the trail to be executed on

Thanks for all the pull requests and comments.

Enjoy --- Jan

SWI-Prolog Changelog since version 8.3.23

  • FIXED: Issue#830: assertion failure in GUI debugger. Wouter Beek.

  • TEST: Make a test fail if an error message is printed.

  • FIXED: locale_create/3: handling of default and current_locale.

  • ADDED: Make the new on-error and on-warning options work both in
    normal mode and in compilation (-c) mode.

  • ENHANCED: Handle underscores and minus the same when parsing
    compilation options for -c.

  • ENHANCED: Enable color output when compiling

  • ADDED: Prolog flags on_error and on_warning connected to
    commandline options.

  • ADDED: Provide a (silent) message reporting the error and warning count
    while loading a file and document error handling during compilation.

  • ADDED: statistics/2 and thread_statistics/3 keys warnings and

  • ADDED: undo/1 to schedule goals to be called on backtracking.

  • FIXED: Issue#110: Nested consult/1 on already loaded files (reconsult)
    did not do generation management correctly.

  • MODIFIED: Renamed incr_propagate_answer/1 to incr_propagate_calls/1.
    Removed incr_invalidate_answer/1 (is incr_invalidate_calls/1).

  • FIXED: Ensure a compiled trie never ends in I_FAIL. This crashes
    the debugger.

  • FIXED: vm_list/1 for compiled tries.

  • ADDED: incr_propagate_answer/1 and incr_invalidate_answer/1.

  • MODIFIED: Move library(increval) from dialect/xsb to the core
    library. Code using the XSB emulation should run unmodified. Code that
    uses this library as library(dialect/xsb/increval) must be updated
    to load library(increval) or rely on autoloading.

  • DOC: Updated stream_property/2 for representation_error

  • ADDED: Prolog flag character_escapes_unicode

  • CLEANUP: Generalize fast access to boolean Prolog flags such that we
    can host more than 32.

  • ENHANCED: Use Unicode classifiers for deciding on which characters
    to escape for quoted write.

  • DOC: Escape sequences used for quoted write.

  • MODIFIED: Make quoted write depend on iswgraph() rather than not
    quote any non-ascii character. Escaped characters are written as

  • ADDED: code_type/2: category print

  • FIXED: Tighter checking correctness of sandbox declarations and fix
    wrong declaration for ‘$moded_wrap_tabled’/5 (was /4).

  • DOC: stream_property/2 representation_errors property.

  • DOC: Explain current status wrt dynamic and static linking.

  • BUILD: Added -DSWIPL_STATIC_LIB=ON config option to also build
    a static library.

  • BUILD: Use CMake OBJECT library as intermediate.

  • ENHANCED: Issue#825: Error handling when goal_expansion/2 binds a
    variable in \+/1 or ;/2.

  • ADDED: Prolog flag optimise_unify to prevent moving unifications to
    the head. as these harm notably the source level debugger experience.

  • FIXED: runtime change of det/1 property. Peter Ludemann.

  • FIXED: Fresh table that depends on an invalid monotonic lazy table
    causes a permission error.

  • DOC: “pinned” → “developed”

Package clib

  • ENHANCED: process_create/3: better error message if executable could
    not be found.

Package http

  • DOC: Small touches & updates

Package ltx2htm

  • FIXED: Handling of empty cells to emit a <td></td>

Package pengines

  • FIXED: pengine_property/2 in mode (+,+). David Tonhofer.

Package protobufs

  • ADDED: support for “packed”

  • FIXED: UTF-8 processing for string(Tag,…) ADDED:
    signed64(Tag,…) for .proto types int32,int64

Package sgml

  • TEST: Silence expected error messages.

Unfortunately the patch that adds the possibility to generate a static library in addition to the dynamic one broke the PGO compilation (compiles fine, but there is no speedup as the PGO compiler options were not passed to the right CMake target). Pushed 309291ee4889abb55505979a33853857af662657 to address this.

Somehow this flag doesn’t work on my side, using SWI-Prolog 8.3.25 on Windows:

I am trying:

:- set_prolog_flag(optimise_unify, false).
make_unify(A,B,C) :- C=(A,B).

?- listing(make_unify/3).
make_unify(A, B,  (A, B)).

Was expecting that listing/1 shows me make_unify(A,B,C) :- C=(A,B).

Logic of the flag was negated :frowning: Thanks.

Ok, I am using it now as follows:

% bug, should be false, wait for 8.3.26
:- set_prolog_flag(optimise_unify, true). 

Works like a charm, here is the result of the new inliner with head cleaning. Head cleaning assures that there is no head spilling through some unification during goal expansion:

:- inline make_pair/3.
make_pair(A, B, (A,B)).
test(X) :- make_pair(1,2,X).

?- test(X).
X =  (1, 2).

?- listing(test/1).
test(A) :-
    A=(1, 2),

Open Source:

Simple Debug Aware Inline Utility
Module Aware, But Without System Help
With Head Cleaning


The license is rather restrictive, is this what you intend or it was just a copy and paste?

The license is ok for a motivational prototype.

1 Like

I have a further question concerning indexing for body code, and the new flag. If I don’t do anything the indexing for body code is enabled, right? Documentation says the default is “true”.

But indexing for body code has also the following proviso, from the documentation as well:

Additional notes:

  • The unifications must immediately follow the head in a conjunction .

But this example has no “conjunction”, nevertheless it gets optimized, SWI-Prolog 8.3.25:

And the default behaviour:

?- [user].
make_unify(A,B,C) :- C=(A,B).

?- listing(make_unify/3).
make_unify(A, B, C) :-
    C=(A, B).

Does this rather mean that the a) “additional notes” have changed or I am reading them wrongly? And that the flag flip currently also means that b) by default the optimization is switched off?