The Department of Computer Science & Engineering
cse@buffalo

CSE663: Advanced Knowledge Representation
Stuart C. Shapiro

Notes on Jess


Jess is a production system implemented in Java. The Manual for Jess Version 7.0p1, which is "the latest stable release version of Jess" [Online Jess Documentation web page], and the version we have installed on the CSE department computers is available on-line.
How to run Jess
From a shell command line, execute
      /util/Jess70p1/bin/jess

How to terminate Jess
From the Jess prompt, enter
      (exit)

Example Jess programs
Example Jess programs are available in the following directories:
In the Jess rule language:/util/Jess70p1/examples/jess
In XML:/util/Jess70p1/examples/xml
For embedding Jess in a Java program:/util/Jess70p1/examples/pricing_engine

Running a prepared Jess program
If you have a Jess program in a file, you can execute it by entering the Unix shell command
/util/Jess70p1/bin/jess file
      try
      /util/Jess70p1/bin/jess /util/Jess70p1/examples/jess/hello.clp

A Jess alias
I recommend you create the following alias (in your .cshrc file):
      alias jess /util/Jess70p1/bin/jess
That way, you can run Jess interactively by executing the shell command
      jess
and you can run a prepared Jess program by executing the shell command
      jess file

Interacting with Jess
You interact with Jess by entering Lisp-like expressions at the Jess prompt, for example, try
      (printout t "Hello, world!" crlf)
           [from the example, /util/Jess70p1/examples/jess/hello.clp]

Loading into interactive Jess
You can load (and run) a Jess file into an interactive Jess session by evaluating
      (batch file)
For example,
      (batch "/util/Jess70p1/examples/jess/hello.clp")

Another example
Another example Jess program is at
      /projects/shapiro/CSE663/JessExamples/birds.clp

Yet another example
A Jess version of the brick stacking program of Ronald J. Brachman & Hector J. Levesque, Knowledge Representation and Reasoning, Morgan Kaufmann, 2004, Sect. 7.4 is at
      /projects/shapiro/CSE663/JessExamples/bricks.clp

Last modified: Tue Oct 2 16:35:48 EDT 2007
Stuart C. Shapiro <shapiro@cse.buffalo.edu>