Dear SWI-Prolog user,
SWI-Prolog 9.1.0 is ready for download. This version starts a new
development cycle and is practically identical to 9.0.0. Highlights:
-
Many new features and fixes to the new Emacs sweeprolog mode by
@oskardrums -
Almost final version of the new C++ interface SWI-cpp2,h by
@peter.ludemann. There are still a few discussions going on
about part of the API. Anyone working in C++ is kindly
requested to review the current state. -
Pretty stable GMP replacement using LibBF is included. Should
work fine for most applications, but can be slow, notably for
handling larger rational numbers (> 64 bits). -
Lots of small stuff, notably about configuration, etc.
Enjoy â Jan
SWI-Prolog Changelog since version 8.5.20
-
SNAP: CMAKE_INSTALL_LIBDIR seems undefined inside snapcraft, causing
the build to fail. -
SNAP: Latest snapcraft sets LD_LIBRARY_PATH to provide access to the
âpartsâ. We should not consider this a broken environment. -
DOC: Fixed LaTeX issues blocking the generation of the PDF manual.
-
TEST: Avoid name conflict between two tests to make test_installation/0
work again. -
ENHANCED: library(main) to delay looking for tspy/1 or gspy/1 until
the option is activated. -
FIXED: Make X11 event dispatching work in single threaded version.
-
TEST: Avoid testing stuff that requires threads in the single threaded
version. -
CLEANUP: Do not compile code required for multi-threaded loading in
the single threaded version. -
DOC: format/1-3: document behavior of
~0f
. -
CONFIG: Do not install thread libraries for single threaded version.
-
MODIFIED: When ISO mode is enabled, unknown options are result in a
domain error. This now also holds if the option argument is a dict. -
MODIFIED: Ssprintf() and Ssnprintf() functions now use UTF-8 encoding
(used to be ISO Latin 1), so they can handle Unicode. -
ENHANCED: Use xref_source/2 for fetching PlDoc comments from loaded
sources. Patch by @swi. -
PORT: Provide backtrace with line numbers on MacOS using
atos
as replacement foraddr2line
. -
ADDED: prolog_interrupt/0 to make a thread behave as if SIGINT is
received using thread_signal/2. -
FIXED: Do not reload system files to get their documentation.
-
PORT: More integer passing problems over vararg functions.
-
FIXED: Prolog flag
pid
on some 64 bit platforms. -
PORT: Use CMake to test for <threads.h> support.
-
MAINTENANCE: Provide a Prolog flag
asan
when the system is compiled
with AddressSanitizer. -
INSTALL: When using
-DSWIPL_INSTALL_IN_LIB
, make sure that the
CMake export files can be relocated. -
WASM: Avoid undefined HTMLCollection.toList(). Emacs whitespace update
-
MODIFIED: pack_install/1 and friends to pass all environment variables
to the tools that may be executed to build the pack. -
PORT: Issue#1070: pack_install/1: Pass
PKG_CONFIG_PATH
to build
tools -
FIXED: format/2,3: manage proper arithmetic environment for
expressions. -
PORT: Make LibBF code compile for Clang
-
FIXED: fetch/restore of Mersenne Twister random state. Also reduced
the size of the state. -
MODIFIED: **/2 and ^/2: If the power can be done using rational
arithmetic but the numbers are too big, make the behaviour depend on
max_rational_size_action
. Whenfloat
, try to continue after float
conversion, else raise a resource error. -
FIXED: **/2 and ^/2 overflow checking when computing the power of
two rational numbers. -
ENHANCED: Prefer mpz_sgn() over mpz_cmp_ui() to 0.
-
ENHANCED: Key generation for bignum and rational clause indexing
-
ADDED: BF_FTOA_PL_QUIRKS for correct float formatting.
-
MODIFIED: CMake
target_link_swipl()
now removes thelib
prefix. -
PORT: Updated MacOS dependencies
-
FIXED: swipl.cmake outside pack_rebuild/2 context gets linking against
libswipl wrong. -
FIXED: Issue#163: -s and -l files were loaded before the argv Prolog
flag is cleaned. -
ADDED: prolog_walk_code/1: option walk_meta_predicates(+Boolean) to
prevent the code walker from considering meta-predicates. There are
few cases where this is interesting, but it was needed for constructing
a s(CASP) dependency graph. -
DOC: Document (part of) the PL_cvt_i_() functions and improve
documentation for several of the PL_get_() and PL_get_*_ex()
functions. -
ADDED: PL_get_bool() now also accepts the integers (0,1)
-
PORT: set RPATH correctly on MacOS for native libs in packages
-
ADDED: PL_cvt_i_llong() PL_cvt_i_ulong() and PL_cvt_i_bool().
This completes the types supported by these functions. -
ADDED: listing/1,2 to also accept a clause reference as entity to list.
Package clib
- TEST: Disable tests that require threads on the single threaded
version.
Package cpp
-
TEST: Fixed C interface PL_scan_options() tests.
-
TEST: Renamed foreign function test module to
test_ffi
. This avoids
a conflict (and confusion) with the ffi pack to run the tests
interactively. -
TEST: Added PL_scan_options example
Package http
- CONFIG: Reorganise installation and docs to distinguish core part we
always want, the HTTP client and HTTP server libraries.
Package odbc
- PORT: Allow compiling in single threaded mode.
Package pldoc
-
CONFIG: Make most of PlDoc work in the single threaded version.
-
CONFIG: Make PlDoc work if the HTTP server components are not part
of the configuration. -
ENHANCED: Source button to prefer loaded code over xref data.
Package semweb
- FIXED: rdfa.pl: Avoid dependency oin development tools
Package ssl
- TEST: Drop tests when single threaded.
Package sweep
-
ADDED: PlUnit tests block skeleton and command for inserting it *
sweeprolog.el (sweeprolog-format-string-as-atom): new function.
(sweeprolog-module-header-skeleton): use define-skeleton, making it a
command instead of a defconst. (sweeprolog-plunit-testset-skeleton):
new skeleton and command. * sweeprolog-tests: test it. * README.org
(âWriting Testsâ): new section. (âUsing templates for creating new
modulesâ): rename to âCreating New Modulesâ. -
FIXED: instantiation error in color term normalization
-
FIXED: sweeprolog-beginning-of-next-top-term: other possible loop *
sweeprolog.el (sweeprolog-beginning-of-next-top-term): donât loop
when called in the last term of the buffer * sweeprolog-tests.el
(beginning-of-next-top-term-at-last-clause): new test case -
FIXED: possible infinite loop looking for next term * sweeprolog.el
(sweeprolog-beginning-of-next-top-term): handle comments more reliably -
FIXED: exporting predicates in presence of exported
operators * sweep.pl (sweep_exportable_predicates/2): new
predicate. * sweeprolog.el (sweeprologâmodule-term)
(sweeprologâexportable-predicates)
(sweeprolog-analyze-start-exportable)
(sweeprolog-analyze-fragment-exportable): no longer
used, deleted. (sweeprolog-exportable-predicates): new
function. (sweeprolog-read-exportable-predicate): use it.
(sweeprolog-export-predicate): handle exported operators. -
ENHANCED: allow sweeprolog-forward-hole to wrap around * sweeprolog.el
(sweeprologânext-hole, sweeprologâprevious-hole): new functions.
(sweeprologâforward-hole, sweeprologâbackward-hole): add WRAP arg. -
ENHANCED: conditional syntax error highlighting
-
DOC: mention sweeprolog-swipl-path in the manual
-
ADDED: minor mode for automatic whitespace insertion * sweep.pl
(sweep_context_callable/2): only consider the context to be
callable if a neck is present up the tree, i.e. not in the head.- sweeprolog.el (sweeprolog-context-callable-p): new function,
extracted from (sweeprolog-predicate-completion-at-point)
(sweeprolog-electric-layout-post-self-insert-function): new function.
(sweeprolog-electric-layout-mode): new minor mode.
- sweeprolog.el (sweeprolog-context-callable-p): new function,
-
ENHANCED: revise predicate completion at point Completion at point now
detects whether predicate completion is appropriate, by parsing Prolog
code back from point to determine the context of point. If predicate
completion is not appropriate, fallback to atom completion. -
ADDED: user option specifying where to define new predicates
- sweeprolog.el (sweeprolog-default-new-predicate-location)
(sweeprolog-new-predicate-location-above-current): new functions.
(sweeprolog-new-predicate-location-function): new user option.
(sweeprolog-maybe-define-predicate): use it.
- sweeprolog.el (sweeprolog-default-new-predicate-location)
-
FIXED: possible error in sweeprolog-describe-predicate
-
DOC: document sweeprolog-xref-project-source-files in the manual
-
ADDED: new command sweeprolog-xref-project-source-files
-
FIXED: find user predicate definitions more reliably
-
TEST: add test for updating syntax error faces
-
FIXED: clear syntax error face after fix more aggressively
-
FIXED: properly update query highlighting in the toplevel
-
FIXED: simplify & make variable highlighting more reliable
-
FIXED: only consider backslash as an escape inside strings
-
FIXED: restrict variable underlining to current clause
-
FIXED: variable name completion on Emacs 27 * sweeprolog.el
(sweeprolog-variable-completion-at-point): donât rely on
char-uppercase-p * sweeprolog-tests.el (complete-variable): new test. -
ADDED: sweeprolog-forward/backward/mark-predicate
-
REFACTOR: Simplify and deduplicate code all around * sweeprolog.el
(sweeprolog-colourise-): rename to sweeprolog-analyze- -
FIXED: correctly recognize âpublicâ head terms
-
TEST: add two test cases
-
FIXED: sweeprolog-identifier-at-point could return unbound module
-
FIXED: write_sweep_module_location/0 for Windows.
-
DOC: added section âCode Completionâ to the manual
-
ADDED: completion-at-point for variable names *
sweeprolog.el (sweeprolog-local-variables-collection,
sweeprolog-variable-completion-at-point):
new functions. (sweeprolog-mode): add to
completion-at-point-functions. (sweeprolog-mode-syntax-table): update
according to char_type(Char, prolog_symbol). -
ADDED: context-based command for inserting new clauses or terms *
sweeprolog.el (sweeprologâforward-hole, sweeprologâbackward-hole):
new functions. (sweeprolog-forward-hole): new command.
(sweeprolog-end-of-predicate-definition,sweeprolog-insert-clause,
sweeprolog-maybe-insert-next-clause,
sweeprolog-maybe-define-predicate): new functions.
(sweeprolog-insert-term-functions): new hook.
(sweeprolog-insert-term-dwim): new command. (sweeprolog-mode-map):
bind new commands. * sweeprolog-tests.el (dwim-define-predicate): new
test case. * README.org (Context-Based Term Insertion): new section. -
ENHANCED: render refs to Prolog library in help buffers * sweeprolog.el
(sweeprolog-render-html-a): recognize and render references to Prolog
library files. -
FIXED: handling of operators as predicate completion candidates
-
FIXED: donât include irrelevant candidates in apropos results *
sweep.pl (sweep_predicate_apropos/2): filter candidates by minimum
match quality. -
ENHANCED: add predicate properties list in help buffers * sweep.pl
(sweep_predicate_properties/2): new predicate. * sweeprolog.el
(sweeprologârender-predicate-properties): new function.
(sweeprologâdescribe-predicate): use it. -
ENHANCED: load and initialize sweep-module just-in-time Instead
of loading sweep-module and initializing Prolog as part of loading
sweeprolog.el (subject to the user option sweeprolog-init-on-load),
this commit introduces just-in-time loading and initialization
of Prolog. Suggested by Stefan Monnier.- sweeprolog.el: (sweeprologâopen-query): new function, wraps
sweeprolog-open-query and initializes Prolog on the first call. Used
in place of sweeprolog-open-query throughout.
(sweeprolog-init-on-load): make variable obsolete.
- sweeprolog.el: (sweeprologâopen-query): new function, wraps
-
ENHANCED: teach sweep to jump to C code for built-in predicates
- sweeprolog.el: - sweeprolog-swipl-sources: new user option.
- sweeprolog-native-predicate-location: new function. -
sweeprolog-predicate-location: use it. - README.org: Built-in Native
Predicates: new section.
Package swipl-win
-
FIXED: Check return codes of many operations on lists.
-
PORT: Changes for SWI-cpp.h API Version 2
Package windows
- PORT: add libname to install() routine
- PORT: add libname to install() routine From this discussion:
Static executable (-DSTATIC_EXTENSIONS) - #2 by jan
âthe install function of a library must be called install_
and the Prolog side must use use_foreign_library/1â
Package xpce
-
CONFIG: Avoid dependency on threads.
-
FIXED: replace internal expand_path/2 with absolute_file_name/3
old code could not handle aliases like swi(library/clp) only
swi(âlibrary/clpâ)
Package zlib
- TEST: Disable tests that requires threads