|
Warning: main(/home/gurugail/header.php) [function.main]: failed to open stream: No such file or directory in /home/gurugail/ExpertSystem/page.html on line 23 Warning: main(/home/gurugail/header.php) [function.main]: failed to open stream: No such file or directory in /home/gurugail/ExpertSystem/page.html on line 23 Warning: main() [function.include]: Failed opening '/home/gurugail/header.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/gurugail/ExpertSystem/page.html on line 23 |
||||||
|
|
||||||
|
|
JESS(Java Expert System Shell)I. IntroductionJess, an expert system shell and scripting language written entirely in Sun Microsystem's Java language. Jess supports the development of rule-based expert systems which can be tightly coupled to code written in the powerful, portable Java language.
II. Getting readyJess has an interactive command-line interface. Just type java jess.Main (or java -classpath jess.jar jess.Main) to get a Jess> prompt. To execute a file of CLIPS code from the command prompt, use the batch command: Jess> (batch examples/sticks.clp)
III. What makes a good Jess application?Jess can be used in two overlapping ways. First, it can be a rule engine - a special kind of program that very efficiently applies rules to data. A rule-based program can have hundreds or even thousands of rules, and Jess will continually apply them to data in the form of a knowledge base. Second, Jess language is also a general-purpose programing language, and furthermore, it can directly access all Java classes and libraries. For this reason, Jess is also frequently used as a dynamic scripting or rapid application development environment.
1. Jess vs. PrologIn programming you should choose the right tool for the right job. Prolog and a Rete-based system like Jess are very different. The central concept in Prolog is backwards chaining: given the rules human(Socrates). you might be interested in knowing if mortal(Socrates) was true. Prolog uses
the rules to find it by looking for human(Socrates). Note that if you forget
the result and ask for it again, Prolog has to compute it again. The central
concept in Jess, though, is forwards chaining. Here, you have You don't specifically want to know (mortal Socrates) but rather you want to know what happens given that (human Socrates) is known. (mortal Socrates) is a result
IV. The Jess LanguageBasically strings in <angle-brackets> are some kind of data that must be supplied; things in [square brackets] are optional, things ending with + can appear one or more times, and things ending with * can appear zero or more times.
1. BasicsThe atom or symbol is a core concept of the Jess language. Atoms are very much like identifiers in other languages. A Jess atom can contain letters, numbers, and the following punctuation: $*=+/<>_?#. Jess atoms are case sensitive: foo, FOO and Foo are all different atoms. Another fundamental unit of syntax in Jess is the list. A list always consists of an enclosing set of parentheses and zero or more atoms, numbers, strings, or other lists. The following are valid lists:
2. FunctionsFunction calls in Jess are simply lists. Function calls use a prefix notation; a list whose head is an atom that is the name of an existing function can be a function call. Jess> (+ 2 3)
3. VariablesProgramming variables in Jess are atoms that begin with the question mark (?) character. A variable whose first character is instead a $ (for example, $?X) is a multivariable, which can refer to a special kind of list called a multifield. You assign to any variable using the bind function: Jess> (bind ?x "The value")
4. DeffunctionsYou can define your own functions using the deffunction construct. A deffunction
construct looks like this: Jess> (deffunction max (?a ?b)
5. Java reflectionAmong the list of functions above are a set that let you create and manipulate Java objects directly from Jess. Using them, you can do virtually anything you can do from Java code, except for defining new classes Jess> (bind ?ht (new java.util.Hashtable))
6. The knowledge base
|
|
||||
|
||||||