This idea of "rule inheritance" has been brought up before; it's a
good idea. See
http://www.mail-archive.com/[EMAIL PROTECTED]/msg05152.html .

No promises, but it's possible that it will be in Charlemagne.

Anyway, -don't- deal with this using queries; you'll be sacrificing a
lot of performance for not much clarity. One thing you -could- do
would be to use a macro processor to pre-process your files, and
define macros to represent the shared data.


I think Xiaocheng Luan wrote:
> 
> Hi, this might be a dumb question, but is there any way to reuse
> a matching pattern, for example, the following piece of pattern tests
> if the class of instance ?x is compatible (subclass, either direction)
> with that of instance ?y.
> 
>   (instance-of ?x ?class1)
>   (instance-of ?y ?class2)
>   (or
>     (sub-class-of ?class1 ?class2)
>     (sub-class-of ?class2 ?class1)
>     (same-class-as ?class1 ?class2)
>   )
> 
> This kind of test is needed in different rules and even needed more
> than once within one rule. Therefore, it's desirable to have some
> way to reuse this piece of code. Writing a function that uses a
> run-query is the best way I could think of. Any better ideas?
> 
> Thanks!
> 
> Xiaocheng Luan



---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        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