JESS: Managing the firing of rules

View: New views
7 Messages — Rating Filter:   Alert me  

JESS: Managing the firing of rules

by Matthew J Hutchinson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone,

After using Jess in college, I'm looking at using it for some other more serious work and realized I still had some lingering questions:

- One of the strengths of Jess is that we can just put facts in and no algorithm is needed - rules fire and hey presto! But when multiple rules fire (especially in the cases where there is some "overlap" in the criteria that make various rules fire) are there good approaches to harness all these firings and distill them back into one outcome which is all too often what's required when combining Jess with other procedural systems?

I hope that makes sense. I can see how in some cases firing multiple rules and having different paths is great, but in a case such as classification (just off the top of my head) only 1 outcome is desired.

Are there particular phrases I can use when looking for literature to do with this?


Cheers,
Matt



RE: JESS: Managing the firing of rules

by Martijn Tromm :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.

Hi Matt,

 

I would say that it’s not the firings you want to harness, but the rules themselves. Setting up an adequate rulebase cq knowledgebase, starts with determining the (business) domain and the key decisions that have to be made in that domain. For a specific decision you could have a rule like:

 

(defrule

(reason to do action)

(none (reason not to do action))

                =>

(do action)

)

 

Now you can add multiple rules that either infer reasons to do the action or reasons  not to do it and put the decision rule in a lower priority agenda.

 

Another strategy could be using goals and backward chaining: that way only facts will be inferred that you want to be inferred (if logically possible of course)

I would look for ‘rule architectures’, rulebased decisioning, rule chaining.

 

Regards,

Martijn

 

 

From: owner-jess-users@... [mailto:owner-jess-users@...] On Behalf Of Matthew J Hutchinson
Sent: donderdag 17 april 2008 23:34
To: jess-users@...
Subject: JESS: Managing the firing of rules

 

Hi everyone,

After using Jess in college, I'm looking at using it for some other more serious work and realized I still had some lingering questions:

- One of the strengths of Jess is that we can just put facts in and no algorithm is needed - rules fire and hey presto! But when multiple rules fire (especially in the cases where there is some "overlap" in the criteria that make various rules fire) are there good approaches to harness all these firings and distill them back into one outcome which is all too often what's required when combining Jess with other procedural systems?

I hope that makes sense. I can see how in some cases firing multiple rules and having different paths is great, but in a case such as classification (just off the top of my head) only 1 outcome is desired.

Are there particular phrases I can use when looking for literature to do with this?


Cheers,
Matt


No virus found in this incoming message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.0/1382 - Release Date: 16-4-2008 17:34


No virus found in this outgoing message.
Checked by AVG.
Version: 7.5.524 / Virus Database: 269.23.0/1382 - Release Date: 16-4-2008 17:34


Re: JESS: Managing the firing of rules

by Wolfgang Laun :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Matthew,

several techniques would be possible. Here are some ideas.

Avoid overlap. The "not" conditional element would be useful. It will,
of course, increase the complexity of patterns.

Use salience. To quote the Jess User Manual, "this is considered bad
style", but it is done, nevertheless.

Design the rules so that multiple firing is useful, and the order does
not matter because each RHS produces only some specific part of the
result. For instance: In a classification, a single unclassified animal
fact could be classified as "mammal" by one rule, as "rodent" by another
one, and as "rat" by a third one, each setting its own attribute in that
fact.

Let multiple firings happen and produce one "result" fact by each of
them. Add rules that eliminate the undesired results. (With "precision"
being an attribute of a classification, all but the result with the
maximum precision would have to be eliminated.)

Kind regards
Wolfgang


Matthew J Hutchinson wrote:

> Hi everyone,
>
> After using Jess in college, I'm looking at using it for some other
> more serious work and realized I still had some lingering questions:
>
> - One of the strengths of Jess is that we can just put facts in and no
> algorithm is needed - rules fire and hey presto! But when multiple
> rules fire (especially in the cases where there is some "overlap" in
> the criteria that make various rules fire) are there good approaches
> to harness all these firings and distill them back into one outcome
> which is all too often what's required when combining Jess with other
> procedural systems?
>
> I hope that makes sense. I can see how in some cases firing multiple
> rules and having different paths is great, but in a case such as
> classification (just off the top of my head) only 1 outcome is desired.
>
> Are there particular phrases I can use when looking for literature to
> do with this?
>
>
> Cheers,
> Matt
>
>



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: Managing the firing of rules

by Ernest Friedman-Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Matt,

All of Wolfgang's suggestions are good. I just wanted to add that for  
classification (an application I'm personally working on right now),  
one method is to develop a formal decision tree and then make it more  
or less explicit in the rules. By this I mean have decisions (which  
correspond to internal nodes of the tree) assert explicit working  
memory elements to represent the fact that the decision path has  
flowed through them (i.e., (consulted node-27)) and both decision and  
leaf nodes match these facts. This lets your ensure that only one  
leaf rule will fire. Did I explain that well enough?


On Apr 17, 2008, at 5:34 PM, Matthew J Hutchinson wrote:

> Hi everyone,
>
> After using Jess in college, I'm looking at using it for some other  
> more serious work and realized I still had some lingering questions:
>
> - One of the strengths of Jess is that we can just put facts in and  
> no algorithm is needed - rules fire and hey presto! But when  
> multiple rules fire (especially in the cases where there is some  
> "overlap" in the criteria that make various rules fire) are there  
> good approaches to harness all these firings and distill them back  
> into one outcome which is all too often what's required when  
> combining Jess with other procedural systems?
>
> I hope that makes sense. I can see how in some cases firing  
> multiple rules and having different paths is great, but in a case  
> such as classification (just off the top of my head) only 1 outcome  
> is desired.
>
> Are there particular phrases I can use when looking for literature  
> to do with this?
>
>
> Cheers,
> Matt
>
>

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 ejfried@...
Livermore, CA 94550                 http://www.jessrules.com




--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: Managing the firing of rules

by Ernest Friedman-Hill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Matt,

All of Wolfgang's suggestions are good. I just wanted to add that for
classification (an application I'm personally working on right now),
one method is to develop a formal decision tree and then make it more
or less explicit in the rules. By this I mean have decisions (which
correspond to internal nodes of the tree) assert explicit working
memory elements to represent the fact that the decision path has
flowed through them (i.e., (consulted node-27)) and both decision and
leaf nodes match these facts. This lets your ensure that only one
leaf rule will fire. Did I explain that well enough?


On Apr 17, 2008, at 5:34 PM, Matthew J Hutchinson wrote:

> Hi everyone,
>
> After using Jess in college, I'm looking at using it for some other
> more serious work and realized I still had some lingering questions:
>
> - One of the strengths of Jess is that we can just put facts in and
> no algorithm is needed - rules fire and hey presto! But when
> multiple rules fire (especially in the cases where there is some
> "overlap" in the criteria that make various rules fire) are there
> good approaches to harness all these firings and distill them back
> into one outcome which is all too often what's required when
> combining Jess with other procedural systems?
>
> I hope that makes sense. I can see how in some cases firing
> multiple rules and having different paths is great, but in a case
> such as classification (just off the top of my head) only 1 outcome
> is desired.
>
> Are there particular phrases I can use when looking for literature
> to do with this?
>
>
> Cheers,
> Matt
>
>

---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 ejfried@...
Livermore, CA 94550                 http://www.jessrules.com




--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------


Re: JESS: Managing the firing of rules

by Matthew J Hutchinson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Thanks for all the good suggestions. Ernest, do you have any papers/notes or know of other literature describing your solution? How robust is that solution, in terms of adding new rules to the system over time?

I would not like to have to rework the whole decision tree every time I add some more factors/attributes. I can see a trade-off emerging between "single outcome" and "rigidity of structure".

Also, does Protege automatically create the Jess code for any classes and instances created in it? Does anyone know of any tools that would let me graphically create rules (expressed in Jess code) based on a defined set of fact types? i.e. drag and drop, connect, add value conditions etc.

Thanks again, I appreciate the advice.

Matt




On Fri, Apr 18, 2008 at 7:51 AM, Ernest Friedman-Hill <ejfried@...> wrote:
Hi Matt,

All of Wolfgang's suggestions are good. I just wanted to add that for classification (an application I'm personally working on right now), one method is to develop a formal decision tree and then make it more or less explicit in the rules. By this I mean have decisions (which correspond to internal nodes of the tree) assert explicit working memory elements to represent the fact that the decision path has flowed through them (i.e., (consulted node-27)) and both decision and leaf nodes match these facts. This lets your ensure that only one leaf rule will fire. Did I explain that well enough?



On Apr 17, 2008, at 5:34 PM, Matthew J Hutchinson wrote:
Hi everyone,

After using Jess in college, I'm looking at using it for some other more serious work and realized I still had some lingering questions:

- One of the strengths of Jess is that we can just put facts in and no algorithm is needed - rules fire and hey presto! But when multiple rules fire (especially in the cases where there is some "overlap" in the criteria that make various rules fire) are there good approaches to harness all these firings and distill them back into one outcome which is all too often what's required when combining Jess with other procedural systems?

I hope that makes sense. I can see how in some cases firing multiple rules and having different paths is great, but in a case such as classification (just off the top of my head) only 1 outcome is desired.

Are there particular phrases I can use when looking for literature to do with this?


Cheers,
Matt



---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 ejfried@...
Livermore, CA 94550                 http://www.jessrules.com





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------



Re: JESS: Managing the firing of rules

by Matthew J Hutchinson :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Wow, I've just realized myself that if I can scrape together a table of attributes and classifications, I could generate the decision tree with something like the ID3 algorithm and then automatically turn this into a set of production rules .

Thanks!


On Fri, Apr 18, 2008 at 7:51 AM, Ernest Friedman-Hill <ejfried@...> wrote:
Hi Matt,

All of Wolfgang's suggestions are good. I just wanted to add that for classification (an application I'm personally working on right now), one method is to develop a formal decision tree and then make it more or less explicit in the rules. By this I mean have decisions (which correspond to internal nodes of the tree) assert explicit working memory elements to represent the fact that the decision path has flowed through them (i.e., (consulted node-27)) and both decision and leaf nodes match these facts. This lets your ensure that only one leaf rule will fire. Did I explain that well enough?



On Apr 17, 2008, at 5:34 PM, Matthew J Hutchinson wrote:
Hi everyone,

After using Jess in college, I'm looking at using it for some other more serious work and realized I still had some lingering questions:

- One of the strengths of Jess is that we can just put facts in and no algorithm is needed - rules fire and hey presto! But when multiple rules fire (especially in the cases where there is some "overlap" in the criteria that make various rules fire) are there good approaches to harness all these firings and distill them back into one outcome which is all too often what's required when combining Jess with other procedural systems?

I hope that makes sense. I can see how in some cases firing multiple rules and having different paths is great, but in a case such as classification (just off the top of my head) only 1 outcome is desired.

Are there particular phrases I can use when looking for literature to do with this?


Cheers,
Matt



---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
PO Box 969, MS 9012                 ejfried@...
Livermore, CA 94550                 http://www.jessrules.com





--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users you@...'
in the BODY of a message to majordomo@..., NOT to the list
(use your own address!) List problems? Notify owner-jess-users@....
--------------------------------------------------------------------