Ann: SWI-Prolog 9.1.3

Dear SWI-Prolog user,

SWI-Prolog 9.1.3 is ready for download. Highlights:

  • Fixes a couple of possible crashes.

  • The Redis interface can now deal with TLS connections and “Redis Sentinel”
    networks. This supports high-availability and secure connections.

  • Several portability issues.

  • Many documentation enhancements, notably by Peter Ludemann on exception
    handling in foreign code.

  • Many updates to the Emacs sweep-mode by Eshel Yaron. Warmly recommended!

    Enjoy — Jan

SWI-Prolog Changelog since version 9.1.2

  • FIXED: Issue#1095: cmpFloatNumbers() for NaN.

  • FIXED: Implement A_MPZ and A_MPQ instructions when using LibBF
    binding. This fixes using such numbers in expressions compiled with
    optimization enabled. Reported by Rick Workman.

  • FIXED: Issue#1091: optimised compilation of clauses containing big
    integers or rational numbers in expressions.

  • FIXED: Issue#1092: term_hash/2,4 crashes on Unicode strings.

  • DOC: Use PlDoc for trace/1,2 documentation.

  • ADDED: trace/1,2: print wall time since call port for other ports.

  • ADDED: list_debug_topics/1 to search, only print active topics,
    etc. This predicate now uses print_message/2. debugging/0 is hooked
    to show the active topics.

  • ADDED: debugging/0: allow extensions using

  • DOC: Fixed PL_Q_CATCH_EXCEPTION interaction with the debugger.

  • DOC: Reviewed and updated foreign language sections on exception
    handling. Thanks to Peter Ludemann for pointing the many parts of
    the docs that were unclear or outdated.

  • DOC: Added some details for PL_exception()

  • FIXED: Issue#1087: crash on inlined unification against a rational

  • DOC: rational/1 and rationalize/1 use current notation.

  • PORT: msys2, add %MINGW_PREFIX%/bin to dll path

  • PORT: msys2, do not copy system dlls into home

  • ADDED: Prolog flag msys2 to detect the MSYS2 installation.

Package archive

  • PORT: Simply use int64_t as older 3.x libarchive versions do not
    define la_int64_t. Simply using int64_t seems the easiest way out.

Package clib

  • FIXED: detach_IO/1: Protect I/O stream against garbage collection.

Package http

  • ADDED: library(http/http_error): dynamic predicate
    http_error:suppress_code/1 to make the library silent on specific
    reply codes.

  • ENHANCED: Avoid confusing “Unknown message” from library

  • FIXED: Avoid recursion when garbage collecting HTTP sessions under
    Redis session management.

  • ENHANCED: Do not try to send websocket broadcast messages after
    shutdown progressed too far.

  • ADDED: library(http_unix_daemon) to broadcast http(shutdown) before
    calling halt(0).

  • ENHANCED: http_absolute_uri/2 to use the setting http:public_scheme
    or the port to find the scheme (http or https)

  • ENHANCED: Redis http session plugin to use caching to speedup checking
    whether a session is alive.

  • FIXED: Issue#120: term//2 (term to HTML) rendering of infix terms if
    these contain “member” terms with arity 2.

Package redis

  • ENHANCED: Avoid hanging connection on invalid authentication.

  • ADDED: Split authentication for the redis instances from the sentinel

  • FIXED: Also connecting to the sentinels require authentication.

  • ADDED: Connect to a master through a sentinel network.

  • ADDED: Support Redis TLS connections.

Package sweep

  • DOC: explain how to follow source locations in top-level messages

  • MODIFIED: do not force set next-error buffer to Prolog buffer

  • ENHANCED: use terms at point as “future history” for term-search * (sweep_terms_at_point/2): new predicate. * sweeprolog.el
    (sweeprolog-terms-at-point): new function. (sweeprolog-read-term):
    use it for setting the future history. (sweeprolog-read-goal):
    new function. (sweeprolog-term-search): use it for reading a goal
    when called with prefix argument.

  • ENHANCED: Support refining term searches with arbitrary goals * (sweep_term_search/2): extend with an extra goal argument.

    • sweeprolog.el (sweeprolog-read-term): new function, similar to
      read–expression but for Prolog terms rather than Elisp expressions.
      (sweeprolog-term-search): use it, and prompt for goal with prefix arg.
  • ENHANCED: restore original point when a term search is quit

  • ADDED: command for finding terms subsumed by a given
    term * (sweep_term_search/2): new predicate. *
    sweeprolog.el (sweeprolog-term-search-in-buffer): new function.
    (sweeprolog-term-search): new command. * (“Term Search”):
    new manual section.

  • FIXED: find next predicate definition more reliably

    • (sweeprolog_beginning_of_last_predicate/2)
      (sweeprolog_beginning_of_last_predicate/2): explicitly sort results,
      don’t assume xref_defined/3 yields ordered results.
  • ADDED: user option to control predicate documentation composition *
    sweeprolog.el (sweeprolog-insert-pldoc-for-predicate): remove in
    favor of… (sweeprolog-insert-predicate-documentation): new function.
    (sweeprolog-format-term-with-holes): new utility function,
    used by… (sweeprolog-read-predicate-documentation-with-holes)
    new functions, used for…
    (sweeprolog-read-predicate-documentation-function): new user option,
    used by… (sweeprolog-read-predicate-documentation): new function,
    used by… (sweeprolog-document-predicate-at-point): refactor.

  • ADDED: New command sweeprolog-insert-term-with-holes * (sweep_format_term/2, sweep_current_functors/2): new
    predicates. * sweeprolog.el (sweeprolog-read-functor-history):
    new variable, history list for… (sweeprolog-read-functor):
    new function. (sweeprolog-forward-hole-repeat-mode): rename
    to… (sweeprolog-forward-hole-repeat-map): corrected name
    for keymap. (sweeprolog-analyze-end-font-lock): don’t rely
    on sweeprolog–next-hole to move point. (sweeprolog-at-hole-p,
    sweeprolog-beginning-of-hole) (sweeprolog-end-of-hole): new functions,
    used by… (sweeprolog–previous-hole, sweeprolog–next-hole):
    revise. (sweeprolog–precedence-at-point): new function,
    used by… (sweeprolog-insert-term-with-holes): new command.
    (sweeprolog-mode-map): bind it to C-c C-m * sweeprolog-tests: test
    it. * (“Filling Holes”): move to top and rename to…
    (“Holes”): document sweeprolog-insert-term-with-holes.

  • ENHANCED: use variable names from docs when inserting next clause

    • (sweep_format_head/2): new predicate. * sweeprolog.el
      (sweeprolog-insert-clause): use it.
  • ENHANCED: highlight holes in incomplete terms * sweeprolog.el
    (sweeprolog-predicate-completion-at-point): fontify holes when
    inserting them. (sweeprolog-analyze-start-font-lock):
    reset font-lock-face in analyzed region.
    (sweeprolog-analyze-fragment-to-faces): fix syntax
    error handling, don’t highlight holes as it is done by…
    (sweeprolog-analyze-end-font-lock): new function, highlights holes
    in analyzed region when sweeprolog-highlight-holes is non-nil.
    (sweeprolog-analyze-region-end-hook): add it. (sweeprolog–hole):
    fix text property used for setting stickiness.

  • FIXED: possible crash after calling sweeprolog-restart