3 ms·
Prolog gives you nondeterminism. That is, it can take incomplete or inconsistent input and provide partial or multiple answers. That's not behavior you want ver
by wrp 15y ago
Prolog gives you nondeterminism. That is, it can take incomplete or inconsistent input and provide partial or multiple answers. That's not behavior you want very often, but when it is, who else you gonna call? The specific, unique features of Prolog are unification, backtracking, and logic variables.
People had high hopes for Prolog in the 1970s, but it proved to be a total disappointment. It was terribly slow and had a complicated performance model. These days, the niche for which Prolog is a good choice is very small. For combinatorial problems, Prolog has been superceded by extensions like Choco and Gecode and by easier and faster dedicated systems like Essence, Minion, and G12. Prolog is still sometimes chosen for small projects in constraint programming or text manipulation.
Be sure to read this article on how Prolog really works.
http://www.amzi.com/articles/prolog_under_the_hood.htm http://www.amzi.com/articles/prolog_under_the_hood.htm
- petervanroy 15y agoThat Prolog is slow and has a complicated performance model is the common wisdom, but both are completely wrong. For a better view of speed, you should look at my Ph.D. dissertation of 1990. It explains how to write a Prolog compiler whose run-time code efficiency rivals that of good C compilers. The two main ideas are global dataflow analysis and direct compilation to native code (no WAM bytecode). For a better view of the performance model, you should read Richard O'Keefe's book from 1990, The Craft of Prolog, which explains very well how to write beautiful and efficient Prolog code.