Yes, I understand the VERY nice feature of 'shadowing' Java Beans as
deftemplates (unordered facts) and then pattern-matching on the facts.

However, how do you match on a generalized fact/Java Bean? For 
example, suppose I have a Java Bean named Animal for which I specify
'(defclass animal Animal)'. I then have other Java Beans which
inherit from Animal (e.g. Dog, Cat) for which I provide similar
defclass statements. Then if I provide definstances for Animal, Dog
and Cat Java Bean objects, how do I pattern-match on any kind of
Animal? A pattern such as "(animal ... (OBJECT ?obj))" won't work
since it only matches instances of the base class Animal.

I realize I'm probably missing something obvious, but I could sure use
a point in the right direction!

Thanks again,
                             Alan Davis
                         CAD Research Center
               California Polytechnic State University
                      San Luis Obispo, CA 93407


 On Tue, 18 Aug 1998, Ernest Friedman-Hill wrote:

> Hi Alan,
> 
> Instead of supporting COOL, Jess supports pattern-matching on Java
> Beans. You therefore have the entire Java language at your disposal,
> including inheritance. Instead of creating COOL classes and instances
> you create Java classes and objects.
> 
> I think alan davis wrote:
> > 
> > I just jumped on this user group, so forgive me if this question has
> > already been asked...
> > 
> > I'm attempting to port COOL defrules to Jess and am looking for a way
> > to pattern match on objects in a COOL-like fashion. Specifically, I
> > need inheritance on the LHS (e.g. "(object (is-a <class>) ...)" ).
> > Since Jess does not directly support this (as does COOL), I was
> > hoping someone has already implemented a nice workaround.
> > 
> > Thanks in advance!
> > 
> >                              Alan Davis
> >                          CAD Research Center
> >                California Polytechnic State University
> >                       San Luis Obispo, CA 93407
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
> > in the BODY of a message to [EMAIL PROTECTED], NOT to the
> > list. List problems? Notify [EMAIL PROTECTED]
> > ---------------------------------------------------------------------
> > 
> > 
> 
> 
> ---------------------------------------------------------
> Ernest Friedman-Hill  
> Distributed Systems Research        Phone: (510) 294-2154
> Sandia National Labs                FAX:   (510) 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. List problems? Notify [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> 
> 


---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to