Frequently Asked Questions 
(Assignment#1 - Jess)


Q. I cannot get Jess running. Can you help ?

A. To use Jess you need to first log into (ssh) one of the ece servers (say shell.ece.arizona.edu) and then from the command prompt type "/home/ece479/jess" to bring up the Jess shell or "/home/ece479/jess family.clp", where family.clp contains all your code (facts rules etc.).


Q. How can I run .clp files from the Jess shell prompt ?

A. Assuming that your .clp file is in the same directory from which the jess shell was invoked, you can run your .clp file by using the batch command.

Jess, the Java Expert System Shell
Copyright (C) 1998 E.J. Friedman Hill and the Sandia Corporation
Jess Version 6.0 12/7/2001

Jess> (batch ./myFile.clp)


Q. Can I add predicates of my own ? This will make some of my rules simpler to encode!

A. No. Please do not add predicates of your own (such as parent etc.). Stick to the predicates mentioned in the assignment. It makes grading difficult if you use your own predicates in rules (cause then extra facts may be inferred using that extra predicate which you introduced). Also please use the proper spellings/case for predicates and names/constants (refer to assignment [PDF]).


Q. Comments in my family.clp file seem to be giving an error when I try to run it using Jess ?

A. It has been noticed that some comments lead to errors sometimes. So keep your comments short and simple (stick alphabets and no fancy equations probably). Specifically avoid curly braces "{" "}" in your comments.


Q. How can i use eq and neq for testing whether two variables are equal or not ?

A. If you want to use new (or eq) in any of your rules then nest it inside a test statement. Hence something like (and (gender ?X male) ..... (test (neq ?X ?Y)).....) => .......


Q. Is it possible to define multiple queries in a single .clp file ?

A. Writing multiple queries is very much possible. Simply define seperate queries and iterate over the results generated by each and printing out the relevant answers, as shown in the assignment example.


Q. Who is Kimberley ?

A. One of the queries wants you to find the great uncle of Kimberly. This is correct since it should not return anything! Remember that we can always add a fact about Kimberly (just to test whether you programmed correctly or not) and then this query should work (and hopefully output something)!


Q. Can I encode as many facts as I want ?

A. Please code facts which are necessarily needed. As a hint if you encode the fact that x is y's mother, do you need to encode the gender of x ?? If you can come up with a technique for avoiding this and I add a million mothers to my Knowledge Base, we are potentially saving time to hard code a million facts.