Many time a programmer will be faced with a problem which solution is to collect a set of facts and ask arbitrary questions against those. Unless one has had some exposure with prolog, one may not recognize this problem and may start designing a custom inferior system, either from scratch or based on unfit tech.
Real life example:
I worked once for a very respectable company where we had been given the project of devising a system that would assess the trustworthiness of accesses to some sensitive application based on a ever expanding set of data collected about users, their devices, locations, and so on. We wanted the rules governing access to be defined and refined with time by the security department. So I thought that would be a good fit for some prolog-like database and looked for one; and I could actually find one that checked all the boxes: usable as a library from C++, could update the dataset and the rules without interruption, compiled the queries down to machine code to withstand our gazillions of queries-per-secs, developed indoors (to counter the NIH syndrome), and instead of FALSE the lib would also return some metadata that could be used to produce a meaningful error message.
A prototype was build in 2 weeks or so, involving 1.5 person, one of which had never used prolog before. Had never used it but knew about it. Otherwise, you can be certain that a very different path would have been taken: to hire a whole team of engineers to develop from scratch and for a very long time their very own capability system/data storage system/error reporting system that would have been less flexible and much slower, required restart for reconfiguration, etc.
You can be certain of it because that's the path the company actually decided to follow, to the great benefit of those involved, who've all been rewarded with a promotion for such an undertaking :-)
Edit: Found some relevant threads and links: https://news.ycombinator.com/item?id=9248107 https://www.youtube.com/watch?v=G_eYTctGZw8
Rolling back, as a declarative language in the database abstraction, the programmer can run queries with verbs that model the domain instead of SQL's generic WHERE, FROM, SELECT, etc. The price is that all facts have only three parts...like RDF [1] so maybe the programmer comes out ahead on design of the data relations.
Not all workloads are close to read-only databases. But some are, and Prolog allows writing such programs without the low level abstractions of the relational model using higher level DSL's.
[1]: https://en.wikipedia.org/wiki/Resource_Description_Framework
Prolog "facts" can have any number of arguments. The only way I can think of reconciling Prolog facts with your comment about "only three parts ... like RDF" is that Prolog facts are first-order predicates which consist of a predicate symbol, a vector of arguments and a pair of enclosing parentheses. Is that what you meant?
Paper covers Rock
Rock crushes Scissors
Scissors cut Paper
In Prolog we might encode that: wins(paper, rock).
wins(rock, scissors).
wins(scissors, paper).
loses(X,Y) :- wins(Y,X)
Relational databases are good for storing context-free facts. In table T, the interpretation of row R1 is independent of the contents of row R2.A practical real-life scenario for Prolog might be a "help wizard." The next step depends on what steps we have already tried (and not tried) and other kinds of state. The next step can be expressed as a Horn Clauses.
X /\ Y /\ NOT Z -> Z
NOT B /\ NOT W /\ X /\ Z /\ A /\ Q -> M
etc.
If the Prolog and the Horn Clauses look a bit like regular grammars, writing compilers is another area where Prolog has been applied historically. The first version of Erlang is an example, and some of Erang's design made more sense to me after learning a little bit of Prolog. But I am into learning mostly useless subjects.More than 200 million airline bookings, 850 million total (travel and hotel) bookings per year. They are known to run their airline reservation system on Sicstus Prolog, though I don't know how well that is publicly documented in writing.
To me, that variation is implicit within such a question.
Edit: I'm reasoning from the HN comment guidelines [0]: "Please respond to the strongest plausible interpretation of what someone says, not a weaker one that's easier to criticize. Assume good faith."
This guideline is in fact a restatement of one of the fundamental principles of reasoned discourse, the principle of charity [1]
I have to ask- like what? Are we talking about the next javascript framework, here, or about, I don't know, modal logics or category theory?
I know a guy who got an internship at ARM during a PhD in modal logic, so, far as I can tell, modal logic is both intellectually engaging and also practical, as in useful, in practice (to be blunt: to land you a job). Is that what you are talking about?
Generally though I think it's fair to interpret any question of "why should I bother learning X" not as a statement that nothing should be learned unless there's a direct benefit, but instead as the question "what are the practical applications of X". I think most people here would agree that learning for learning's sake can be fruitful & rewarding, so there's no reason to assume otherwise in response so such a question.
Maybe they prefer to learn through building something. Maybe they're working on something and are interested to know if Prolog could help them with their project.