Ann: SWI-Prolog 8.3.26

Dear SWI-Prolog user,

SWI-Prolog 8.3.26 is ready for download. Highlights

  • Better integration of transactions: proper coordination of the
    notion of the last modified generation of predicates, interaction
    with thread_wait/2 and interaction with incremental and monotonic

  • Next steps of code refactoring by @dmchurch: split the monolitic
    C header file into smaller header files that match the C modules
    and change the default symbol visibility for libswipl to hide all
    symbols that are not defined in SWI-Prolog.h or SWI-Stream.h.

  • Several small fixes, mostly addressing portability issues. In part
    as a result of the above refactoring and in part due to the first
    steps towards CI at SWI-Prolog Continuous integration status

    Enjoy — Jan

P.s. Also submitted a PR for the official Docker image.

SWI-Prolog Changelog since version 8.3.25

  • FIXED: Accidentally left debug test that could lead to an “Too many
    stacked strings” fatal error.

  • FIXED: Monotonic table that depends on a monotonic table that has
    forced reevaluation due to a retract and a normal monotonic table.

  • ADDED: PL_get_uint64() and PL_get_uint64_ex() API functions for

  • ENHANCED: nb_setarg/3 to only copy for a compound term

  • ADDED: samkeysort/2 to SICStus 4 library(samsort) emulation.

  • DOC: Tabling and transactions

  • FIXED: Invalidate lazy monotonic tables when reevaluation inside a
    transaction introduces new dependencies on predicates modified inside
    the transaction.

  • TEST: transactions and lazy monotonic tabling

  • TEST: transaction and monotonic tabling

  • ADDED: Consistency of eager monotonic tables over transactions.

  • TEST: transactions and incremental tabling

  • ADDED: Keep track of incremental tables that needs reevaluating when
    we rollback a transaction.

  • MODIFIED: Interaction between thread_wait/2 and transactions: database
    changes do not wakeup threads that are in a transaction because the
    change is invisible anyway and thread_wait/2 cannot be called inside
    a transaction as nothing can cause a wakeup.

  • ENHANCED: Avoid unnecessary wakeup in thread_wait/2 from modifications
    inside a transaction. Do notify on the transaction commit.

  • CLEANUP: Make role of special transaction generations clear by using
    a macro for them.

  • FIXED: last_modified_generation logic for predicates that are modified
    inside a transaction.

  • BUILD: Single threaded version still requires pthread library on
    Windows as this is a dependency for the gcc runtime library.

  • MODIFIED: Do not define rational/1 if rational number support is
    not enabled.

  • FIXED: library(sandbox) to handle the possibility that rational/1 is
    not defined.

  • TEST: Avoid rational number syntax errors when GMP is not used.

  • ADDED: eol//0 to library(dcg/basics).

  • FIXED: Build for single threading

  • FIXED: missing GMP exports, -Wmissing-prototypes This addresses issues
    exposed by adding -Wmissing-prototypes to the build, hacked in as
    cmake -DCHECK_PROTOTYPES=1. This flag emits a warning when any
    non-static function is defined without first declaring a separate
    prototype, which usually means that either a header hasn’t been
    included, or that a function that should have been static wasn’t
    marked as such. The Linux compile is clean now, after having:

    • added static to functions not called outside the file
    • completed incomplete header prototypes, usually by adding (void)
    • removed old functions no longer called anywhere
    • included gmp.h before SWI-Prolog.h, to enable the missing GMP exports

    The Windows build still has some missing-prototype warnings because of
    various #ifdefs, but I’m not addressing those right now.

  • MODIFIED: Moved includes to files that use them This also moves some
    inline definitions out of pl-inline.h, specifically those that call
    functions defined in other headers.

  • FIXED: Changing _xos defs to function-like macros Fixes a compilation
    error in atom.c:1151, where a->type->write is transformed into

  • MODIFIED: Refactoring to per-module header files

  • BUILD: Changing default visibility to hidden. This makes portable
    shared library builds work like Windows DLL builds, i.e. all symbols
    are library-private rather than exported by default. This fixes a
    fair amount of symbol leakage that had been happening when functions
    and variables weren’t marked COMMON().

  • BUILD: Fix possibly failing PGO build due to lacking dependency

  • FIXED: optimise_unify Prolog flag was handled negated. Jan Burse.

  • BUILD: Moved pl-alloc/index/fli out of pl-wam This adds USE_*_INLINES
    as a flag that can be set before including pl-incl.h, to include some
    of the function definitions from various files in a “can-inline”
    context. It also separates the majority of pl-alloc.c, pl-index.c,
    and pl-fli.c out into their own object files, to speed up the build.

    This may result in a slight (1-2% at max, in my testing) performance
    loss since the pl-wam compilation doesn’t have access to all the
    function definitions in those three files, but enabling LTO on the
    build (which I have not yet, since it currently generates warnings)
    avoids the performance drop entirely by allowing the linker itself
    to perform any applicable cross-file inlining.

  • PORT: Avoid UTF-8 characters in source code.

  • PORT: Avoid relying on GCC -Werror=missing-profile flag that is
    not supported on older systems.

Package bench

  • FIXED: Avoid error when using without threads

  • ADDED: Provide CSV output using swipl --csv

Package clib

  • BUILD: Drop building and including libfary(time) in the single
    threaded version.

  • PORT: uuid handling on CentOS 7

  • PORT:Deal with CentOS7 broken uuid-config

Package http

  • PORT: Start splitting parts that need threads and those that do not.

Package jpl

  • TEST: Fix tests for bounded integers.

Package odbc

  • PORT: Drop odbc_cancel_thread/1 when compiling without thread support.

Package pldoc

  • ADDED: Include documented public/1 predicates in the default page.

Package protobufs

  • PORT: Avoid UTF-8 in comment to allow building using non-UTF-8 locales.

Package redis

  • TEST: Make tests work without rationl number support

Package semweb

  • FIXED: Wrong argument type for PL_*_external() The SWI-Prolog.h
    external record functions use char * for the type of the
    external record data, but rdf_db is storing it and passing it as a
    record_t. Which went unnoticed when record_t was just a typedef
    for void *, but now causes (non-fatal) warnings during compilation,
    with the new opaque-struct-typed API header.

Package ssl

  • PORT: Single threaded build.

Package xpce

  • FIXED: Make PceEmacs Prolog mode work if rational number support is
    not enabled.

  • FIXED: Dependencies when using with single threaded version.