# Ann: SWI-Prolog 8.1.13

**URL:** <https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-13/1146>\
**Category:** Releases\
**Created:** [September 2, 2019, 7:30pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-13/1146 "2019-09-02T19:30:09Z")\
**Posts on this page:** 4\
**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:** [September 2, 2019, 7:30pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-13/1146/1 "2019-09-02T19:30:09Z")

</div>

Dear SWI-Prolog user,

SWI-Prolog 8.1.13 is ready for download. Most of the work is again on  
tabling (and is likely to be so for some time). Highlights:

- Semweb fixes by Leonid Mokrushin. Thanks!

- #! script argument processing fixed. Reported by Chris Mungall.

- Tabling

# SWI-Prolog Changelog since version 8.1.12

- ADDED: Code of Conduct page

- ADDED: Prolog flags `table_shared` and `table_incremental` to set  
defaults for tabling options.

- FIXED: library(prolog\_xref): avoid looping on a module declaration  
with a variable export list.

- FIXED: Use an atomic decision between re-evaluation and using the  
valid compiled clause.

- TEST: Test shared IDG falsecount propagation.

- ENHANCED: Allow waiting for a table from another thread to be aborted  
by a thread signal (including call\_with\_time\_limit/2).

- FIXED: if a _no change_ is propagated to a shared table, release it.

- CLEANUP: library(prolog\_colour) dealing with highlighting declarations.

- DOC: read/1: fixed and explain its role more clearly as this is a  
likely entry point for new users to read from a file or the user.

- ADDED: Deal with as(_,_) for declarations in cross referencer and  
highlighting

- ADDED: Support the XSB syntax `:- dynamic p/1 as incremental.`. The  
incompatibility makes writing code that runs on both too complicated.

- CLEANUP: better structure for setting predicate properties.

- ADDED: predicate\_property/2: `tabled` option without flags to enumerate  
all tabled predicates without duplicates.

- FIXED: Resolved abolishing tables with incremental tabling. This  
removes the notion of a nested tabling environment for re-evaluation.q

- FIXED: Issue#499: free\_component() (freeing a table component) to  
avoid C-recursion and thus a possible crash if the component stack  
is deeply nested.

- DOC: with\_output\_to/2 encoding issues.

- MODIFIED: Do not allow switching encoding to an Sopenmem() stream.

- ADDED: predicate\_property/2: provide access to table options  
through the tabled(Flag) property. Currently supports `shared` and  
`incremental` in addition to the mode (`variant` or `subsumptive`).

- FIXED: An SCC can contain a mixture of re-evaluated and normal  
answer tries. Remove the check for such hybrid SCCs and document  
why they can occur.

- FIXED: initialization of local and shared table space limit

- FIXED: Do not discard merged tables.

- TEST: Disabled shared tests if threads are disabled.

- TEST: verify deadlock handling while re-evaluating a shared table.

- FIXED: node/value count properties on tries if the trie is reset  
rather than destroyed.

- FIXED: ‘$tbl\_table\_status’/4 if return skeleton is instantiated.

- ENHANCED: Allow prolog\_colour:goal\_colours/2 to overrule builtin  
definitions.

- ADDED: prolog\_colourise\_stream/4, providing an operators(+Ops) option.

- ADDED: is\_most\_general\_term/1. Compatibility with XSB

- FIXED: Highlighting for qualified table declarations.

- ADDED: trie\_property/2, `compiled_size(Bytes)`.

- FIXED: wrap\_predicate/4 for foreign predicate could cause data  
corruption if GC is triggered while executing the wrapper clause.  
This prevented table/1 for foreign predicates.

- FIXED: Issue#498: crash in term\_singletons/2 if second argument  
is instantiated.

- FIXED: Delayed events on clauses could crash because the clause could  
be subject to clause garbage collection.

- FIXED: Remove tabling if directive is removed from the source file.

- ADDED: Partial support to include table directives in  
listing/0,1,2. Renamed wrapper to reuse normal hiding conventions  
for code.

- ADDED: detect removal of table/1 directives during reconsult and call  
untable/1 to remove the tabling for these predicates. Not yet working.

- MODIFIED: Do not use reconsult delay for predicate attributes set for  
predicates that are defined in another module. This fixes a problem  
where a file that contains a cross-module directive wipes the clauses  
of the referenced predicate on a reconsult. Not really sure about  
this. Possibly we need to keep track of locations of declarations  
such that we can manage changes to declarations more robustly.

- FIXED: update for multiple incremental tables depending on the same  
dynamic predicate.

- FIXED: re-evaluation of mutually dependent incremental dynamic goals.

- FIXED: trie\_gen/2,3 if a variable in the trie is matched against a  
compound term may miss answers.

- FIXED: A #! script should pass all arguments to the application.  
Chris Mungall.

## Package semweb

- FIXED: incorrect temporary stream encoding in rdf\_save/2

- FIXED: to accept strings in save\_attribute\_value/3 to allow proper  
xsd:dateTime serialization

## Package xpce

- XSB: initial XSB colour mode.

- ADDED: Deal with dedicated operators on Prolog sub-modes

- ADDED: `xsb` mode for editing files in XSB syntax, triggered by the  
.P extension.

---

<div class="post-metadata">

**Author:** ![EricGT](https://avatars.discourse-cdn.com/v4/letter/e/f1d935/32.png) [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Post date:** [September 2, 2019, 7:59pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-13/1146/2 "2019-09-02T19:59:57Z")

</div>

> [@jan](#):
>
> DOC: read/1: fixed and explain its role more clearly as this is a  
> likely entry point for new users to read from a file or the user.

That was needed. I see a few of those type questions at StackOverflow each time a new semester starts at the university level.

---

<div class="post-metadata">

**Author:** ![swi](https://avatars.discourse-cdn.com/v4/letter/s/51bf81/32.png) [@swi](https://swi-prolog.discourse.group/u/swi)\
**Post date:** [September 2, 2019, 9:14pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-13/1146/3 "2019-09-02T21:14:37Z")

</div>

> [@jan](#):
>
> Fix wrapping predicates for foreign predicates. Allows tabling  
> foreign precicates!

This is a great advantage, to be able to table foreign predicates!!  
Does XSB have this? Maybe SWI-Prolog is starting to surpass (in some areas) XSB with regards to the feature set 🙂

---

<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:** [September 3, 2019, 6:55am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-8-1-13/1146/4 "2019-09-03T06:55:13Z")

</div>

XSB says:

```prolog
| ?- table atom_concat/3.
++Error[XSB/Runtime/P]: [Permission (Operation) table on static_code: atom_concat/3] in table/1

```

More importantly, you get the same if you load a file defining some predicate and then try to get it tabled. Fundamentally this is of course not so interesting: put the table directive with the predicate in the file and wrap the foreign predicate.

From a usability point of view we were happy to be able to play around by switching tabling on and off to see what is happening in a program with a lot of data loaded (and thus long startup time). This lead to the tentative conclusion that what needs to be tabled for optimal performance and minimal memory usage is not very trivial. The tools that should tell us are the profiler and to be written support tools to explain what is tabled. Some are in my personal Prolog library. In due time these should be moved to the system.

The new stuff wrt XSB will notably be in concurrent tabling 🙂
