A book of ideas and proposals for the future of Prolog

Hi all,

This is my first message in this forum, and since I am not a central figure in the Prolog community, I should probably begin with a brief introduction.

My name is Torbjörn Lager. I am professor emeritus of general and computational linguistics at the University of Gothenburg. I have worked with computational linguistics, dialogue systems, web technologies, and related matters for many years. I have also had a long-standing interest in Prolog, although I have always been somewhat of an outsider to the main Prolog and logic programming communities. (Unfortunately, Chalmers here in Gothenburg is a FP stronghold, with little interest in LP.)

For almost fifteen years, on and off, I have been working on a book-length project called The Prolog Trinity ecosystem. The project is perhaps best described as a book of ideas, but it is not only that. It also comes with a fairly extensive online demonstrator and links to GitHub repositories containing prototype implementations. The current draft is about 350 pages long and introduces a proposal for three closely related things: Web Prolog, Prolog agents, and the Prolog Web.

In the book, these three together form what I call the Prolog Trinity ecosystem: Web Prolog as a profile of Prolog for web-based interaction, Prolog agents as logic-programmable actors, and the Prolog Web as a possible distributed environment in which such agents and nodes can interact.

The central technical idea is that Prolog could be given a web-facing profile that combines ordinary Prolog-style querying with Erlang-inspired concurrency and distribution. In such a setting, different Prolog systems could potentially communicate over the Web using a common interaction model, without requiring one Prolog system to become the Prolog system.

So one part of the proposal is a concurrent interface, inspired by Erlang, where Prolog actors have mailboxes, process identifiers, private clause databases, and communicate by message passing. These actors may live on different nodes, and the intention is that local and remote interaction should be made as uniform as is reasonably possible.

Another part is a sequential interface, where a node can query another node through something like rpc/2-3, with ordinary Prolog backtracking exposed across HTTP. In this view, backtracking can be understood as a form of pagination: a remote query may produce a stream of answers, but these answers can be requested incrementally by the client.

A third part is the broader architectural idea: a Prolog Web consisting of Prolog nodes that expose logic-driven services, can be queried by browsers and other web clients, and may host longer-lived Prolog agents. The idea is not that the Prolog Web should replace the existing Web, or the Semantic Web, but that it could become a small logic-oriented layer within the wider Web ecosystem.

To some extent, the project can also be read as a reaction to the discussions around the future of Prolog, including the 2022 article Fifty Years of Prolog and Beyond. I found that article valuable, but I also felt that Prolog needs more explicit long-range visions: not only better libraries, better tooling, and better portability, but also bolder architectural stories about what Prolog might become in a web-native, agent-oriented, AI-saturated world.

During the last five years, after retiring from my position at the University of Gothenburg, the project has grown from a rather speculative manuscript into something more concrete. For a long time I did not think I would be able to finish anything worth showing to others, but thanks in part to LLMs — mostly Claude, but also ChatGPT — I now believe I have something reasonably presentable.

The project homepage is here:

https://trinity.elfenbenstornet.se/

From there, one can find the book draft, a fairly comprehensive online demonstrator, and links to the relevant repositories.

I would be very grateful for thoughts, comments, criticism, or suggestions — especially from the perspective of Prolog implementers and experienced Prolog programmers.

I do not present this as finished work, and certainly not as the future of Prolog. It is a proposal, a prototype, and a provocation. But I hope it may be interesting to people who care about Prolog’s future — especially those who think that Prolog still has something important to contribute to the Web, to symbolic AI, and to the next generation of intelligent systems.

Best regards,
Torbjörn

2 Likes

Just to give my post about the Trinity a bump, I have written a blog post that I believe is suitable for a forum with system-independent discussions of all things Prolog.

Your Web Prolog is an interesting “counter culture”, given that
February 2026 saw a SaaS-Apocalypse, triggered by AI. It seems
$300 billion have been destroyed over a few months, even

the Adobe stocks dropped. Whats the problem? Rigid flows
and micro services could be dead. I am not sure whether a
Erlang inspired Prolog extension is the right thing.

I doubt any Logtalk 4.0 like system, which adds distribution,
will make any impact, even the Object Management Group
(OMG) with its agent ontology focus is practically dead.

Vertical AI might be more SWISH like, where big contexts
are shifted around. Like the temporary modules in SWISH,
that can be part of a request. On the surface it might look

like a switch to intention based requests, but better make
the big context a shared resource? An exampe of Vertical AI,
is CoCounsel by Reuters with a start to finish workflow

for law and underwriting. Also having Data Moats such as
Westlaw helps survive the shake out. Your teaching model
of Jupyter Style notebooks that can run Web Prolog is

interesting, this is a departure from the old web console
prototype you had. But CoCounsel by Reuters might also show
where UX is heading to, mostlikely live documents with

embedded AI, that understands a “do here” ?

This is a very impressive combination and implementation of Prolog with those other technologies. Would you like to have a conversation with our Prolog Education Group? We could record your presentation to be shared at: https://www.youtube.com/@LogicProgrammingEducation

Hi! Sure, I’d love to do that! So let’s agree about a date and time. And, if you can, let me know what aspects of my work you would be most interested in.

1 Like

Please, check your direct messages. Thank you