3 ms·
I've been told Prolog is used quite a lot by financial institutions. In fact, one of them bought a whole Prolog company (I forgot the name, sorry). I agree pro
by jkbyc 14y ago
I've been told Prolog is used quite a lot by financial institutions. In fact, one of them bought a whole Prolog company (I forgot the name, sorry).
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.aspx http://www.experianplc.com/news/company-news/2005/25-10-2005...
- aidos 14y agoI haven't used Prolog for about 10 years (and then only used it at uni) - this is my memory of it too. You could specify the rules for your problem very succinctly and naturally but the devil was in the detail. You'd spend all your time making sure the ordering and cuts were right - which at the time felt non-intuitive (though maybe now with more software experience it would be easier). 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
- AYBABTME 14y agoJust finished a 2 months module on Prolog in my 'Programming Paradigm' course. 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.
- yaantc 14y agoI'm not sure you can avoid the dependency on the rules order, and having to understand how the Prolog engine works. But I found there is a rather intuitive way to deal with it: think of the Prolog engine as searching a space of possibilities for a goal (expressed by the rules). Then you must order the rules to narrow the search space as quickly as possible. In other words, try to make the first rules as selective as possible to quickly reduce the search space. 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.
- fusiongyro 14y agoI like to think of Prolog as an "intellectual diversion."
- fusiongyro 14y agoIt's hard to use Prolog without understanding its evaluation strategy, but what trips up beginners coming from other programming language is mostly getting the declarative reading correct. Ordering effects are not, in my experience, all that counter-intuitive, but Mercury removed multiple clauses to solve this problem. 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++.