I believe the following should work, but I haven't tried it all
out. For this to work, all your defclasses need the "class"
slot. The one you show below does. To ensure that a defclass has this
slot, define a defclass 

  (defclass object java.lang.Object)

and then define all your subsequent defclasses to extend this one:

  (defclass button java.awt.Button extends object)


OK, anyway, the trick is to use 

  (have (possession-type (class (call Class forName "package.pencil"))))

where you've got "(have (possession ?pencil <of type pencil>))"
below. Then the need-have fact should have the posession-type slot
filled in with the appropriate class object, which you can use to
synthesize the "pencil" object and "have" fact.

> An additional question: is it possible to let need-have only be
> asserted when (want-to-write) - a non-backward-chaining fact - is
> asserted?

This is how it works already.



I think Sander Faas wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hello,
> 
> My agent has a knowledgebase in which every fact is a definstance fact. The
> reason for this is that I use the Jade ontology support which specifies all
> concepts, predicates and actions in the agent's world. This ontology support
> maps all elements (concepts, predicates etc.) on Java classes.
> 
> For example the predicate (have :POSSESSION (pencil) :OWNER (human :NAME
> Jaap)) results in the following fact:
> 
> (MAIN::have(class <External-Address:java.lang.Class>) (owner
> <External-Address:storyagents.storyworldontology.Human>) (possession
> <External-Address:storyagents.storyworldontology.Pencil>) (OBJECT
> <External-Address:storyagents.storyworldontology.Have>)
> 
> Suppose I have a rule that says: if I want to write and I have a pencil,
> then I will write. This could be done in the following manner:
> 
> (defrule write
>       (want-to-write)
>       (have (possession ?p))
>       (pencil (OBJECT ?p))
>               =>
>       (printout t "I am writing" crlf)
> )
> 
> However, I want to use backtracking and do something like:
> (do-backward-chaining have)
> (defrule write
>       (want-to-write)
>       (have (possession ?p <of type pencil>))
>               =>
>       (printout t "I am writing" crlf)
> )
> 
> Is such a thing possible? The problem with the first method is that if I use
> backward chaining all I get is an empty need-have fact (all slots nil).
> 
> Bye,
> Sander
> 
> 
> --------------------------------------------------------------------
> 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]
> --------------------------------------------------------------------
> 



---------------------------------------------------------
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