Considering the 4th edition of "Expert Systems: Principles and Programming" (The original book on CLIPS) is going for $300 at amazon, you are offering a good alternative.
I worked with Gary Riley and Joe Giarratano at JSC in the mid 80s when CLIPS was in heavy development. Joe had the unique ability to teach very technical topics with a special brand of humor.
Knowing CLIPs got me my first job in Silicon Valley / Los Altos in '88. Thanks Gary!
The only way I've found to back up the claims: try to prove them myself :)
or at least attempt to. I'm fairly convinced CLIPS is an unexplored middle-ground answer to conversations around "does our company really need AI/ML? SQL is enough."
I also see CLIPS as a declarative abstraction around our classic imperative CRUD applications. It exposes abstract concepts within the language that we end up implementing ourselves, like application caches (working memory), pattern matchers (LHS of Rules), and permission systems (in CLIPS, the object-oriented concepts known as "COOL" list User as a separate object inheritance chain from the other objects).
Consider PostgreSQL, a popular database that one could consider a Rules Engine:
1. records stored in tables can be implemented with facts in working memory
2. constraints, foreign keys, views, and other abstractions that come with RDBMSs which we slowly replicate within our application layer over time can be implemented with defrules
3. and you can even add "Rules" (https://www.postgresql.org/docs/current/sql-createrule.html) proper in psql
From this, we could conclude PostgreSQL is an example of an application you can build with a rules engine. However, the ambitions of CLIPS is to be a tool used for creating "Expert Systems." Whenever I bring up that term with other people, I'm met with:
1. blank stares
2. scoffs
regardless of their profession.
However, I argue that ChatGPT and other AI/ML chat bots are highly advanced "jack of all trade" Expert Systems. I also argue that some very successful web applications, such as the Pennie Pennsylvania health insurance application and TurboTax are "specific" Expert Systems. In all of these systems, you interact with someone who is the "expert" and can carry a "conversation" on the topic you specify.
We already use imperative programming languages that query remote databases specifically written to store data. I think Rules Engines (CLIPS) is "low hanging fruit" because, at its core, it's "lower level" than an RDBMS in terms of abstractions provided to the developer, but the implementation of the algorithm that interprets CLIPS code is closer inline with AI/ML. ie: neural networks are built based on inferred rules from the data they're trained on. Rete networks are built based on explicitly defined Rules by the developer. Thus, CLIPS is sort-of like having a formal language for interacting with a simplified neural network.
I hope my efforts are reaching developers on teams who have reached the point in their product's life when CLIPS "would have been a good idea to start with."
The difficult part: forgoing the temptation to reason "we don't need to use Foo, our product doesn't need all of that."
If any of the above resonates with you, I encourage you to read the CLIPS documentation and try to build something fun with it. You might be surprised at what you learn.
I’ve worked on systems that manage risk, and we had two pieces:
- A statistical model for probability of default
- A rule-based model implementing a policy, taking into account the probability and other signals not captured in the probability
Not everything could be incorporated into the probability, so this was a nice way of having a hand-crafted decision tree. Also, we could tune it eventually, much easier than training and validating a new statistical model.
You bring up something awesome about CLIPS: it's easy to tailor it to your needs. Once you have your CLIPS code, you can trim out the parts you don't need using compiler flags. Once you have a compiled `clips` binary with only the constructs you need (defrules and deffacts, maybe?), you can execute it, load your rules/facts into the engine, and then generate C code for your specific rules engine. This compiles into an even smaller/faster binary. You can do all of this from within CLIPS proper. Check out the Advanced Progamming Guide section 11: Creating a CLIPS Run-time Program https://www.clipsrules.net/documentation/v641/apg641.pdf
Rate has been a secret sauce for a long time. Only described in an out of print magazine or very expensive books.
Today the open articles about it are much better. But for awhile, it was elusive.
One of the big advantages of Rete is the culling of the rule base that needs to be evaluated based on the working/changed data set. If you have a 1000 rules, and assert “age=35”, Rete will only select those rules that deal with age, for example.
I’ve been on several projects where a rules system was appropriate, but they never really needed more that a few hundred rules. So we just wrote simple engines that would take a soup of expressions, and keep running through them until the working set stopped changing.
There was a lot of expressiveness with the rules, making development much simpler, and it was fast enough to brute force its way through the rule space and get the results.
Larger rulesets or deeper ones (where there are a lot of derivative rules based on previous rule results) can certainly warrant the complexities of a full boat Rete system.
But a simple system can take you quite a long way on modern hardware.
Big fan of CLIPS! Rule based expert systems are so ubiquitous in business and scientific codes, yet a lot of devs are not even familiar with pattern matching let alone powerful rules engines like CLIPS.
This has been similar to my experience. Rules Engines like CLIPS are just outside of the bounds of "cheap enough to spend time learning on the off-chance it is indeed better than what we've already written."
I'll admit, even as a programmer who's tried a lot of languages, I know a lot more about logic program and unification-based languages – and nothing practical about expert systems and their core algorithms.
I may download everything again and see if I can get the test scenarios running with modern Java. I am so out of date with Java though - what's the accepted best version to run things with now that Oracle has made the license so eyepoppingly evil?
Not to self-promote too much, but the main focus of my programming efforts is currently CLIPS. Over the past few years, I've written articles about and even made some fun projects with CLIPS:
Is it possible to make a reasonable rules engine in Ruby rather than a "bolt-on" (separate rules language files)? I think its interesting that its the LISP languages that spawned rules-engines, and as far as I've seen, the only language that can produce a reasonable rules engine as an API library.
The precursor to CLIPS was called ART Inference and was a large commercial & very expensive Expert System development tool, written in Common Lisp. Unfortunately it seems to be lost - I haven't seen anything about it for several decades.
Other than that there are a bunch of rule-based systems in Common Lisp.
For example LispWorks Enterprise includes "KnowledgeWorks", which features a forward chainer based on the RETE algorithm.
I just made CLIPSockets public, which is a culmination of learning I've taken from trying to make web applications using primarily CLIPS. Thought I'd bump it here:
Close on how Maclisp/Macsyma or CL/Maxima did integration/differentiation.
Also, a chapter of Paradigms of Artificial Intelligence.
OFC, writting a CLIPS parser under CL would be trivial.
MTG Arena, the new digital client for the Magic the Gathering trading-card game, uses CLIPS to implement the actual game-rules based on the English text of the cards. Magic cards are written using a very standardized language (look at custom-card communities and discussions around "templating"), but the fact that they've had such success with this approach is incredibly impressive to me.
It also leads to some really funny bugs that arise from grammar ambiguities - things like a card that says "[...] then put them into your hand" and the game losing track of what "them" refers to and putting _all_ the cards into your hand.
Holy moly. I had my suspicions Magic would be a good candidate for something like CLIPS when it comes to software implementation. Do you have a source for that info? What an amazing bug.
The source for them using CLIPS is a conversation I had with Arena team lead Ian Adams in a Magic-community Discord.
The source for the bug is a video WotC did that I can't find right now that featured the Arena team talking about developing Kaldheim - the bug came from the card Alrund, God of the Cosmos.
> So first, a quick summary of how the rules engine works. When a game of Magic is in progress on MTG Arena, the program that is tracking the state of the game and enforcing all the rules-correct card interactions is called the Game Rules Engine (GRE). It's one of the two main programs that we work on. It's written in a combination of C++ and a language called CLIPS, which is a variant of LISP.
There is also Drools, another major Rete based open source rule engine. It is based on Java so its bit easier to work with for non-specialized developers, although it also inherits many downsides from Java too
I worked with Gary Riley and Joe Giarratano at JSC in the mid 80s when CLIPS was in heavy development. Joe had the unique ability to teach very technical topics with a special brand of humor.
Knowing CLIPs got me my first job in Silicon Valley / Los Altos in '88. Thanks Gary!