JESS

the Java Expert System Shell

The Jess FAQ

(C) 1999 Ernest J. Friedman-Hill and Sandia National Laboratories
You can obtain the most recent version of this document at http://herzberg.ca.sandia.gov/jess/FAQ.html
Last updated: Thu Mar 18 09:56:22 1999

Table of Contents

Introduction

General information

  1. What is Jess?
  2. Who wrote Jess?
  3. What are the licensing issues surrounding Jess?
  4. What versions of Jess are there?
  5. Where can I get Jess?
  6. Where can I get more information about Jess?

How do I do...

  1. How do I make Jess run forever?
  2. I'm having problems compiling Jess. Why?
  3. Are there any known bugs in Jess?
  4. My expert system is slow. How do I speed it up?

Can Jess do...

  1. Can Jess do fuzzy logic like FuzzyCLIPS?
  2. Can Jess do backwards chaining?

Introduction

This is the first verison of a FAQ for Jess. It is quite obviously unfinished. I will add to it as time permits.

The Questions


What is Jess?

Jess is a tool for building a type of intelligent software called Expert Systems. An Expert System is a set of rules that can be repeatedly applied to a collection of facts about the world. Rules that apply are fired, or executed. Jess uses a special algorithm called Rete to match the rules to the facts. Rete makes Jess much faster than a simple set of cascading if.. then statements in a loop. Jess was originally conceived as a Java clone of CLIPS, but nowadays has many features that differentiate it from its parent. You can learn more about expert systems from the Expert Systems FAQ (which hasn't been updated in quite a while.)

Who wrote Jess?

Jess was written by Ernest Friedman-Hill at Sandia National Laboratories as part of an internal research project. The first version of Jess was written in late 1995, when Java was very, very new. Jess has evolved considerably since then! A large number of Jess users have contributed code, suggestions, and patches; many of them are thanked by name in the Jess Manual.

What are the licensing issues surrounding Jess?

Jess is and will always be free for academic use worldwide. Commercial users can negiotiate a Jess license by contacting Subra Subramanian at Sandia's Technology Transfer office. A license is currently not required, merely encouraged, for domestic commercial use; this will likely change in the near future. A license is required for commercial use outside of the U.S. The licensing fees are negotiable and generally quite reasonable.

What versions of Jess are there?

Usually there is one "released" version and one "test" version available for download at any one time. As of this writing, version 4.4 is the stable released version, and the test version is 5.0a4. You are always encouraged to try the test version.

Where can I get Jess?

From the official Jess home page at http://herzberg.ca.sandia.gov/jess. There are no authorized mirror sites.

Where can I get more information about Jess?

From the official Jess home page at http://herzberg.ca.sandia.gov/jess.

How do I make Jess run forever?

The default behaviour of Jess is to stop running as soon as there are no activated rules. This is not appropriate for some applications; for example, an intelligent agent probably should keep running at all times. To keep the (run) command from ever returning, you merely need to write a rule that will always be activated. Mine generally looks like this:
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; This fact will be used to sleep when idle

  (deffacts idle-fact
    (idle))

  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ;; This rule will always be on the agenda! Make the salience
  ;; lower than any other rule.

  (defrule sleep-if-bored
    (declare (salience -100))
    ?idle <- (idle)
      =>
    (retract ?idle)
    (call java.lang.Thread sleep 100)
    (assert (idle)))

I'm having problems compiling Jess. Why?

The following are all the known issues with compiling various versions of Jess. Please let me know of any others.

Are there any known bugs in Jess?

The following are all the known bugs in the current versions of Jess. Please let me know of any others. In general, all of these will be fixed in any successive release.

My expert system is slow. How do I speed it up?

The performance of a Rete-based system depends not so much on the number of rules and facts but on the number of partial matches generated by the rules. Section 4.2 of the Jess manual mentions this briefly, but there is a much better treatment in the Giarrantano and Riley book (also mentioned in the Jess Manual.) The classic example of writing efficient rules looks like this: this rule
(defrule match-1
  (item ?x)
  (item ?y)
  (item ?z)
  (item ?w)
  (find-match ?x ?y ?z ?w)
  => )
is HORRIBLE, because it must form all possible permutations of 'item' facts before finding the one permutation that matches the 'find-match' fact. If there are 10 'item' facts, this is 10x10x10x10 = 10,000 partial matches are sent to the last join node - a lot of bookkeeping! If you rewrite the rule like this:
(defrule match-2
  (find-match ?x ?y ?z ?w)
  (item ?x)
  (item ?y)
  (item ?z)
  (item ?w)
  => )
Then there is precisely one partial match sent to the last join node - actually only one is sent to each join node. Whereas the first rule might take several minutes to reset on a fast machine, the second rule resets instantaneously.

The jess (view) command can be used to explore the efficiency of your rules.


Can Jess do fuzzy logic like FuzzyCLIPS?

Bob Orchard, the creator of FuzzyCLIPS, is interested in adding fuzzy extensions to Jess. We have been discussing an architecture for adding core extensions like fuzzy logic to Jess. When I know more, I will write about it here.

Can Jess do backwards chaining?

Jess version 5.0, which was released in alpha form in December 1998, has built-in support for efficient backwards chaining. See the README for details.