Expert systems are successfully applied to a number of domains. Often built on generic rule-based systems, they can also exploit optimized algorithms. On the other side, being based on loosely coupled components and peer to peer infrastructures for asynchronous messaging, multi-agent systems allow code mobility, adaptability, easy of deployment and reconfiguration, thus fitting distributed and dynamic environments. Also, they have good support for domain specific ontologies, an important feature when modelling human experts’ knowledge. The possibility of obtaining the best features of both technologies is concretely demonstrated by the integration of JBoss Rules, a rule engine efficiently implementing the Rete-OO algorithm, into JADE, a FIPA-compliant multi-agent system.
Expert systems are successfully applied to a number of domains. Often built on generic rule-based systems, they can also exploit optimized algorithms.
On the other side, being based on loosely coupled components and peer to peer infrastructures for asynchronous messaging, multi-agent systems allow code mobility, adaptability, easy of deployment and reconfiguration, thus fitting distributed and dynamic environments. Also, they have good support for domain specific ontologies, an important feature when modelling human experts’ knowledge.
The possibility of obtaining the best features of both technologies is concretely demonstrated by the integration of JBoss Rules, a rule engine efficiently implementing the Rete-OO algorithm, into JADE, a FIPA-compliant multi-agent system. (Figure 1)
Figure 1. Top
Basic example from the JBoss Rules handbook
The advantages of rule-based systems over procedural programming environments are well recognized and widely exploited, above all in the context of business applications. Working with rules helps keeping the logic separated from the application code: it can be modified by non-developers and, being centralized in one point, it can be analyzed and validated. Rule engines are often well optimized, being able to efficiently reduce the number of rules to match against the updated knowledge base.
Rule-based systems can also be augmented with ideas and techniques developed in other research fields, leading for example to fuzzy rule-based systems, which exploit fuzzy logic to deal with imprecision and uncertainty about the knowledge base. Moreover, sometimes these systems are coupled with genetic algorithms and evolutionary programming to generate complex classifiers.
One of the most notable application of rule-based systems are expert systems, where the rule set is a representation of an expert’s knowledge. In such systems, the AI (Artificial Intelligence) is supposed to perform in a similar manner to the expert, when exposed to the same data.
Among the different mechanisms to implement a rule-engine, Rete algorithm (Forgy, 1982) has gained more and more popularity, mainly thanks to the high degree of optimization that can be obtained. At NASA Johnson Space Center, Rete algorithm was implemented in a whole generation of rule engines. OPS5 was soon replaced by its descendant, ART, and in 1984 by the more famous CLIPS.
Nowadays, one of the most widespread engines implementing Rete is Jess (Friedman-Hill, 2000), at first developed as a Java port of CLIPS at Sandia National Laboratories in late 1990s. Jess has also been widely adopted by the agent community to realize rule-based agent systems (Cardoso, 2007).
A different yet promising rule-engine is JBoss Rules (Proctor, Neale, Frandsen, Griffith & Tirelli, 2007), formerly Drools. It is a quite new, but already well known, freeware tool implementing so-called Rete-OO algorithm.
Its open-source availability is a clear advantage over Jess, but an even greater advantage is due to the implementation of a particular adaptation of the Rete algorithm for the object-oriented world, rather than a literal one. This way, the burden of integrating the rule-engine and application rules with existing external objects is greatly reduced. In fact, JBoss Rules uses plain Java objects to represent rules and facts, which can be modified through their public methods and properties. Rules can be specified through an appropriate syntax, or through xml structures, and their conditions and consequences can be expressed using different scripting languages, as Python, Groovy and Java. Instead Jess only accepts rules written in the CLIPS language, thus requiring developers to learn a new Lisp-like language and deploy additional efforts to adapt it to their object-oriented development environment.
Key Terms in this Chapter
Rule-Based System: Created using a set of assertions, which collectively form the “working memory”, a database which maintains data about current state or knowledge, a set of rules, specifying how to act on the assertion set, and a rule-engine or interpreter. Basically, rule-based systems can consisting of little more than a set of if-then statements, but provide the basis for so-called “expert systems”.
Ontology: An explicit specification of a conceptualization, formally describing the entities involved in a particular domain and the relationships among them.
Expert System: Encodes the knowledge of an expert into the rule set of a rule-based system. When exposed to the same data, the expert system AI will perform in a similar manner to the expert.
Authorization Certificate: A digital document that describes a permission from the issuer to use a service or a resource that the issuer controls or has access to use. Usually it is signed by means of a public key algorithm. The permission in some case can also be delegated.
Multi-Agent System: A software system based on the interaction of several agents. Such agents could not have all data or all resources needed to achieve an objective and need to collaborate with other agents. In this case, data is decentralized and execution is asynchronous. Earlier, related fields include Distributed Artificial Intelligence (DAI) and distributed problem solving (DPS).
Software Agent: A software entity being able to act with a certain degree of autonomy, in order to accomplish tasks on behalf of its user. While objects are defined in terms of methods and attributes, agents are defined in terms of their behaviours. Usually agents show persistence, autonomy, social ability, reactivity.
Production System (or production rule system): a rule-based system whose rules (termed productions) consist of two parts: a sensory precondition (or “if” statement) and an action (or “then”). If a production’s precondition (left-hand side or LHS) matches the current state of the world, then the production is said to be triggered. If a production’s action is executed, it is said to have fired. The rule interpreter must provide a mechanism for prioritizing productions when more than one is triggered. Rule interpreters generally execute a forward chaining algorithm for selecting productions to execute.