I think Saritha Ventrapragada wrote:
> Hi,
> Thanks a lot for answering my last queries..but I have few more
> doubts in that..
> 1. Where Knowledge Base is situated and how these facts are stored
> in Knowledge Base physically.

The Jess manual gives some details on this. For example, see section
4.7. 

> 2. I could not get the fucntionality of "Unique". Is that is used to
> just improve the performance of Jess. or used to get the unique
> facts..according to your explaination, it has to stop execution when
> it finds the first match, but it is prinitng all the matches, which
> means that it is searching for the other matches too.

If you don't understand what it does, then don't use it. It is only
useful in certain limited situations.

> 3. We have gone through RETE alogorithm in your manual.It does not
> expalined clearly about set-hash-index function and (view).while
> explaning (view) u have just explained about its uses and Node1..You
> have used other nodes like Node2,NotNode, etc..but u did not
> explained them..Where we can find all this information and internal
> details of RETE algorithm.You have refered book but where we can
> find it on the web.could please give us the link.  

Sorry, can't help you.

> 4.
> (defquery search
>     "Finds all facts with a specified first field"
>     (declare (variables ?X))
>     (?L ?X ?Y))
> 

The exception you get is right here:

  Message: Expected '( <atom>' .
  Program text: ( defquery search "Finds all facts with a specified
        first field" ( declare ( variables ?X ) ) ( ?L  at line 4.

The parsing error occors at ?L, which is not allowed there. Jess
doesn't work that way. The "first field" of a fact is called the
"head". It's like the name of a class in Java, and it must be a symbol
-- you can't use a variable. You can't write a Java program where have
a variable of type Object, and you call an arbitrary method on it --
i.e.,

        Vector v = ...
        Object o = v.get(0);
        o.setText("OK");

You have to cast o to its actual type to tell the compiler what code
to generate:

        ((JButton) o).setText("OK");

Jess is the same way. Now, Jess does have inheritance of deftemplates
-- you can have a "base class" fact extended by several "subclasses",
and a query could match the base class, if you want. But generally,
just change your program so that ?L isn't the name of the fact, but
the first data field, and the name of the fact becomes "relation" or
something. 

> Also are there any commands to print the head of the list...ie foo
> and bar here. _data prints only the items in the slot but not the
> name.

Looking at the Javadoc page for jess.Fact shows there is a getName()
method. 



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to