Lurker News
Hi, i am a compsci student that stumbled upon prolog and logic programming during my studies.

While i have seen the basics of vanilla prolog (atoms, predicates, cuts, lists and all that jazz) and a godawful implementation of an agent communication system that works on SICStus prolog. I would like to know more because i think that this language might be a powerhouse in per se.
Since my studies are quite basic in this regards i would like to expand my knowledge on it and kind of specialize myself both in this world and another world (ontologies :D) that i really enjoy.
What's prolog like in 2024? what are you wonderful people doing with it?
thanks from a dumbass :D

Comments (276) 60 threads

Earlier comments
hpincket#
I've played around with Prolog on and off for 7 years. Still a novice. It's one of those languages that forces your mind to grow in new directions.

It's difficult to make a case for it. The declarative paradigm is nice, but compared to other languages you're only saving a couple for-loops. I think its benefit comes from expressiveness for problems where clpfd can be applied. I once built an internal tool with Python and SWI Prolog that combined user input with CLPFD to configure test accounts in a consistent and useful way. Users could provide partial constraints, and the system would fill in the rest. Again, the ease of clpfd is great.
I've had some fun generating Prolog facts/databases with LLMs and it's something I want to explore more.
Note: I was just messing around with Prolog this week: https://hpincket.com/adding-an-easter-egg-to-our-numeronym-p...

honorious#
I have been interested in Prolog since my time at the University, and I loved the idea of logic programming.

For "proper" Prolog, in 2024 it is a niche language alive in specific constraint solving applications, but not really used outside of that. I haven't seen anyone attempting at using prolog as a general purpose language since the 90'.
Datalog and logic-inspired languages tend to pop up here and there as domain-specific languages.
Rego is a recent incarnation which had good adoption for k8s and other "modern" systems. However, when trying to get people in my org to adopt it in practice, I saw engineers struggle with the paradigm when complexity grows to more than toy problems.

sprayk#
The most recent prolog news I've come across in recent years is some updates to SWIprolog (can't find a good link) and some talk of Scryer-prolog[0] which is a more recent implementation of Prolog in Rust.

One interesting development recently is a load of research into, reverse engineering of and emulation of the 1986 Sega AI Computer[1], which used prolog under the hood for mostly educational software. Unfortunately it does not seem there is a way to actually write some prolog for the thing today :(
[0] https://github.com/mthom/scryer-prolog
[1] https://www.smspower.org/SegaAI/Index

tannhaeuser1 reply#
With compliments to your prof ;), interest in Prolog just now is recovering from a year-long focus on W3C's RDF/SPARQL. TBL surely had an itch to scratch with regards to logical knowledge representation dating back even longer than the web [1]. But Prolog has broader applicability not only in logical/knowledge graph querying, but also in solving all kinds of discrete combinatorical optimization problems. Or, as the Quantum Prolog site [2] puts it, "planning, optimization, diagnostics, and complex configuration." The site demos logistics optimization (in-browser demo) and reports initial optimization (parallelization) of Inductive Logic Programming and other ML tasks for partially auto-generating Prolog code from existing solutions.

Edit: ... and on performance vs SWI Prolog, too
[1]: https://en.wikipedia.org/wiki/ENQUIRE
[2]: https://quantumprolog.sgml.io

PaulHoule1 reply#
The problem w/ OWL is that everybody wants to work with first-order logic + math, but Gödel proved it isn't decidable.

For instance if I wanted to express financial regulations or business rules inside a bank or other business I'd need to use math: for instance to express the conditions for reserve requirements or approving a loan.
OWL is best thought of as a set of templates for generating first-order logic rules that are decidable and also (in theory) quick to evaluate with the Tableau algorithm.
In certain domains you might tolerate tools that are imperfect, like it isn't fair to expect a SMT solver to figure out this one

   x^N + y^N = z^N
where x,y,z and N are all positive integers with N>2. For that one it would try to find solutions and probably time out. For some similar problems (a different polynomial) it might give you an answer.

OWL doesn't want to go there which is a big reason people say "Nein Danke!"

kstrauser1 reply#
> Gödel proved it isn't decidable.

He did no such thing. He proved undecidable problems exist in any system powerful enough to be useful. That doesn’t make those systems useless, though.

PaulHoule#
The trouble is the creators of OWL wanted to have performance and reliability bounds. That is, they want to make systems that act like more like a conventional database server than an SMT solver.

I think they could have made a more expressive standard and something like that might have had more appeal to people but been less consistent in terms of performance.

Load more comments