# Nice to know

**URL:** https://swi-prolog.discourse.group/c/nice-to-know/17.md?page=2

[Latest](https://swi-prolog.discourse.group/latest.md) · [Categories](https://swi-prolog.discourse.group/categories.md) · [Tags](https://swi-prolog.discourse.group/tags.md)

**Page:** 3

---

## [Sometimes you just can't get an exact match on an SWI-Prolog error message](https://swi-prolog.discourse.group/t/sometimes-you-just-cant-get-an-exact-match-on-an-swi-prolog-error-message/6322)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 1\
**Last updated:** [March 1, 2023, 12:04pm UTC](https://swi-prolog.discourse.group/t/sometimes-you-just-cant-get-an-exact-match-on-an-swi-prolog-error-message/6322 "2023-03-01T12:04:50Z")

</div>

Short answer: Check messages.pl In tyring to locate the source of this error message % The following threads wouldn't die: \['httpd@8080\_1'\] First searched GitHub for The following threads wouldn't die with no luck. T…

---

## [Debug/3 messages reverse lookup](https://swi-prolog.discourse.group/t/debug-3-messages-reverse-lookup/6321)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [March 1, 2023, 11:03am UTC](https://swi-prolog.discourse.group/t/debug-3-messages-reverse-lookup/6321 "2023-03-01T11:03:31Z")

</div>

SWI-Prolog has many debug/3 included in the source code with many topics related to http. Often times we have the topic message(s) but would like to know which debug/3 topic created the message or would just like to see…

---

## [Modifying debug/3 by using message\_prefix\_hook/2](https://swi-prolog.discourse.group/t/modifying-debug-3-by-using-message-prefix-hook-2/6318)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [February 28, 2023, 1:51pm UTC](https://swi-prolog.discourse.group/t/modifying-debug-3-by-using-message-prefix-hook-2/6318 "2023-02-28T13:51:46Z")

</div>

Recently needed to check the corrdination of events for a web page and server. The server was created using SWI-Prolog and the client created using HTML and JavaScript. When trying to check/debug such code it is nice to …

---

## [SWI-Prolog Foreign Language Interface (MSYS2 - DLL)](https://swi-prolog.discourse.group/t/swi-prolog-foreign-language-interface-msys2-dll/6268)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [February 18, 2023, 9:53am UTC](https://swi-prolog.discourse.group/t/swi-prolog-foreign-language-interface-msys2-dll/6268 "2023-02-18T09:53:51Z")

</div>

On Windows Install MSYS2 See MSYS2 for details. MSYS2 creates several interactive shells For these instructions only two shells will be used. MSYS2 MSYS - For building a Dynamic Link Library (DLL) with a C toolc…

---

## [Improving backtracing behavior](https://swi-prolog.discourse.group/t/improving-backtracing-behavior/6243)

<div class="topic-metadata">

**Author:** [@grossdan](https://swi-prolog.discourse.group/u/grossdan)\
**Replies:** 1\
**Last updated:** [February 16, 2023, 11:53am UTC](https://swi-prolog.discourse.group/t/improving-backtracing-behavior/6243 "2023-02-16T11:53:59Z")

</div>

Hello, Its been a while I posted (and programmed), here is a little insight from this morning (likely obvious to many, but perhaps useful to some). When testing code you can provide inputs to test the correct behavior …

---

## [Quite a few basic Prolog questions of ChatGPT](https://swi-prolog.discourse.group/t/quite-a-few-basic-prolog-questions-of-chatgpt/6145)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 6\
**Last updated:** [February 8, 2023, 2:53pm UTC](https://swi-prolog.discourse.group/t/quite-a-few-basic-prolog-questions-of-chatgpt/6145 "2023-02-08T14:53:43Z")

</div>

Feb 17 2023 Reorganized most of what was originally here in to several separate topics with a table of contents. The starting topic: LLM (Large Language Model) such as ChatGPT prompts related to Prolog

---

## [Data types with Negation (never heard of Chu space before this)](https://swi-prolog.discourse.group/t/data-types-with-negation-never-heard-of-chu-space-before-this/6108)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 3\
**Last updated:** [February 7, 2023, 11:12am UTC](https://swi-prolog.discourse.group/t/data-types-with-negation-never-heard-of-chu-space-before-this/6108 "2023-02-07T11:12:12Z")

</div>

Data types with Negation by Bob Atkey This notes Chu spaces which is new to me and so might be of interest to others here. Personal notes (Click triangle to expand)Guide to Papers on Chu Spaces Introduction to Channe…

---

## [ChatGPT versus a Prolog Exam](https://swi-prolog.discourse.group/t/chatgpt-versus-a-prolog-exam/6192)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [February 7, 2023, 12:07am UTC](https://swi-prolog.discourse.group/t/chatgpt-versus-a-prolog-exam/6192 "2023-02-07T00:07:23Z")

</div>

---

## [Scryer Prolog (scryer.pl) documentation announcement discussion on Hacker News](https://swi-prolog.discourse.group/t/scryer-prolog-scryer-pl-documentation-announcement-discussion-on-hacker-news/6181)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [February 5, 2023, 8:57am UTC](https://swi-prolog.discourse.group/t/scryer-prolog-scryer-pl-documentation-announcement-discussion-on-hacker-news/6181 "2023-02-05T08:57:41Z")

</div>

A few days ago the first official documentation for Scryer Prolog was released (notice) and then noted on Hacker News. Each news posting also has an associated comment page. The comment page for the Scryer Prolog documen…

---

## [Library(persistency) data files must have a blank last line](https://swi-prolog.discourse.group/t/library-persistency-data-files-must-have-a-blank-last-line/6160)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [January 30, 2023, 11:53am UTC](https://swi-prolog.discourse.group/t/library-persistency-data-files-must-have-a-blank-last-line/6160 "2023-01-30T11:53:58Z")

</div>

library(persistency) creates \*.pl files (I call them journals) for persisting predicates. When a journal file is opened it is opened with append. When a predicate is asserted to the journal it is appended to the end of …

---

## [Wine 8.0 released](https://swi-prolog.discourse.group/t/wine-8-0-released/6126)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [January 25, 2023, 10:55am UTC](https://swi-prolog.discourse.group/t/wine-8-0-released/6126 "2023-01-25T10:55:03Z")

</div>

Wine 8.0 released The main achievement is the completion of the conversion to PE format. The reason of note with regards to SWI-Prolog is for these repositories SWI-Prolog flag wine\_version(atom) clib test, …

---

## [\`tmp\_file\_stream/3\` is easy to use](https://swi-prolog.discourse.group/t/tmp-file-stream-3-is-easy-to-use/6123)

<div class="topic-metadata">

**Author:** [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Replies:** 0\
**Last updated:** [January 23, 2023, 11:38am UTC](https://swi-prolog.discourse.group/t/tmp-file-stream-3-is-easy-to-use/6123 "2023-01-23T11:38:01Z")

</div>

I have made a first success in my life to use tmp\_file\_stream/3. In fact, I failed to use tmp\_file/2 some time long ago due to some reason on my side. From now on, it is not necessary to worry about working director…

---

## [Analyse big Prolog terms using SWISH](https://swi-prolog.discourse.group/t/analyse-big-prolog-terms-using-swish/6086)

<div class="topic-metadata">

**Author:** [@jan](https://swi-prolog.discourse.group/u/jan)\
**Replies:** 2\
**Last updated:** [January 17, 2023, 4:16am UTC](https://swi-prolog.discourse.group/t/analyse-big-prolog-terms-using-swish/6086 "2023-01-17T04:16:37Z")

</div>

Today I found myself looking at this term in the logs. goal\_failed(swish\_chat:('.'(v{anonymous\_avatar:'/icons/avatar.svg#1939449',avatar:'/icons/avatar.svg#1939449',avatar\_source:client},put(\_12328{check\_login:true,cons…

---

## [Best practices for printing](https://swi-prolog.discourse.group/t/best-practices-for-printing/4231)

<div class="topic-metadata">

**Author:** [@Wiki](https://swi-prolog.discourse.group/u/Wiki)\
**Replies:** 4\
**Last updated:** [January 12, 2023, 9:34am UTC](https://swi-prolog.discourse.group/t/best-practices-for-printing/4231 "2023-01-12T09:34:32Z")

</div>

This is from a reply by Jan W. Best practice seems to be Use format/3 to emit non-term output. When writing a library, use the print\_message/2 indirection for talking to the user. Use writeq/1 or write\_canonical/1 to …

---

## [Children of the Miracle: from Algol to Prolog](https://swi-prolog.discourse.group/t/children-of-the-miracle-from-algol-to-prolog/6081)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [January 8, 2023, 11:15am UTC](https://swi-prolog.discourse.group/t/children-of-the-miracle-from-algol-to-prolog/6081 "2023-01-08T11:15:53Z")

</div>

Children of the Miracle: from Algol to Prolog

---

## [WSL and WSLg now work on Windows 10](https://swi-prolog.discourse.group/t/wsl-and-wslg-now-work-on-windows-10/6042)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [December 20, 2022, 5:10pm UTC](https://swi-prolog.discourse.group/t/wsl-and-wslg-now-work-on-windows-10/6042 "2022-12-20T17:10:51Z")

</div>

Windows Subsystem for Linux (WSL) and Windows Subsystem for Linux GUI (WSLg) both now work on Windows 10. :slightly\_smiling\_face:

---

## [DBpedia - structured information that resembles an open knowledge graph (OKG)](https://swi-prolog.discourse.group/t/dbpedia-structured-information-that-resembles-an-open-knowledge-graph-okg/5614)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [July 17, 2022, 12:46pm UTC](https://swi-prolog.discourse.group/t/dbpedia-structured-information-that-resembles-an-open-knowledge-graph-okg/5614 "2022-07-17T12:46:41Z")

</div>

---

## [Automating Commonsense Reasoning with ASP and s(CASP)\*](https://swi-prolog.discourse.group/t/automating-commonsense-reasoning-with-asp-and-s-casp/5999)

<div class="topic-metadata">

**Author:** [@edmcman](https://swi-prolog.discourse.group/u/edmcman)\
**Replies:** 0\
**Last updated:** [December 2, 2022, 9:06pm UTC](https://swi-prolog.discourse.group/t/automating-commonsense-reasoning-with-asp-and-s-casp/5999 "2022-12-02T21:06:40Z")

</div>

This is quite a nice resource explaining Answer Set Programming and various ways of thinking about reasoning and how to encode them: Automating Commonsense Reasoning with ASP and s(CASP)\*

---

## [The Prolog Day Symposium - recordings and slides](https://swi-prolog.discourse.group/t/the-prolog-day-symposium-recordings-and-slides/5985)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 0\
**Last updated:** [December 1, 2022, 8:07am UTC](https://swi-prolog.discourse.group/t/the-prolog-day-symposium-recordings-and-slides/5985 "2022-12-01T08:07:42Z")

</div>

The Prolog Day Symposium

---

## [Foldnum for integer intervals like foldl for lists](https://swi-prolog.discourse.group/t/foldnum-for-integer-intervals-like-foldl-for-lists/5975)

<div class="topic-metadata">

**Author:** [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Replies:** 2\
**Last updated:** [November 29, 2022, 6:55pm UTC](https://swi-prolog.discourse.group/t/foldnum-for-integer-intervals-like-foldl-for-lists/5975 "2022-11-29T18:55:34Z")

</div>

foldnum is a macro included in my pack package pac about ten years ago. I have fixed a bug of foldnum macro expansion related to global variable. foldnum is a version of foldl for integer interval in stead of lists. I…

---

## [A simple but powerful generalization of path counting in rectangular grid graphs](https://swi-prolog.discourse.group/t/a-simple-but-powerful-generalization-of-path-counting-in-rectangular-grid-graphs/5906)

<div class="topic-metadata">

**Author:** [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Replies:** 0\
**Last updated:** [October 31, 2022, 3:35pm UTC](https://swi-prolog.discourse.group/t/a-simple-but-powerful-generalization-of-path-counting-in-rectangular-grid-graphs/5906 "2022-10-31T15:35:33Z")

</div>

Edit: 2022/11/04 For just a fun, I selected randomly 100 undirected graphs with source and target in a fixed set of ten nodes, and count paths for each graph. The result is below, in which most of graphs have not a pa…

---

## [Useful predicate: run\_process/3](https://swi-prolog.discourse.group/t/useful-predicate-run-process-3/5901)

<div class="topic-metadata">

**Author:** [@swi](https://swi-prolog.discourse.group/u/swi)\
**Replies:** 9\
**Last updated:** [November 2, 2022, 8:35am UTC](https://swi-prolog.discourse.group/t/useful-predicate-run-process-3/5901 "2022-11-02T08:35:39Z")

</div>

I’ve written a predicate to run a process and capture its stdout or stderr a million times, today I just ran into the fact it is built in in SWI: run\_process/3. For some reason the docs are not linked directly, but here …

---

## [A small extension to ZDD for sets and lists to coexist enumerates permutations of a list of length 13](https://swi-prolog.discourse.group/t/a-small-extension-to-zdd-for-sets-and-lists-to-coexist-enumerates-permutations-of-a-list-of-length-13/5890)

<div class="topic-metadata">

**Author:** [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Replies:** 0\
**Last updated:** [October 24, 2022, 8:29am UTC](https://swi-prolog.discourse.group/t/a-small-extension-to-zdd-for-sets-and-lists-to-coexist-enumerates-permutations-of-a-list-of-length-13/5890 "2022-10-24T08:29:38Z")

</div>

By making small extension to the ZDD library in pack pac-1.6.8, I have tested to enumerate all permutations of a list of length 13, which took around 5 seconds. The purpose of this experiment is to see if it is really e…

---

## [How to search SWI-Prolog Change Logs](https://swi-prolog.discourse.group/t/how-to-search-swi-prolog-change-logs/5884)

<div class="topic-metadata">

**Author:** [@Wiki](https://swi-prolog.discourse.group/u/Wiki)\
**Replies:** 0\
**Last updated:** [October 21, 2022, 9:41am UTC](https://swi-prolog.discourse.group/t/how-to-search-swi-prolog-change-logs/5884 "2022-10-21T09:41:53Z")

</div>

As noted by Jan W. in this reply. Go to the download page (SWI-Prolog downloads) and follow the ChangeLog link. That gives a page with the latest release changelog and a menu that allows selecting a range of versions. …

---

## [SWI-Prolog versioning](https://swi-prolog.discourse.group/t/swi-prolog-versioning/5866)

<div class="topic-metadata">

**Author:** [@Wiki](https://swi-prolog.discourse.group/u/Wiki)\
**Replies:** 0\
**Last updated:** [October 18, 2022, 8:15am UTC](https://swi-prolog.discourse.group/t/swi-prolog-versioning/5866 "2022-10-18T08:15:50Z")

</div>

Originally posted by Jan W. with regards to changing the SWI-Prolog major version number from 8 to 9. (ref) I think SWI-Prolog is not subject to semantic versioning. That schema is fine for libraries with a fairly sm…

---

## [sCASP: some amazing queries](https://swi-prolog.discourse.group/t/scasp-some-amazing-queries/5837)

<div class="topic-metadata">

**Author:** [@swi](https://swi-prolog.discourse.group/u/swi)\
**Replies:** 3\
**Last updated:** [October 10, 2022, 2:16pm UTC](https://swi-prolog.discourse.group/t/scasp-some-amazing-queries/5837 "2022-10-10T14:16:36Z")

</div>

I’ve playing around with sCASP again and don’t cease to be amazed at its beauty. Say we have this small program, just four facts: :- use\_module(library(scasp)). bird(sam). bird(tweety). -bird(lion). -bird(monkey). No…

---

## [Fixing a small gap in preprocessing for ZDD based propositional refutation](https://swi-prolog.discourse.group/t/fixing-a-small-gap-in-preprocessing-for-zdd-based-propositional-refutation/5805)

<div class="topic-metadata">

**Author:** [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Replies:** 0\
**Last updated:** [September 26, 2022, 7:03am UTC](https://swi-prolog.discourse.group/t/fixing-a-small-gap-in-preprocessing-for-zdd-based-propositional-refutation/5805 "2022-09-26T07:03:24Z")

</div>

EDIT: 2022-9-27 I have updated the package pac to pac-1.6.7 as it is. I think ZDD library is almost final as I planned when I started to develop, though it is still a toy. Now I will play it around with the library from…

---

## [A transparent revision on interface with ZDD library](https://swi-prolog.discourse.group/t/a-transparent-revision-on-interface-with-zdd-library/5776)

<div class="topic-metadata">

**Author:** [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Replies:** 0\
**Last updated:** [September 17, 2022, 7:07am UTC](https://swi-prolog.discourse.group/t/a-transparent-revision-on-interface-with-zdd-library/5776 "2022-09-17T07:07:27Z")

</div>

I have simplified interfaces with ZDD library so that hybrid expressions on ZDD and the usual Prolog term can be mixed with transparent way. The idea is to restrict pragmas to three # , $, and : observing these three a…

---

## [Byte Magazine Volume 12 Number 09: Prolog and 386 Hardware Software (1987)](https://swi-prolog.discourse.group/t/byte-magazine-volume-12-number-09-prolog-and-386-hardware-software-1987/5680)

<div class="topic-metadata">

**Author:** [@EricGT](https://swi-prolog.discourse.group/u/EricGT)\
**Replies:** 1\
**Last updated:** [September 1, 2022, 7:01am UTC](https://swi-prolog.discourse.group/t/byte-magazine-volume-12-number-09-prolog-and-386-hardware-software-1987/5680 "2022-09-01T07:01:17Z")

</div>

---

## [Counting connected undirected graphs with given nodes using ZDD](https://swi-prolog.discourse.group/t/counting-connected-undirected-graphs-with-given-nodes-using-zdd/5720)

<div class="topic-metadata">

**Author:** [@kuniaki.mukai](https://swi-prolog.discourse.group/u/kuniaki.mukai)\
**Replies:** 0\
**Last updated:** [August 29, 2022, 4:30pm UTC](https://swi-prolog.discourse.group/t/counting-connected-undirected-graphs-with-given-nodes-using-zdd/5720 "2022-08-29T16:30:38Z")

</div>

Let f(n) be the number of undirected connected graphs (CUDG) with n nodes. For examples, f(2)=1, f(3)=4. I wrote a codes using ZDD library to enumerate such CUGD for give n. Although this was a hobby programming for me…

[Previous page](https://swi-prolog.discourse.group/c/nice-to-know/17.md?page=1)

[Next page](https://swi-prolog.discourse.group/c/nice-to-know/17.md?page=3)
