4 ms·
Rules engines are about forward chaining (fan-out of all implications) whereas prolog is backward chaining (querying an implication). CHR (constraint handling
by overlords 8y ago
Rules 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.