# Version 8.1.1 available

**URL:** https://swi-prolog.discourse.group/t/version-8-1-1-available/23
**Category:** Releases
**Created:** [February 4, 2019, 3:37pm UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23 "2019-02-04T15:37:17Z")
**Posts on this page:** 11
**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: [February 4, 2019, 3:37pm UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/1 "2019-02-04T15:37:17Z")

</div>

Dear Prolog user,

I have uploaded SWI-Prolog 8.1.1. There is a lot to enjoy. Highlights:

- FIXED: the MacOS bundle: menu handling in SWI-Prolog.app and make  
xpce work again (hopefully). With help from `ridgeworks’ and  
Carlo Capelli. Both were regressions due to the migration to  
CMake.

- ENHANCED: delete lingering clause indexes older than the oldest  
active predicate access. Keri Harris implemented a big enhancement  
getting rid of old clause indexes for dynamic predicates that are  
repeatedly filled with many clauses, queried and emptied and almost  
continuously active.

- ENHANCED: avoid uneeded garbage collection when catching exceptions  
that are not related to stack overflows. Can be a bit performance  
improvement for applications using a lot of exceptions in their  
normal computation.

- XSB: Started investigating XSB/SWI-Prolog options for cooperation.  
This added (still very limited) support for  
:- expects\_dialect(xsb) and loading XSB .P files (in XSB emulation  
mode). Enabled by Kyndi.

- PORT: .QLF files and saved states are now word-length independent.  
This means they are machine (OS, CPU) independent, but still depend  
on the Prolog VM that can change between versions.

- ADDED: HTTP server: deal with rest locations as discussed here and  
pioneered by Raivo Laanemets.

And of course the usual set of small fixes and enhancements.

```
Enjoy --- Jan

```

# SWI-Prolog Changelog since version 8.1.0

- XSB: Started `intern` library emulation.

- PORT: Force compiling and linking against XQuartz on MacOS when  
creating a bundle.

- ENHANCED: delete lingering clause indexes older than the oldest active  
predicate access

- ENHANCED: Do not request a garbage collection after an exception  
unless we ran out of stack on a stack that is subject to GC.

- ENHANCED: No longer perform forced GC before calling the user exception  
hook. GC is allowed inside the hook, so there is no reason to do so.

- MODIFIED: No longer use print\_message/2 for `trace_gc`. If GC happens  
in some parts inside the VM we cannot handle calls to Prolog safely.

- FIXED: Only check that an async signal handler **created** an  
exception.

- XSB: Added dummy abolish\_table\_info/0.

- FIXED: SWI-Prolog refuses to export ISO predicates, so we cannot  
import them either. This isn’t needed anyway.

- FIXED: Make sure closing a zipper twice does not open the stream twice.

- XSB: completed basics.pl emulation

- TEST: Avoid name clash in tabling tests.

- ENHANCED: Verify a predicate has no clauses when :- table is declared.

- XSB: Partially emulate compiler options.

- CLEANUP: Avoid truncating in abs(ssize\_t) (benign).

- FIXED: Issue#82: Throw a floating point exception when NaN/Inf floats  
need to be converted to an integer.

- XSB: Support modified libraries with the same name.

- XSB: Improve :- import … from … emulation.

- FIXED: Pretend `begin_of_file` is expanded from line 0 instead of  
make source\_location/2 fail.

- XSB: Deal with .H files.

- XSB: Support operators mode and export. Make import look for modules  
relative to the current dir.

- FIXED: Moved setting the SIGINT handler from resetTracer() to  
initTracer() so it won’t reinstall the default SIGINT handler on  
abort if the user changed the binding.

- FIXED: on\_signal/3 handling of `throw`. Peter Ludemann.

- PORT: Prolog flags for android

- DOC: qsave\_progam/2: updated foreign(+Action)

- PORT: set proper android arch

- ADDED: Multi and cross-architecture shlib support for saved states

- FIXED: qsave\_program/2: deal with `prolog` and `default`  
toplevels. Keri Harris.

- FIXED: add -rdynamic to cflags to export symbols (fix #420) Only do  
this if we do not put the Prolog core in a shared object. \* After  
cmake 3.4 -rdynamic is not added when building a  
target. This breaks the android termux build. This patch  
solves the problem.

- TEST: Fixed test that broke due to assert to a static procedure  
unrelated to the test.

- FIXED: Issue#81: assert/1 and friends must produce a permission error  
if the predicate is not dynamic and defined.

- XSB: Added load\_dyn/1,2 and load\_dync/1,2.

- FIXED: in\_temporary\_module/3: destroy the load context for files  
loaded into this module.

- XSB: Partial compile/2 emulation.

- HACK: Use (index)/1 instead of index/1 to avoid a conflict with XSB  
index operator. It is unclear how to guarantee that the first term  
of a source file is always read as intended.

- FIXED: Allow qcompile/1 on files with a different implicit Prolog  
extension.

- PORTABILITY: Started XSB dialect specification.

- FIXED: prolog\_load\_context/2 to provide the correct `file`, `source`  
and `directory` before the first term.

- ADDED: term\_expansion/2,4: add pseudo term `begin_of_file` to the  
expansion stream.

- FIXED: load\_files/2: Added predicate option declaration for  
dialect(+Dialect)

- CLEANUP: Move saved state generation to library(qsave) to simplify  
init.pl

- ENHANCED: Removed conditional code from the boot file. This ensures  
we have the same boot file regardless of the machine, simplifying  
cross compilation.

- CLEANUP: Name the boot file simply boot.prc as it no longer depends  
on the word-size.

- ADDED: Prolog flag `portable_vmi`.

- CLEANUP: Proper range test (LONG\_MAX -\> INPTR\_T\_MAX)

- DOC: Updated expand\_term/2 documentation.

- FIXED: possible crash when loading saved states that contain procedures  
with NULL modules

- PORT: Generate i386 binaries on x86\_64 Debian based Linux systems.

- BUILD: Updated minimum CMake version required to 3.5

- DOC: qsave\_program/2: fix stack size documentation. Keri Harris.

- DIST: added packages/windows directory to source archive. Keri Harris

# Package archive

- ADDED: archive\_foldl/4

# Package clib

- DOC: Fixed a small typo in chmod/2 documentation.

# Package http

- DOC: library(http/http\_client), option json\_object(dict).  
Joost Geurts.

- MODIFIED: Issue#422: json\_read/3 and friends no longer read the  
character that follows the JSON document, allowing for _concatenated  
JSON_.

- FIXED: json\_read\_dict/2,3: allow options to define arbitrary terms  
for true, false, null and end\_of\_file.

- ADDED: json\_read/3 and friends, option end\_of\_file(+Action), where  
`Action` is either the atom `error`, throwing a syntax error or any  
other term, returning this term if the end of the input is encountered  
after skipping white space but before any data.

- ADDED: Simplify generating a URL that refers to a REST location  
declared using a path pattern in http\_handler/3. This affects  
http\_location\_by\_id/2, http\_link\_to\_id/3, http\_redirect/3 and attribute  
value notation used by library(http/html\_write).

- MODIFIED: http\_handler/3: force `Id` in `id(Id)` to be an atom.  
Previous versions accepted any Prolog term. This provides for  
extending http\_location\_by\_id/2 to become more REST friendly.

- EXAMPLES: Updated demo daemon script and systemd service example.

# Package jpl

- COMPAT: Boot file is always boot.prc (used for testing).

# Package nlp

- FIXED: tokenize\_atom/2 when the atom contains an illegal number could  
result in a variable (unbound) extra token in the output.

# Package sgml

- ADDED: xpath/3: text(string) to get the DOM text as a string rather  
than an atom.

- FIXED: xpath/3: make extraction work if the document was parsed  
using cdata(string).

# Package swipl-win

- FIXED: Issue#83: Qt console menu handling. This issue was due to  
omitted resources in the cmake build. Note that this does not fix  
the X11 problems of the MacOS bundle reported in the same issue.

# Package table

- DOC: add table package docs

---

<div class="post-metadata">

### Author: ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)
#### Post date: [February 6, 2019, 5:39am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/2 "2019-02-06T05:39:16Z")

</div>

Colllaboration with XSB sounds very interesting, but also challenging.

From what I understand, XSB prolog is underpinned by a logic-semantic approach that is different to standard (swi) prolog.

Would swi-prolog, in the future, support such advanced semantic capabilities such as real logic negation, defeasibility, etc.

thanks,

Dan

---

<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: [February 6, 2019, 7:53am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/3 "2019-02-06T07:53:49Z")

</div>

The advanced tabling stuff is exactly what we want to make available to SWI-Prolog. The route is not yet decided. I’m currently implementing an XSB dialect layer that allows us to run the XSB test suite to get an idea about what is missing and how good/bad the parts that are in SWI are.

---

<div class="post-metadata">

### Author: ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)
#### Post date: [February 6, 2019, 7:59am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/4 "2019-02-06T07:59:13Z")

</div>

that’s great.

btw, …

I first had tried XSB and in particular its flora-2 extension, but eventually decided to use swi-prolog. First, because the swi-prolog community is much more active (and accessible, in my opinion), and because Flora-2 was very slow, once I extensively used advanced features.

XSB was also sometimes unintuitive to me – its semantics (such as transactional semantics) had a learning curve with subtle issues (again IMHO).

Dan

---

<div class="post-metadata">

### Author: ![pmoura](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/pmoura/32/11_2.png) [@pmoura](https://swi-prolog.discourse.group/u/pmoura)
#### Post date: [February 6, 2019, 10:02am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/5 "2019-02-06T10:02:46Z")

</div>

Running and comparing the results of the Logtalk bundled tests on SWI-Prolog and XSB, in particular for the Prolog compliance test suite, helps highlighting the differences between the two systems. A test passing in one system and failing in the other system alerts to a potential compatibility issue when trying to run code written for the first system in the second system.

---

<div class="post-metadata">

### Author: ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)
#### Post date: [February 6, 2019, 10:27am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/6 "2019-02-06T10:27:47Z")

</div>

Right, but i would imagine that XSB feature set is a superset of both SWI and Logtalk

---

<div class="post-metadata">

### Author: ![pmoura](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/pmoura/32/11_2.png) [@pmoura](https://swi-prolog.discourse.group/u/pmoura)
#### Post date: [February 6, 2019, 10:34am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/7 "2019-02-06T10:34:57Z")

</div>

No. The feature sets of XSB and SWI-Prolog **intersect** without one subsuming the other. Logtalk extends and runs on both systems and none of them provide sensible/effective alternatives to its key features.

---

<div class="post-metadata">

### Author: ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)
#### Post date: [February 6, 2019, 10:39am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/8 "2019-02-06T10:39:26Z")

</div>

thanks,

I am curious, from your experience, how does the picture look like when considering flora-2 as well.

I guess, Flora-2 is a frame based system, but doesn’t have any notions of objects in the sense of encapsulation and message passing and polymorphism.

But, i think the strongest claim (selling point) of XSB is its semantic foundation – i would imagine that this is where the key difference, and potential augmentation, need to be sought

thanks,

Daniel

---

<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: [February 6, 2019, 10:42am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/9 "2019-02-06T10:42:04Z")

</div>

And the whole point of this project is make the intersection larger, first of all by making key functionality available in one system available in the other. The overall idea is not so much to make the system fully compatible, but to facilitate porting applications both ways.

This means porting some of the key tabling functionality to SWI and providing some of the threading and foreign language facilities to XSB.

---

<div class="post-metadata">

### Author: ![pmoura](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/pmoura/32/11_2.png) [@pmoura](https://swi-prolog.discourse.group/u/pmoura)
#### Post date: [February 6, 2019, 10:51am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/10 "2019-02-06T10:51:09Z")

</div>

I agree that Flora-2 is best described as a frame system, focused on knowledge representation, rather than object-oriented system, specially when considering, as you mention, common OO features.

XSB have advanced tabling features, as Jan just mentioned, that would be useful to have in SWI-Prolog. One the other hand, SWI-Prolog have reliable features such as multi-threading, which are buggy in XSB. Then there are other features in XSB like HiLog and Semantic models, which, as you mentioned, are selling points for it and leveraged in Flora-2. My understanding is that this is the main reason why Flora-2 only supports XSB.

---

<div class="post-metadata">

### Author: ![grossdan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/grossdan/32/23_2.png) [@grossdan](https://swi-prolog.discourse.group/u/grossdan)
#### Post date: [February 6, 2019, 11:04am UTC](https://swi-prolog.discourse.group/t/version-8-1-1-available/23/11 "2019-02-06T11:04:34Z")

</div>

If i understood it correctly, I think tabling is the key technology underpinning the semantics of XSB prolog, including the ability to create true logic negation – i.e. asserting when something is known not to be the case – as opposed to negation as failure.

So, i am wondering, if full tabling support is introduced into swi-prolog, if this could then also lead to an extension to support XSBs semantics – perhaps, analogous to pure prolog – a style one can adopt.

I think such an extension could be very valuable.

Dan
