XIO

xWire

Posts from every feed QUEST has found across the web — blogs, news, podcasts, channels and more.

SWI-Prolog - Latest topics

Latest topics

Pack publishing issues (tui pack)

There was an issue where a discrepancy between a pack tame and git repo tame caused some problems. Jan, we chatted in the Discourse. I renamed my repo. The repo is tui. The pack is tui. I’m able to publish, bur the result is inconsistent. When I publish, the confirmation sounds OK: Published pack tui@0.3.0 to be installed from https://github.com/z5h/tui.git Here I see the latest version: swi-prolog.org SWI-Prolog packages I click for more info: swi-prolog.org "tui" pack for SWI-Prolog I see:…

Ann: SWI-Prolog 10.1.19

Dear SWI-Prolog user, SWI-Prolog 10.1.19 is ready for download. The core has a faster virtual machine and much faster tabling. XPCE can now handle sound, cameras, video, gamepads, pens and touch screens, draw using the GPU and draw vector graphics. Highlights: Core The virtual machine instructions can be compiled as functions that continue using guaranteed tail calls. This is now the default for GCC >= 15 and Apple Clang. Together with keeping the hot code together and avoiding several stalls,…

Progressing the XPCE GUI

I’ve created this topic next to Progressing the SWI-Prolog environment. That topic is about using xpce for the Prolig IDE. This is about XPCE itself. The main achievements that relate to both are: Tabs and tiled subwindows are now used extensively by the IDE, stopping the many windows floating over your screen. Tools run in panes, a tab can hold multiple panes as tiled subwindows and a frame holds one or more tabs. panes can be dragged to reorganize the tiling, move them to other tabs or…

Thread_get_message/3 can spin with a pending signal during cleanup

Upstream report: zero-time thread_get_message/3 can spin with a pending signal during cleanup Environment SWI-Prolog 10.1.17 and 10.1.18, with version_data = swi(10,1,17,[]) and swi(10,1,18,[]) respectively; both report fat-darwin. 10.1.18 was extracted separately from the official swipl-10.1.18-1.fat.pkg and verified to use its own framework and Prolog home. Package SHA256: 603bd311efb03176e87065acf80f9a2f26264e06e7856154b8b92b2a3e2f3a53. Runtime architecture: arm64-darwin; host: macOS 26.6.2,…

TUI (Terminal User Interface) pack

I’ve published a TUI library. I did the design/prototyping/optimization of the MVP. Then worked with Claude Code to add features and polish before publishing. Features include: TEA-inspired model/view/update · term-based views (rows, columns, tables, zones, align, ports, RGB styles) · components via alias_drawable/2 + at_event_is/3 event bubbling · ready-made inputs, buttons, check boxes, scroll areas · optimized incremental painting · Kitty keyboard protocol · mouse · Kitty graphics images ·…

Performance work

The current GIT version brings some interesting performance improvements. Tabling, using GitHub - JanWielemaker/tabling_benchmarks: Benchmarks for tabling · GitHub has pretty much double the performance on all aspects now. This is the result of some more VM support, combining several built-in predicates that realise tabling, a better trie data representation and some improvements to several functions. Tabling uses about 50% of the memory it used to. That is the result of more compact tries as…

[Flash Report] Fast sorting & canonical deduplication for rational trees via C foreign predicate (tcoa_sort/2)

I would like to share an experimental C-based foreign predicate, tcoa_sort/2, designed to sort and deduplicate lists of terms (including rational trees/cyclic terms) up to bisimilarity on a 1,000,000-term scale. Approach Overview Based on term_automaton/2: Each term is converted to an automaton representation. No automaton_minimal/3: Explicit automaton minimization (e.g., Hopcroft-style partition refinement) is omitted. Bisimilarity-driven serialization: During serialization into binary…

Possible database update problem

I’m on the latest daily build for windows (version 10.1.18-3-gf379af528). I noticed that some times the database state is not correctly updated after I make a change to my code and call make/0. For example, I remove a couple of clauses from my program after which the program should fail, then I call make/0 and when I call my program at the top level it succeeds. So I start a fresh session without making any changes to my code and the same query succeeds. The difference between the two sessions…

Ann: SWI-Prolog 10.1.18

Dear SWI-Prolog user, SWI-Prolog 10.1.18 is ready for download. This version modernises the GUI: dialog items have a flat, themed look, everything can be operated from the keyboard and there are editors for the GUI preferences and themes. The core comes with a series of bug fixes. Highlights: Core The Prolog flag theme selects the theme of the console, the online help and the GUI, e.g., :- set_prolog_flag(theme, dark). in the init file. A theme can be based on another using prolog:theme_base/2.…

Why does call_with_time_limit/2 fail to interrupt tight repeat loops with frequent I/O?

Hi all, I have been benchmarking several rational tree comparison predicates (including Foreign C implementations) by fuzz-testing them against transitivity: generating random terms and searching for counterexamples (X<Y∧Y<Z∧¬(X<Z)). Initially, I tried the natural idiom using repeat and call_with_time_limit/2: Prolog anti_transitivity(Sec, Pred, X, Y, Z) :- catch( call_with_time_limit(Sec, search_anti_trans(Pred, X, Y, Z)), time_limit_exceeded, writeln('Timeout.') ). search_anti_trans(Pred, X,…

Writing a CSG in DCG notation

I am trying to find a way to write the classic a^nb^nc^n Context Sensitive Grammar (CSG) from Hopcroft & Ullman in DCG notation. The book gives the productions of the grammar as follows: S \rightarrow aSBC S \rightarrow aBC CB \rightarrow BC aB \rightarrow ab bB \rightarrow bb bC \rightarrow bc cC \rightarrow cc First, note that I’m not simply interested in DCG or a Prolog program that can generate strings of a’s, b’s and c’s of the same length one after the other: I know how to do that. What…

OpenSearch Query Gateway - with Prolog

My last Golang project with Prolog used for business rules, DSG queries etc. - based on OpenSearch index schemas. github.com GitHub - peter7775/opensearch-query-gateway: A gateway for querying OpenSearch with support for... A gateway for querying OpenSearch with support for multiple query layers, including a DCG-based parser, DSL builder, rule engine, and schema analysis. 1 post - 3 participants Read full topic

Ann: SWI-Prolog 10.1.17

Dear SWI-Prolog user, SWI-Prolog 10.1.17 is ready for download. This version is mostly about the GUI, which now supports switching between light and dark themes while running and follows the desktop settings. Highlights: Core Loading a .qlf file now notices changes to included, consulted and dependency files rather than only the main source file. This notably affects aggregates such as pce.qlf. Also fixes a memory and atom leak in ‘$qlf_module’/2. Incremental subsumptive tabling raised a…

Mixed info deduction

I can’t imagine a title that really describes what I’m after, so apologies for that… I’m currently working with geometric objects (for no particular reason), and I’m wondering if there’s a good way to implement the use of two different, yet equivalent, definitions for something, such that no matter what you are given, prolog can fill in as many unknowns as possible. Concrete example: An equaliateral triangle can be defined as a triangle with 3 sides of equal length. It can also be defined as a…

Plunit and optimise

With this program: :- set_prolog_flag(optimise, true). :- begin_tests(foo). test(1) :- true. :- end_tests(foo). compiling the buffer works fine (Ctrl-c Ctrl-b) but make/0 (Ctrl-c Ctrl-m) gives an error: % /home/mike/odds_and_sods/test compiled 0.00 sec, 0 clauses | ERROR: plunit:current_test/5: Unknown procedure: plunit_foo:'unit test'/4 ERROR: Unknown procedure: plunit_foo:'unit test'/4 ERROR: In: ERROR: [15] throw(error(existence_error(procedure,...),context(...,_2108))) ERROR: [13]…

Minimum MacOS requirements for SWI Prolog

The current development stream indicates the minimum requirements for SWIP on MacOS as: MacOSX 10.15 (Catalina) and later on x86_64 and arm64 As tested on a desktop Intel Mac: MacOS 10.15 (Catalina) (and previous, I assume) current installer does not work application bundle 10.1.7 works, new xpce GUI doesn’t work MacOS 12 (Monterey) current installer does not work application bundle 10.1.7 works, new xpce GUI works On M3 laptop: MacOS 15 (Sequoia) current installer works (very nice), new xpce…

Other languages are different, but not that different

I think the original quote is from O’Keefe “Prolog is different, but not that different.” Those students used to procedural/imperative languages sometimes have a hard time getting started with prolog, because it is a bit different, more a database query language than a command. There’s some truth in this. Be careful not to get too much used to prolog, though. At some point it ruins your skills in procedural/imperative languages. I noticed this recently. I fail in rather simple tasks, when I…

Ann: SWI-Prolog 10.1.16

Dear SWI-Prolog user, SWI-Prolog 10.1.16 is ready for download. This version comes with a lot of fixes, notably for comparing cyclic terms, tabling and CLP(Q,R). Highlights: Core Standard order of terms and cyclic terms. compare/3 on cyclic terms could give a different order depending on how the terms are shared. This is now fixed where possible. Some cyclic terms, however, have no standard order. The new Prolog flag incomparable can be set to error to make compare/3, sort/2, etc. raise an…

Working on new sCASP implementation. Can you share programs?

I’m working on a new implementation for sCASP, for now called ssCASP (s is the successor symbol ). This is work mostly done with Claude code. Current status: Built a pretty extensive test set of small programs as well as random programs with a simple (slow) oracle. This process found quite a few minor quirks in the current implementation that are fixed. Started a fresh implementation: Completely from scratch, based on the design analysis of the old code and the literature. It compiles sCASP…

Undecidable order (some cyclic terms)

A reported bug on standard order for cyclic terms (#1529) made it free to detect cyclic terms that have no defined order. As a result, SWI-Prolog now has a flag incomparable that can be set to arbitrary (default, old behaviour, i.e., different representation leads to different results and transitivity is not guaranteed) and error, raising representation_error(standard_order(Sub1, Sub2)), where the culprits are the cycles that cause the problem. So, now we get 102 ?-…

Generating SWI-Prolog code with GPT-6 Astra

In December 2025, I posted about finding that Claude Code could generate SWI-Prolog code. I’ve now had experience generating SWI-Prolog code with OpenAI’s GPT-6 Astra as well. The code I’m working with goes beyond typical textbook examples, though it’s still well short of the complexity of a full library. This isn’t a recommendation to switch tools—just sharing another experience that may interest people here, in the same spirit as my earlier post about Claude Code. Update Introducing GPT‑6 Sol…

How to generate full doc files of a project?

I tried using doc_save(., []), but it does not generate separate pages for predicates, while still generating the respective hrefs in index.html. Suppose I have a prolog file test.pl I want to have a documentation for, %! win is det. % % win is always true. win. %! зрада is det. % % зрада завжди заврешується невдачею. зрада :- !, fail. I run swipl -g '[test], doc_save(., []), halt.' which generates a bunch of files in doc/, including index.html and test.html. The problem is that it does not…

Instability of standard order

The discussion has been here before: standard order of terms is complete (except cyclic terms ), but unstable, i.e., X @< a, X = b succeeds, but a @< b rather than a @> b. I wonder whether we should have a variant of compare/3 that fixes this. I see two sensible behaviours: a compare/3 variant that raises an instantiation exception and one that tells us which comparison decides. The implementation of compare/3 at some point stumbles on a variable. That means we cannot decide (unless the other…

Can't start SWI IDE from daily build for windows

As the title says: I can’t start the SWI-Prolog IDE from the daily build for windows. I tried with today’s binary (21/09/26) and the earliest available one (13/09/26) and both fail to start the IDE. More precisely, double-clicking on the swipl-win.exe or calling it from the command line does nothing. I don’t see a swirly working icon and there’s no swi process created in the task manager. I tried running it as administrator but nothing changes. I can start swipl.exe on the command line…

Jev, Prolog, Pi, and the dream of probabilistic logic programming

Hi all, Jev, a new model (not an LLM, bit rather a modern version of BERT), has been making the rounds on the usual outlets these past few days. As I believe the core concepts of Jev map very neatly onto Prolog predicates, I’ve decided to integrate it into DeepClause (a runtime and SDK built on top of SWI-Prolog to combine LLMs/Agents and Prolog in a small DSL). The write-up can be found here. If there are people in this forum working on probabilistic logic programming, then I’d be very curious…

Term_factorized, term_minimal, term_automaton, automaton_minimal

I’m looking through the documentation trying to understand the following predicates: term_factorized/3 and term_factorized/4 term_minimal/2 term_automaton/2 automaton_minimal/2 and automaton_minimal/3 But I have to be honest I don’t understand what the documentation is trying to say. I can see what e.g. term_factorized/3 does (it replaces unifying sub-terms with a variable) but I don’t know why this predicate exists, for example, what is a typical use-case? [EDIT: I initially thought…

Ann: SWI-Prolog 10.1.15

Dear SWI-Prolog user, SWI-Prolog 10.1.15 is ready for download. This version comes with a lot of enhancements. Highlights: Core Make library(persistency) recover from an incomplete last term if it crashes hard while writing or the device was full. Attaching used to fail. Now it truncates the file to the last correct term and issues a warning. More reliable detection that a .qlf file is out of date. We now do a quick filter on time. If that is not decisive we compare a content hash. Cyclic term…