by ditonal · 11y ago · 0 comments
The most obvious use case is when you have some sort of list of rules or constraint satisfaction problem.
Gerrit uses its for that use case: https://gerrit-review.googlesource.com/Documentation/prolog-...
One of my college professors has a language that's heavily influenced by Prolog and designed to solve NLP problems called Dyna (I think because many NLP parsing problems can be solved by dynamic programing approaches that logic programs can easily express and optimize for).
I actually think the real reason we don't see more Prolog or Prolog-like languages is not because they are bad approaches, but because it's relatively easy to make your own half-baked constraint satisfaction backtracking solver in a language like Python, and then write rules for it to evaluate, so smart people just write it that way rather than busting out Prolog.
Another reason is that you can directly express unification grammars in Prolog e.g., see definite clause grammar:
https://en.wikipedia.org/wiki/Definite_clause_grammar
During my PhD I worked on a parser/generator for Dutch at the University of Groningen, which is written in a mix of Prolog, C, and C++:
The corollary to Greenspun's tenth rule in action, I guess. =)
Same thing for chart parsing in Prolog. When you get backtracking and unification for free, implementing a parser is simple ;).