This all makes perfect sense. The gap I usually have - and I admit its probably something of a skill issue, I have relatively little formal CS background - is how these abstract declarations of rules are integrated into a product. The example code in projects like this is usually pretty dense and intangible.
Does anyone have good examples of open source codebases or reading material in this area? Lets imagine I have a set of complex business rules about the way a product can be configured and I want to use a logic programming language to enforce them, called from a web interface based on config data stored in a traditional relational database. Is that... a misunderstanding of how these things are to be used?
I've love a good book about how to bring tools and techniques for logical correctness into a Rails ecosystem... or similar language/framework for app dev. I love the promises many of logic languages make but can't rewrite existing applications in them wholesale and it seems like they're a poor fit for that anyways. How are people blending these worlds at large enterprises? Maybe the answer is that nobody really is yet, and thats what makes things like Clolog + Clojure so exciting?
FWIW I have no formal CS background whatsoever (maybe you shouldn't even listen to me on this matter), but if you want to gain some understanding of rule engines, you probably shouldn't start with core.logic or clolog (I have not looked into this project myself just yet, so my assumptions might be completely misleading) - core.logic imo good for complex constrains and relationships, it's based on miniKanren, but has quite steep learning curve, and not sure if it's worth the effort (as a starting point).
oakes/odoyle-rules is a forward-chaining rules engine with a more straightforward approach - for someone already familiar with Clojure, it should be fun to try out. Then maybe check out Clara Rules, if I'm not mistaken the lib is specifically designed for business rules processing. For understanding the theoretical pieces, you probably want to look into forward vs. backward chaining rule systems; pattern matching used in rules engines; understanding how to model domain rules declaratively; Rete algorithm (odoyle lib explains it and iirc links to the paper).
Great comments, thank you for taking the time to mentor a few interested strangers.
Awww, thank you. As a Clojurian, I aspire to be kind and helpful. The Clojure community is renowned for its friendly, coaching-oriented attitude. Anyone with questions (even those unrelated to Clojure) should absolutely reach out to Clojuristas — just go to http://clojurians.net and don't be shy.
I'm forever thankful for Clojure for reigniting my passion for programming, but particularly, I'm indebted to the many individuals in the Clojure community. Whenever I pose a question expecting just straightforward guidance or documentation links, I consistently receive profound, thought-provoking answers that surpass my expectations. Virtually every discussion I initiate with them ends up being incredibly educational, teaching me far more than I initially sought. I can confidently admit - yes, learning Clojure has made a better programmer out of me, but most importantly, it made me a better person.
There are lots of good Prolog books available, many from the 1980s now released freely in PDF form. I would suggest starting there. IMO, Prolog is definitely worth understanding, but I personally tend to desire a Prolog available as an embedded resource in another language. So, Clolog is great for Clojure programmers, of which I am one, for instance. I find that Prolog excels for certain types of programming, but while it’s Turing complete, and thus capable of doing anything any other language can do, it can get cumbersome for other types of programming. So, I like to think of logic programming similar to the way that I think of a SAT solver, something that I call out to in order to solve a problem, but then it returns the answer to the main program which presents that answer to the user using the host language.
The classic books can be a bit rough on the newbie, I'd recommend slogging through Triska's site and trying stuff out in Scryer, SWI or Tau first.