# Ann: SWI-Prolog 8.1.2

**URL:** <https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-2/349>\
**Category:** Releases\
**Created:** [March 4, 2019, 8:42pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-2/349 "2019-03-04T20:42:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [March 4, 2019, 8:42pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-2/349/1 "2019-03-04T20:42:25Z")

</div>

Dear SWI-Prolog user,

I’m happy to announce SWI-Prolog 8.1.2. There has been a lot of  
progress, notably as a result of a Kyndi initiated project to bring XSB  
and SWI-Prolog closer together. With input from Teri Swift, David Warren  
and Fabrizio Riguzzi we try to support XSB source files by implementing  
an XSB _dialect_ module and get SWI-Prolog’s tabling more mature.

These efforts have already resulted in managing tabling using  
dynamically assembled components instead of a single component,  
substitution factoring (reducing table space requirements) and early  
completion for ground tabled goals. As a result, tabling deals better  
with cuts, negation, findall, and similar constructs. As a bogus, tabled  
execution is over twice as fast on the benchmarks established by Benoit  
Desouter and uses considerably less memory on many benchmarks.

This version fixes the installation of start menu and desktop shortcuts  
for the Windows installer.

This version comes with several other enhancements and bug fixes, many  
of them were contributed.

```
Enjoy --- Jan

```

# SWI-Prolog Changelog since version 8.1.1

- ENHANCED: Windows: Updated swipl.ico for higher resolutions, so we  
no longer have to simplify it.

- INSTALL: Windows: properly install shortcuts.

- FIXED: trie\_gen/3: memory leak

- ENHANCED: Use a buffer rather than a linked list for trie enumeration  
choice points. Reduces memory and provides a small speedup.

- ENHANCED: Avoid GET\_LD for internal \_PL\_unify\_atomic()

- ADDED: Implement early completion for tabling SCCs if the associated  
goal is ground.

- ENHANCED: Tabling to determine the variable skeleton for a tabled  
subgoal. This reduces the sizes of tables and improves the performance  
for extracting many answers.

- FIXED: Tabling to use call\_setup\_catcher\_cleanup/4 rather than  
catch/3 to cleanup tables after an exception. Provides marginally  
better performance, makes cleanup work with abort and preserve SWIs  
notion of uncaught exceptions, improving debugging.

- ENHANCED: Tabling: realise dynamic creation of minimal SCCs. This  
generally improves performance, reduces memory usage and allows  
many more Prolog constructs to be compatible with tabling.  
After discussions with Teri Swift, David Warren and Fabrizio Riguzzi.

- WIP: First steps dealing with dynamic local SCCs. Compiles and runs.

- SECURITY: possible buffer overrun when dealing with very large strings

- BUILD: Update CMAKE.md and enhanced cmake/CheckEnv.cmake, checking  
the environment for things that may break the build.

- FIXED: convert ‘annotated’ stack\_limit command line option to an  
integer when qcompiling a toplevel

- ENHANCED: allow plain integer values to be passed to --stack\_limit  
command line option

- ENHANCED: Avoid trapping debug hooks for setup\_call\_cleanup/3 and  
friends. This avoids about doubling the overhead when the development  
environment is used (PceEmacs and/or SWISH).

- ADDED: Sandbox declarations for nb\_linkval/2 and  
nth\_integer\_root\_and\_remainder/4

- PORT: Emscripten: by default use the `native friend`.

- CLEANUP: we no longer need a _native friend_ with the same address  
bits.

- PORT: Remove `-s BINARYEN_METHOD='native-wasm'`  
as this is no longer supported. See  
[https://www.google.com/url?q=https%3A%2F%2Fkripken.github.io%2Femscripten-site%2Fdocs%2Fcompiling%2FWebAssembly.html%23debugging&sa=D&sntz=1&usg=AFQjCNHxLe2QvzskaC58CouZdjzaqCW9Dw](https://www.google.com/url?q=https%3A%2F%2Fkripken.github.io%2Femscripten-site%2Fdocs%2Fcompiling%2FWebAssembly.html%23debugging&sa=D&sntz=1&usg=AFQjCNHxLe2QvzskaC58CouZdjzaqCW9Dw)

- PORT: Make sure to include CMAKE\_CROSSCOMPILING\_EMULATOR when setting  
the PROG\_SWIPL

- PORT: Make alignment detection work for Emscripten.

- DEBUG: Adding conditional debug statements to boot/tabling.pl

- DEBUG: Added Prolog flag `prolog_debug` if the system is compiled in  
**Debug** configuration.

- TEST: Move tabling tests into their own subdir so we can run only  
those using `ctest -R tabling`.

- FIXED: library(prolog\_colour): Avoid an exception on :- meta\_predicate  
p().

- FIXED: pack\_remove/1 if the pack exists but was not attached due to  
a lacking foreign library. If the pack is really missing it now just  
prints a message instead of raising an exception. Paulo Moura.

- XSB: More emulation

- XSB: Get directives to the head. Order doesn’t matter for XSB,  
which uses a two phase compiler, but it does for SWI.

- PORT: Avoid dependency on C99 for alignment check.

- FIXED: return exit code if swipl -c fails

- FIXED: PL\_thread\_attach\_engine(NULL) crashed. Stisko.

- XSB: Work in progress.

- XSB: Added various predicates to the emulation libraries.

- FIXED: Declare dynamic/1, multifile/1 and discontiguous/1 as `iso`.  
This avoids accidental redefinition.

- MODIFIED: display/1,2 now write lists using the internal SWI-Prolog  
`'[|]'` functor. Adds an option `no_lists(bool)` to write\_term/3.

- XSB: Ignore :- ti/1, allow for cyclic module dependencies and start  
emulating the `string` library.

- BUILD: Allow scripts/pgo-compile.sh to run from any build dir, also  
if this is not an immediate subdir of the source. Paulo Moura.

- PORT: Allow building in [Haiku](https://www.haiku-os.org/)

## Package http

- ADDED: library(http/thread\_httpd): load `http_ssl_plugin` if the option  
list indicates we want SSL. After remark by Fernando Sáenz-Pérez.

- DOC: Use new `[[library(http/json)]]` notation to get proper  
paths for the source files included by `json.md`. Also updated the  
documentation intro for JSON a bit.

## Package jpl

- FIXED: Install `env.sh` into the Java examples and update it to deal  
with both the installed version and version from the build environment.

## Package pengines

- FIXED: in pengines:output\_result for CORS and write\_result hook
  1. Currently CORS support is only implemented for the `json`  
format. It really should be applied to all output when the `http:cors`  
setting is enabled (including any error responses generated by  
the http server libraries). The same philosophy should apply to  
`disable_client_cache/0`.

  2. The `write_result/3` hook is not called when the format type is  
`prolog` due to clause ordering of `output_result/3`. The clause that  
calls the hook should be first (analogous to the `event_to_json` hook in  
`event_term_to_json_data/3`). A benefit is that attributed variables  
can by returned in response data via the hook.

## Package pldoc

- ADDED: Allow for [[Alias(Segments)]] to reference to files in markdown.

- FIXED: Documentation search should find perfect matches on  
identifiers. Nicos Angelopoulos.

- FIXED: Avoid duplicating documentation for PlDoc comment blocks that  
document multiple predicates.

## Package swipl-win

- DEBUG: Add debug messages to find the preferences path and track the  
font dialog.

---

<div class="post-metadata">

**Author:** ![ielbert](https://avatars.discourse-cdn.com/v4/letter/i/e79b87/32.png) [@ielbert](https://swi-prolog.discourse.group/u/ielbert)\
**Post date:** [March 5, 2019, 1:51am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-2/349/2 "2019-03-05T01:51:53Z")

</div>

How to upgrade to 8.1.2 (on Mac)?

> ```
> brew tap likelion/tap
> brew upgrade swipl
> Error: likelion/tap/swipl 8.1.1 already installed
> 
> ```

Thank you

---

<div class="post-metadata">

**Author:** ![likelion](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/likelion/32/57_2.png) [@likelion](https://swi-prolog.discourse.group/u/likelion)\
**Post date:** [March 5, 2019, 12:08pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-2/349/3 "2019-03-05T12:08:54Z")

</div>

You cannot upgrade a HEAD installation (see [https://github.com/Homebrew/legacy-homebrew/issues/13197](https://github.com/Homebrew/legacy-homebrew/issues/13197)).

But normally just `brew upgrade` works for me or you can do a clean install:

```auto
brew uninstall swipl
brew update
brew install swipl --devel

```
