I think [EMAIL PROTECTED] wrote:
> 
> Hi,
> 
> I have beans A and B. My rules are defined in file rules.clp.
> I have rule like this
> 
> (defrule assign
>   (a ?type)
>    (b ?type)
>    (a ?location)
>    (b ?location)
>    =>
>     (printout t  "Locations Matched along with types" crlf)
>   )

Do note that this rule, as you're showing it, could not possible match
any JavaBeans; this rule matches ordered facts, and JavaBeans (i.e.,
definstances) are always unordered.

Furthermore, note that the variables names "location" and "type" are
meaningless to Jess, and so the first and third, as well as the second
and fourth, patterns are identical.

> 
> In Java program I want to assert facts.
> 
> What is the best way?
> 
> I need to make statement like
> (assert (a  (call ?a getType))(b (call ?b getType)) (a (call ?a
> getLocation))(b (call ?b getLocation)))
> 
> where ?a and ?b are instances or beans.

If a and b are JavaBeans, you should be using defclass and
definstance, and so none of this is necessary -- you would just be
able to say something like

(definstance a ?a)
(definstance b ?b)

or from Java, 

Rete engine = ...
engine.definstance("a", a, false);
engine.definstance("b", b, false);

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

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