# Ann: SWI-Prolog 9.3.15

**URL:** <https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-15/8613>\
**Category:** Releases\
**Created:** [November 18, 2024, 5:12pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-15/8613 "2024-11-18T17:12:52Z")\
**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:** [November 18, 2024, 5:12pm UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-15/8613/1 "2024-11-18T17:12:52Z")

</div>

Dear SWI-Prolog user,

SWI-Prolog 9.3.15 is ready for download. It comes with some  
(portability fixes), introduction of SSU for DCG using `Head ==> Body`  
and various updates to printing numeric values including support for  
printing integers with “grouping” in the toplevel and debugger. Some  
of the formatting is under discussion as PIP-105 and may (and probably  
will) change.

Highlights:

- Added library(prolog\_locale), providing setup\_prolog\_integer\_grouping/0.  
This allows for this in your `init.pl` after which big integers are  
written as `1_234_456`, etc in the toplevel and debugger.

- Added write\_term/2,3 options format\_float(+Format) (SICStus  
compatibility) and format\_integer(+Format). These issues are  
under discussion as PIP-105 and may change.

- Added `~:D` (colon modifier for `D` to use `_` instead of  
`,` for digit grouping.

- Added format/2 `~N[hH]` specifier for compatiblity with SICStus.  
Provides writing floats with minimal digits for reading to the same  
float (as write/1), where `N` dictates when to us exponential  
notation or not.

- Added `Head ==> Body`, providing SSU DCG rules. Notably comfortable  
for _generative_ (serializing) DCG rules.

- Cleanup and some possible fixes for prolog\_trace\_interception/4,  
the hook that drives the graphical debugger and SWISH debugger.  
Surely fixes some things, but unclear whether this fixes some  
infrequent SWISH crashes.

- Some “pack” management fixes.

- Implement distinct/1,2 and reduced/1,3 using tries.  
This reduces the overhead over 5 times

- Dropped most of the visibility of the old C++ interface. The  
code is still there, so code relying on it still works.

- Fedora 41 portability patches (hamcrest and latest OpenSSL BIO  
issue)

# SWI-Prolog Changelog since version 9.3.14

[Nov 18 2024]

- FIXED: Handling return values in stack expansion. Introduce  
more `bool` to correctly distinguish functions returning  
true/false/\*\_OVERFLOW from those raising exceptions and only returning  
true/false.

- FIXED: prolog\_trace\_interception/4: setting up the hook good crash.

[Nov 17 2024]

- CLEANUP: Updated library(option). Updated documentation and make  
more use of =\> to capture type issues. merge\_options/3 now also  
supports dicts.

- ENHANCED: prolog\_frame\_attribute/3: Better argument validation.  
Also various minor cleanup (e.g., more `bool`).

- FIXED: library(main): superfluous choice point in argv\_options/3

[Nov 16 2024]

- ADDED: format/2: support `~:D` The colon modifier for `D` forces  
the use of Prolog digit grouping using `_`.

- FIXED: format/2 handling of Unicode characters Regression from  
a49fe8cb40fc15b7325a4e4836304cbe6d9ccef0

[Nov 15 2024]

- ADDED: library(prolog\_locale) to setup grouped printing of integers.

- ADDED: write\_term/2 options format\_float(+Format) and  
format\_integer(+Format) Using a format seems a more sensible way to  
control writing numbers from write\_term/2. This patch removes the  
previously introduced radix(+Radix) option. If we want this back we  
will implement it on top of format\_integer(+Format).

- ADDED: write\_term/2: option radix(Radix). Experimental. Under  
discussion as PIP-105. The current implementation writes, unlike XSB,  
the radix prefix. We either need more options or we should consider  
another alternative such as integer\_format(+Format)

[Nov 14 2024]

- ADDED: format/2 specifier `~h` This provides compatibility to  
SICStus. It also makes write/1 output for floats compatible to SICStus  
for deciding between fixed point and exponential notation.

- FIXED: ISO compatible parsing for `fy 2 yf` and similar cases.

[Nov 13 2024]

- TEST: Added ISO ambiguous operator tests. Marked two tests as blocked  
as these currently fail.

[Nov 8 2024]

- FIXED: #1331 Module issue in SICStus block/1 emulation. This patch  
also reformats the file, removes some dead code and remove the outdated  
restriction that it does not work on dynamic or foreign predicates.

[Nov 6 2024]

- ENHANCED: Avoid spurious tracing in push\_msg/2.

- DEBUG: First print the Prolog stack “safe” on a crash. This guarantees  
that the stack is printed, including details on the clauses involved  
and progress in each clause. Next, the stacks are printed with  
arguments. This however may crash if the crash is caused by corrupt  
data on the stacks.

[Nov 5 2024]

- ADDED: Support SSU DCG rules as `Head[, Guard] ==> DCGBody`.

- FIXED: libary(prolog\_pack): detection of valid download URLs.

- FIXED: Build order planning. This reverts  
1cf4acbe722604857a2627ecc161f80e16f330ed. That patch was broken.  
The reported failure probably had some other cause.

[Nov 4 2024]

- FIXED: Installing a pack should attach the pack itself. This  
incorrectly registered the directory of the pack as a directory that  
provides packs instead.

- ENHANCED: explain/1 to enumerate all instances of a non-qualified  
predicate.

- TEST: rwlocks unit tests for safety and reliability

[Nov 3 2024]

- BUILD: `plunit` requires `clib` package.

[Nov 1 2024]

- ENHANCED: Implement distinct/1,2 and reduced/1,3 using tries.  
This reduces the overhead over 5 times.

## Package bench

[Nov 13 2024]

- FIXED: Avoid division by zero if no tests are executed.

## Package cpp

[Nov 2 2024]

- DEPRECATED: Officially deprecate version 1 of the C++ interface.  
For now, we will keep SWI-cpp.h in the distribution. We do not plan  
any updates to keep it in sync with changes to SWI-Prolog or the  
C++ standard. Users of this old interface are strongly encouraged  
to update their program.

- DOC: removed all “(version 2)”

- DOC: Delete documentation for version 1 of the C++ interface

## Package jpl

[Nov 14 2024]

- TEST: Fix finding hamcrest on Fedora 41

## Package plunit

[Nov 6 2024]

- ENHANCED: PlUnit message for tests that succeed with a choicepoint.

## Package ssl

[Nov 17 2024]

- PORT: Extended our BIO\_ctrl() callback. In Fedora 41, OpenSSL  
3.2.2, it appears we need to implement the BIO\_ctrl() methods  
`BIO_C_FILE_TELL` and `BIO_C_FILE_SEEK` for properly loading keys  
from files.

---

<div class="post-metadata">

**Author:** ![kwon-young](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/kwon-young/32/4841_2.png) [@kwon-young](https://swi-prolog.discourse.group/u/kwon-young)\
**Post date:** [November 19, 2024, 8:12am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-15/8613/2 "2024-11-19T08:12:44Z")

</div>

Hello !

> [@jan](#):
>
> Added `Head ==> Body`, providing SSU DCG rules. Notably comfortable  
> for _generative_ (serializing) DCG rules.

This is amazing ! Is there some documentation for this ?  
I’ll make sure to try this in my c generation grammar 🙂

Ah, and does this mean that push back list are incompatible with ==\> ?

---

<div class="post-metadata">

**Author:** ![kwon-young](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/kwon-young/32/4841_2.png) [@kwon-young](https://swi-prolog.discourse.group/u/kwon-young)\
**Post date:** [November 19, 2024, 8:22am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-15/8613/3 "2024-11-19T08:22:13Z")

</div>

> [@kwon-young](#):
>
> Is there some documentation for this ?

I found this bit in the documentation: [SWI-Prolog -- Single sided unification for Definite Clause Grammars](https://www.swi-prolog.org/pldoc/man?section=ssu-dcg)

---

<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:** [November 19, 2024, 8:44am UTC](https://swi-prolog.discourse.group/t/ann-swi-prolog-9-3-15/8613/4 "2024-11-19T08:44:08Z")

</div>

Note that especially the stuff between the head and the `==>` is not set in stone as far as I’m concerned. If there are better options, let me know.

I vaguely recall that the current ISO proposal for DCGs only allows for a push-back _list_, which would the choices for `==>` safe. The current SWI-Prolog DCG allows for an arbitrary DCG body term in the place of a push-back list, making the current choice ambiguous. Does anyone have the details?

Another interpretation would be to use terms between the Head and `==>` as DCG body terms that parse and are used as guards. I don’t see a good use case though as I see no value in SSU on the Head in that case. If anyone finds use cases that ask for reconsidering the choices, please post them (in new topic?)
