Ann: SWI-Prolog 8.3.25

Dear SWI-Prolog user,

Release 8.3.25 is ready for download. Highlights:

  • Ongoing cleanup and debugging of the core system by @dmchurch.
    Notably PGO compilation integrated into CMake, better core
    debug output and selecting debug topics using wildcards.

  • Several constraint and SICStus emulation enhancements by
    @dgelessus. Notably fixes frozen/2,

  • Fixed to delimited continuation (module awareness and choice
    point handling). Affects (notably) monotonic tabling.

  • format/3 argument handling fix by @Boris

    Enjoy — Jan

SWI-Prolog Changelog since version 8.3.24

  • FIXED: Silent failure in CLP(FD) domain calculation for truncated
    division.

  • ADDED: Prolog flag shift_check to check for suspicious continuations.

  • FIXED: flipped shift/1 and shift_for_copy/1 behaviour.

  • FIXED: Capturing the continuation inside a meta-predicate restores
    the wrong module context.

  • FIXED: frozen/2 leaves residual variables on backtracking.

  • DOC: frozen/2, copy_term/3 and attribute_goals//2 interaction.

  • FIXED: frozen/2 to allow attribute_goals//1 to modify the attributes.

  • FIXED: negative numerical argument for format from argument list

  • PGO: Updated docs and utility scripts to use the new CMake PGO
    build type.

  • BUILD: Added self-contained PGO process to CMake. This change makes
    it possible to run a PGO build with a single invocation of the build
    process. To do so, use the “PGO” configuration in CMake rather than
    “Debug” or “Release”, which will:

    1. Compile all libswipl objects with profile generation enabled. This
      uses auxiliary target names with “-pgo-instrumented” appended.
    2. Link the executable “swipl-pgo-instrumented” in src, using these.
    3. Use swipl-pgo-instrumented to create boot.prc (since no other swipl
      exists yet). Clear the PGO-data directory, then run the benchmark.
    4. Build the libswipl objects again, using the PGO data generated.
    5. Link the final swipl executable from these.

    The dependencies are set up such that if any source file changes,
    ninja will recompile the instrumented version of the affected file(s)
    and then restart the process from step 3, recompiling ALL libswipl
    objects using the new PGO data.

    Tested with gcc 9/10 and clang 10/11.

  • DEBUG: Debug wildcard and complement; DEBUG_IF The -d command line
    option now takes an optional asterisk (*) on the end of a debug
    flag name to enable all flags that begin with that name. Also,
    flag names can be prefixed with a caret (^) to disable that flag;
    only particularly useful in combination with the wildcard, to silence
    chatty channels. For example,

    swipl -d MSG_SHIFT*,^MSG_SHIFT_FRAME
    

    will enable all MSG_SHIFT channels except for MSG_SHIFT_FRAME.

    On the internal side, we now have the DEBUG_IF(cond, channel) macro,
    which functions much like DEBUG(channel, statements) except it provides
    more control over the conditions, and it avoids statements in a macro.
    As a result, the statement

    DEBUG(MSG_CHANNEL, Sdprintf(...));
    

    is (for a named channel, at least) equivalent to

    int debug_active = DEBUGGING(MSG_CHANNEL);
    DEBUG_IF(debug_active, MSG_CHANNEL)
    { Sdprintf(...); }
    

    which itself is roughly equivalent to:

    #if O_DEBUG
    int debug_active = DEBUGGING(MSG_CHANNEL);
    if (debug_active)
    { ENTER_DEBUG(MSG_CHANNEL); Sdprintf(...); EXIT_DEBUG(MSG_CHANNEL);
    }
    #endif
    

    This commit also includes some improvements to the GC debug messaging.

  • CLEANUP: Issue#835: Avoid singleton variable in branch when compiling
    with optimization.

  • TEST: Added when/2 test suite.

  • FIXED: Issue#818: when/2 conditions with nested disjunctions not
    being displayed properly by toplevel and copy_term/3.

  • ADDED: copy_term/2 to SICStus 4 emulation (same as SWI
    copy_term_nat/2).

  • ADDED: library(types) to SICStus 4 emulation.

  • ADDED: max_member/3 and min_member/3 (with an order predicate argument)
    to library(lists).

  • REFACTOR: This patch completes the first round of refactoring the VM.
    It allows for the same source to create a VM as threaded code
    jumping to label addresses in a giant function as well as a VM
    that has an array of function pointers, one function for each
    VM instruction. This is work by @dmchurch.

  • CMAKE: Added -DVMI_FUNCTIONS=ON

  • ADDED: Allow foreach//2 from library(dcg/high_order) to work with
    non-lists.

  • FIXED: listing/1 and friends for compound terms using [] as functor.

  • FIXED: Make PGO build work again

  • ADDED: Define undo/1 as sandbox-safe

Package debian

  • PORT: use PGO for the Ubuntu PPA build.

Package pengines

  • ADDED: tab/1 to Pengine I/O emulation, emitting &nbsp
3 Likes