I think Vera =?iso-8859-1?Q?L=FAcia?= da Silva wrote:
>
> Dear Friends
>
> I am needing to create an extension of Jess to allow the communication
> among knowledge bases. i.e, a knowledge base should call another base
> and, to use the result returned by the base call to continue its
> inferences.
> I got an example supplied by Eric, but even so I am not reaching my
> objectives. I am sending my programs tests and the developed routine.
>
Here's an rule from your file ganimal.clp:
(defrule ave
?animal <- (animal naomamifero)
=>
(printout t "animal ave" crlf)
(assert (animal ave))
(store require-list voa))
(load-function Require)
(Require gave.clp)
(assert (animal (fetch require-list)))
(printout t "o animal resultante: " (bind ?bicho (fetch require-list)) crlf))
Despite the formatting, the command (load-function Require) is -not-
on the RHS of this rule - there's an extra closing parenthesis after
(store require-list voa). There's no syntax error since there's no
extra closing one after the (printout) line. Anyway, as a result, the
(Require) command is running before the (reset) and (run) commands do!
In all seriousness, a programmer has to choose a good editor to work
in. Minimally, it should understand the syntax of the language enough
to be able to help you match parentheses and to indent code to make
mistakes like this obvious. If I paste the code above into Emacs (what
I use) it comes out like this:
(defrule ave
?animal <- (animal naomamifero)
=>
(printout t "animal ave" crlf)
(assert (animal ave))
(store require-list voa))
(load-function Require)
(Require gave.clp)
(assert (animal (fetch require-list)))
(printout t "o animal resultante: " (bind ?bicho (fetch require-list)) crlf))
which makes the error rather more obvious.
> Question:
> The method getEngine of the class Context comes back the object of Rete
> in use. Is it true?
Yes
> In the example correspondent, I would like to know if the use of the
> methods store () and fetch () are correct.
Yes
>
>
> Best regard
> Vera
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9214 [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]
---------------------------------------------------------------------