3 ms·
I ask this seriously. Does it make more practical sense to learn a modern business rule engine (like JBOSS BRMS) than to learn Prolog?
by jayd16 8y ago
I ask this seriously. Does it make more practical sense to learn a modern business rule engine (like JBOSS BRMS) than to learn Prolog?
- overlords 8y agoRules engines are about forward chaining (fan-out of all implications) whereas prolog is backward chaining (querying an implication). CHR (constraint handling rules) is a forward chaining system built into most prologs that has prolog like syntax, and so is a replacement for business rules engines. So the choice of what to use is based on that (if you want forward chaining - business rules, or CHR of prolog), if you want backward chaining (similar to SQL) then prolog. Prolog is more elegant than the business rules engines, and also has extra features (constraint programming with finite domains for example), that business rules don't have. So in short, prolog is more comprehensive and more elegant but requires more expertise, busines rules are for "untrained" people to get working with relatively quickly.
- pgtan 8y agoI went from logic puzzles to Prolog and the CLPFD lib was a great help to achieve results even as novice.
- segmondy 8y agoBuilding a forward chaining rule in Prolog is trivial. Here's an example in 25 lines https://www.cse.unsw.edu.au/~billw/cs9414/notes/kr/rules/forward.pro https://www.cse.unsw.edu.au/~billw/cs9414/notes/kr/rules/for... Allows for rules such as iF problem_in_kitchen and no_water_from_outside then leak_in_kitchen.
- garmaine 8y agoIf you are actually interested in learning and understanding, rather than just blinding following stack overflow procedures to solve instances of templated problems, then I would highly recommend a simpler language like Prolog, a theory-oriented text like the Art of Prolog.
- tannhaeuser 8y agoProlog is a standardized programming language for doing backward chaining with multiple mature implementations eg. you can ask for solutions to discrete graph search and other predicate logic problems as described in TAOP book. Prolog is also used for implementing more advanced/complete logics than just resolution with negation-as-failure such as various description logics. "Business rule management system" such as Drools do multiple things, but are understood to perform mostly forward chaining based on RETE where you assert some facts and rules and the BRMS evaluates all logical consequences (unlike Prolog where you ask for a particular goal). BRMSs aren't standardized; the closest to a standard would be IF ... THEN ... rules using OPS5-heritage syntax (OPS5 was an "expert system" during the original AI spring followed by the infamous "AI Winter" around 1988). But the matter of the fact is Drools and other BRMs don't use interchangeable syntax and engines. Drools in particular is a Java-/maven-/XML-heavy solution sold to enterprises so that "business can define accounting/rating or other business rules" themselves. If that sounds like too good to be true, you're right. The Drools-based apps I've encountered are usually written and maintained by developers rather than mythical "business users", and apart from being in need of maintenance because no-one wants to develop using Drools also lack basic testing and other engineering discipline so become a PITA in any modern test-driven environment. TLDR: learn Prolog