Skip to main content
Top

2011 | OriginalPaper | Chapter

6. Rule Engine Technology

Authors : Mr. Jérôme Boyer, Prof. Hafedh Mili

Published in: Agile Business Rule Development

Publisher: Springer Berlin Heidelberg

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

Abstract

Target audience Developer (must); optional for anyone wishing to look under the hood In this chapter you will learn The history of rule-based decision making The principles of rule engines, and the implications of object-rule systems The basics of the RETE algorithm The different rule engine execution algorithms Key points Rule-based decision making has a long history and some cognitive plausibility. Rules are treated as data processed by an interpreter – the rule engine. In the production system ideal, the “intelligence” is in the rules as opposed to the control mechanism of the engine, which should remain simple. The JRules rule engine is a Java object that “reasons about” Java application objects. The RETE algorithm makes the production system paradigm computationally efficient. Decisions that do not require rule chaining can use simpler – and an order of magnitude faster – execution algorithms.

Dont have a licence yet? Then find out more about our products and how to get one now:

Springer Professional "Wirtschaft+Technik"

Online-Abonnement

Mit Springer Professional "Wirtschaft+Technik" erhalten Sie Zugriff auf:

  • über 102.000 Bücher
  • über 537 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Maschinenbau + Werkstoffe
  • Versicherung + Risiko

Jetzt Wissensvorsprung sichern!

Springer Professional "Technik"

Online-Abonnement

Mit Springer Professional "Technik" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 390 Zeitschriften

aus folgenden Fachgebieten:

  • Automobil + Motoren
  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Elektrotechnik + Elektronik
  • Energie + Nachhaltigkeit
  • Maschinenbau + Werkstoffe




 

Jetzt Wissensvorsprung sichern!

Springer Professional "Wirtschaft"

Online-Abonnement

Mit Springer Professional "Wirtschaft" erhalten Sie Zugriff auf:

  • über 67.000 Bücher
  • über 340 Zeitschriften

aus folgenden Fachgebieten:

  • Bauwesen + Immobilien
  • Business IT + Informatik
  • Finance + Banking
  • Management + Führung
  • Marketing + Vertrieb
  • Versicherung + Risiko




Jetzt Wissensvorsprung sichern!

Footnotes
1
Post did not call his contraption a “machine,” but called it “worker” or “problem solver” (see Emil Post, by Alasdair Urquhart, in Handbook of the History of Logic, vol 5: Logic from Russell to Church, eds Dov M. Gabbay and John Woods, Elsevier, Amsterdam, pp. 429–478).
 
2
Mathematically speaking, a neural network can be thought of as a special kind of numerical classifier. By varying the topology of the network and the behavior of the individual neurons/nodes, we get different mathematical behaviors (convergence, types of classes that can be identified/isolated, etc.).
 
3
Check http://​en.​wikipedia.​org/​wiki/​Groundhog_​Day for this North American folklore.
 
4
It also increases the cost of borrowing for companies, which cannot even expand in foreign markets, and it makes interest-bearing investment products more attractive than stocks, which further starves companies for capital, stunting their growth.
 
5
It is theoretically possible to develop a chess playing program that explores all of the legal moves to pick ones that lead to checkmates … the problem is there are over 1043 legal chess positions and it would take forever to explore them! AI researchers have developed approximate and smart search algorithms that explore only a few moves ahead (and hence, approximate) and that know how to focus on promising moves (hence smart). “Modern” chess playing programs also rely on a database of classical openings and end games.
 
6
The term “extraction” may be evocative of tooth extraction. Without the appropriate techniques, the process can indeed be as painful to both the expert and the knowledge engineer.
 
7
In RETE mode, the JRules rule engine is a true production system. However, in Sequential and Fastpath mode, the rule engine does not perform a full ruleset–database scan after each rule execution. More on the algorithms in Sect. 6.4.
 
8
JRules supports the so-called dynamic priorities, which are rule instance–specific priorities. More about this in Chap.​ 11 (see discussion about IRL).
 
9
This definition also maps nicely to logical formulas: if A, B, and C are predicates, condition strength corresponds to logical implication: ABC implies AB (ABC → AB) and BC (ABC → BC).
 
10
Sometimes called activation record of the caller.
 
11
One possible alternative to having to request a scan by explicitly calling the “update” is to instrument the code of the classes manipulated by the engine (e.g., the class Claim in our case) so that the engine is notified whenever some attribute is modified. This is the technique used by object-oriented databases, where persistent classes are instrumented so that whenever an attribute of a java object is modified, the object instance is “dirtied,” triggering a save at the end of the transaction. Such a solution would not work in our case for several reasons. First, this instrumentation would add processing overhead to all the instances of a class, whether they are manipulated by a rule engine or not. Second, it adds processing overhead to all object attributes, whether they have a bearing on rules or not. However, let the reader be assured: this explicit notification is transparent to business rule authors, as explained in Chap.​ 11.
 
12
Indeed, assume we have a rule that says “if there is no claim over 1,000 then do such.” If the working memory contains/references a claim worth 1,100, the rule will not match the current state of the working memory. If I remove that claim, the rule will match.
 
13
The IRL instruction “update ?myClaim;” has a Java API equivalent, which can be called from the Java calling context as in “myEngine.update(myClaim);”.
 
14
RETE is the name given to the original algorithm published by C. Forgy in his doctoral thesis. Subsequent enhancements, introduced by Forgy and others, have been dubbed RETE II and RETE II plus.
 
15
Actually, even object insertion can spawn negative tokens, if some rule contains a not condition. This will become clearer later in this chapter, and after we cover the IRL in Chap.​ 11.
 
16
The simplification consists of (a) treating all attributes as public data members and (b) implementing associations between objects through “foreign keys,” as opposed through direct object pointers (e.g., Claim “points” to the Policy via the data member “int policyNumber”), to illustrate more clearly joins. With regard to the public data members, we will see in Chap.​ 10 that JRules does indeed treat getters/setters as “bean properties.”
 
17
The fact that “rule layout” influences the topology of the RETE network may be used to squeeze out a (tiny) bit of performance. More on this in Chap.​ 13.
 
18
Namely, < any of {C1,C2,C3}, any of {P1, P2, P3}, PH2>.
 
19
Intellectually lazy rule authors may rely too heavily on rule priorities, as a mechanism for controlling rule execution, as opposed to relying on logical dependencies between rules.
 
20
The other part used to be documented in the product. Since JRules 5, it was felt that JRules users not only should not rely on other, but they should no longer even know what other is ☺.
 
21
ServiceAct represents an act (occurrence) of the service for which payment is claimed.
 
22
Two comments: (1) This JIT compilation is to be distinguished from the JIT compilations of Java virtual machines whereby Java bytecode is compiled into native machine code if it satisfies some criteria (e.g., frequent invocation, as is the case for Sun’s hotspot JVM). (2) The RETE mode also supports a compiled mode, whereby the ruleset is “parsed” off-line to generate java bytecode; we then talk about a compiled ruleset.
 
23
Luckily, there is a way around that: if the “quantifier” is “scoped” on something other than the working memory, the rule is OK (more information in Chap.​ 11 when we talk about the IRL, and in the product documentation). Thus, whereas “there is no claim such that …” will cause a run-time error, “there is no claim in the claims of the policy such that …” would work.
 
Literature
go back to reference Randall Davis & Jonathan J. King, “The Origin of Rule-Based Systems in AI”, chapter 2 in Rule-Based Expert Systems: The MYCIN Experiments of the Stanford Heuristic Programming Project, eds B. Buchanan & E. Shorliffe, Addison-Wesley, 1984, pp. 20-52 Randall Davis & Jonathan J. King, “The Origin of Rule-Based Systems in AI”, chapter 2 in Rule-Based Expert Systems: The MYCIN Experiments of the Stanford Heuristic Programming Project, eds B. Buchanan & E. Shorliffe, Addison-Wesley, 1984, pp. 20-52
go back to reference Allen Newell, 1973, “Production systems: Models of control structures”. In Visual Information Processing, ed. W. G. Chase, pp. 463-526. New York: Academic Press. Allen Newell, 1973, “Production systems: Models of control structures”. In Visual Information Processing, ed. W. G. Chase, pp. 463-526. New York: Academic Press.
Metadata
Title
Rule Engine Technology
Authors
Mr. Jérôme Boyer
Prof. Hafedh Mili
Copyright Year
2011
Publisher
Springer Berlin Heidelberg
DOI
https://doi.org/10.1007/978-3-642-19041-4_6

Premium Partner