Have you considered a "polymorphic" approach where the objects that define your conditional tests (and actions) can be overridden thereby producing "different" conditional tests and action effects while the syntactical representation remains the same ???
Envision a rule that remains the same (syntactically), yet it can perform very differently depending on the objects being matched. This already exists in JESS whether you match on classes or interfaces, it's just that many people do not even consider using it because it is somewhat abstract (it is definitely NOT "see spot run"). ----- Original Message ----- From: "Judson, Ross" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 26, 2003 10:10 AM Subject: JESS: Subrules > >From the wish-list department: I'd sure like it if, in the action > portion of a rule definition, I could define new rules. Sort of like > this: > > (defrule i-am-a-rule > (condition 1) > (condition 2) > => > (defrule subrule-1 > (condition) > => > (action)) > > (action) > ) > > > or > > (defrule subrule-2 extends i-am-a-rule > (condition) > => > (action)) > > > When you're dealing with a lot of rules, this kind of thing can really > help set up more complex nested if-then-if-then type stuff. > > In addition, it would be cool (don't you love hearing that ;) if you > could do this, instead of using salience: > > (defrule rule-3 > (declare (overrides i-am-a-rule)) > (condition) > => > (action)) > > The effect of that would be that for any given set of facts, if both > rule-3 and i-am-a-rule are activated, rule-3 fires, eliminating the > activation of i-am-a-rule. > > For a general and somewhat more specific rule that can match on the same > set of facts, there is no way to avoid using salience to perform the > discrimination, unless you break the matching up and use "signaling" > facts. This is somewhat undesirable. > > RJ > > -------------------------------------------------------------------- > 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] > -------------------------------------------------------------------- > -------------------------------------------------------------------- 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] --------------------------------------------------------------------
