Building a Better Rule System.
Jess is way cool. I love what Ernest has built, and working with it can be a lot of fun. The thing is, everything can be improved upon! I do wonder how different his algorithms are from the classic Rete algorithm...it appears that he's put a lot of optimization into it.
Optimizing the engine isn't the only thing, though. When programs get bigger and bigger, you need a more effective environment. Here's what I'd do if I was building a rule-based system in Java, from something a little closer to scratch.
First, I'd start with SISC as my interpeter. It's a fast, full Scheme interpreter. CLIPS is great and all that, but you can simulate the rule stuff pretty closely with Scheme macros, and then, well, you have the entire Scheme language at your disposal. There's far more general purpose programming power there, and lots of libraries and other good stuff.
Second, I'd start with CLIPS, but based on my experience I'd continue the modifications that Jess makes. Specifically, when writing larger rule systems, you need to use inheritance and combination across rules, as well as across fact types. I want to be able to make one rule inherit from another (specialize it further), or include one rule definition in another. This provides for an extremely good means of tightening up and parameterizing rule definitions. Substantial portions of my rule systems would disappear if I had this facility.
Third, I'd generalize from Rete to Gator, but have a Rete network builder as the default. Open the language up so that the network can be directly specified in the rules and source code -- you can target where you want your nodes, where you want your memories, and so forth. Nodes become elements that can be manipulated.
Fourth, provide a comprehensive graphical framework for visualizing the network and its state, based on the Piccolo framework.
Fifth, provide complete support for multiple networks, but permit the sharing of facts between them, to optimize storage. This provides the capability to run multiple logical systems in parallel on the same knowledge base.
Sixth, ensure that facts don't have to be present in the system -- create a virtualization that permits extremely large knowledge bases to play.
Seventh, ensure that there is a complete Java API for constructing and executing all of the above.
That's how I'd go about it. The end result would be pretty badass.
10:05:06 PM
|