19 comments

[ 8.6 ms ] story [ 1501 ms ] thread
If anyone is interested in learning Prolog I can recommend two very good Prolog books: The Power of Prolog (from the author of the video)[1] and Simply Logical: Intelligent Reasoning by Example[2]. I also recommend visiting the Awesome Prolog list[3]. Worth checking also interesting extension of the Prolog - Probabilistic Prolog, aka ProbLog[4]. And modern ISO-compatible implementation in Rust language - Scryer Prolog[5].

[1] https://www.metalevel.at/prolog

[2] https://book.simply-logical.space/

[3] https://github.com/klaussinani/awesome-prolog

[4] https://github.com/ML-KULeuven/problog

[5] https://github.com/mthom/scryer-prolog

Thanks for sharing those resources. With both of the books having online versions, I can easily share them with people interested in logic programming in general and Prolog in specific.
I would be gladly writing a lot of stuff in a Prolog-like language if there was a dialect that separated rule construction from traversal manipulation. This is such an obvious thing. I should be able to construct a set of rules and then say "but this time, ignore this branch" (without changing the tree with cuts). Or something like "do depth-first for up to 1000 levels and give me the incomplete set of answers".

In SQL you don't change the database simply because you want to run a different query. You manipulate the query, the indices and the query hints.

In fact, you can do this with Prolog already, however, you have restrict yourself to the pure monotonic subset. Many parts of Prolog the do not fit can be replaced by purer counterparts. See library(si), library(reif), library(clpz) for such attempts.
I'm quite happy with picat, which supports traditional if and loops. It's also fast and supports some solvers, recursive backtracking is optional.

Skipping an expr by cut is in every prolog, but loops not.

You could try datalog with your own parser. Personally I feel like their is a need for a new industry standard language that lets you encode assertions with either a boolean or a probability.
Does anyone have any stories of how they used Prolog in production to solve an interesting business problem ?
Lots of robotics startups are using prolog for planning.
I'm very curious about the recent practical applications of prolog, do you have a link to any of these startups' websites or an article commenting about such applications?
Off the top of my head, magazino.eu and knowrob.org
I do not use prolog in production, but I frequently use ideas from prolog (program with constraints and a solver) in other languages
Not exactly a business problem, but I heard that a Prolog-like approach works very well for a type inference system.
Idk if this qualifies as "in production", but the JavaScript package manager Yarn (version 2) and its users use Prolog to define rules for their dependencies. Like if you have submodules A and B and both depend on package C, you may use Prolog to constrain that both A and B must always use the same version of C and updating C must be done in both packages.

https://yarnpkg.com/features/constraints

I've seen a bit of Prolog in the wild, but never got deep into it. Syntactically it reminds me of Erlang. Are they at all similar?
Early Erlang was based on prolog.
More specifically, the first Erlang compiler was written in prolog, and it inherited a lot of its syntax and some of its features.