AI Algorithms, Data Structures, and Idioms in Prolog, Lisp, and Java [pdf]
wps.aw.com
wps.aw.com
Prolog is also a very good example of the power of the unification algorithm. Unification is also used in e.g. type inference algorithms in programming languages like ML or Haskell.
Prolog is also homoiconic ("code is data", like Lisp) so it's very well suited for doing experiments in languages. A commonly used example is to create a Prolog dialect with fuzzy logic semantics.
Finally, while you might never get a chance to use Prolog in your day job, it's a programming language that will expand your horizons and learning it will, in my opinion, make you a better programmer.
I agree prolog is quite simple and nice but that is true mostly for the pure prolog subset. The actual programming language with cuts and all the complexity is not so simple anymore - it's not purely declarative (e.g. semantics of the program depends on the order of the clauses).
EDIT: it is Experian (a credit analysis company) that bought Prologia, the Prolog company that was founded by Alain Colmerauer, who designed and implemented the first version of Prolog.
http://www.experianplc.com/news/company-news/2005/25-10-2005...
The actual language certainly does have a lot of complexity and mastery depends on understanding it, but this isn't really all that different from other systems, it just presents a very early stumbling block to seasoned programmers. You could still stuff fifteen Prolog's worth of complexity into C++.
Isn't there some alternative varient where the ordering of the rules don't matter? (if that's even possible)
Edit: not to put people off - all alternative software paradigms are worth experimenting with
That's how you can get fast Prolog programs. But you have to be careful. It's been a long time since I played with Prolog, but I remember a case where reordering two lines would make the solution reached below 1 second from over 15 minutes. That kind of thing is part of the charm and frustration of Prolog. It can be a nice brain teaser.
It's true that in the basics, it's very simple... but it quickly becomes very complex and twisted as soon as you try to do something non-trivial. Also, the 'cut' operator surely doesn't help in keeping things understandable!
To 'learn' Prolog was a fun experience but honestly I'm glad we switched to something new (scheme), I was getting tired of it. My conclusion is that Prolog is quite good at building expert-systems (duh) but for anything more usual, it's too hard to comprehend.
The relation between Prolog, Datalog and the "Datalog-like" query language used by Datomic is still not clear at all to me but hopefully soon the picture shall get clearer.
I know it's OT but that's what I really like about Clojure: Clojure taught me about Lisp (even if it's not a 100% pure Lisp), functional programming (even if it's not 100% purely functional), lazyness, monads (yup, really) and now it's probably going to introduce me, thanks to Datomic, to Datalog...
Datalog is really almost just a special syntax for Horn-clauses; it is purely declarative. Prolog is much more than that in that it adds features like cuts, arithmetic, built-in functions, and everything else that's needed in a practical programming language.
Also, a Prolog interpreter implements a sophisticated backward-chaining algorithm. So Prolog basically means backward-chaining. In comparison, I would say there is no default evaluation strategy for Datalog. You (resp. the interpreter) can use backward-chaining, forward-chaining, a combination of both (such as the magic-sets method) - the designer of the Datalog-based query language decides what's best.
Thanks for sharing!
[1] - http://ciao-lang.org/
i have been bitten by the AI bug.
A highly recommended book is The Art of Prolog, the "PAIP" of Prolog. But unlike PAIP I have managed only a chapter or two, though it's on my list of "to reads" ;-)