RE: JESS: Goal in each action

2006-01-26 Thread Daniela CLARO
Hi James,  
Thank you very much for your deeply answer. I have some comments to add...

Actually, I completely agree with you that rule-based systems are a kind of
data-driven and forward chaining also. In my example, the planner that I am
devellopping, I can have an explicitly goal, but actually I dynamically
create my plan and my goal depends on which rules are decided by the user to
be included. Each rule corresponds to a web service in real world and the
goal of my planner is to order the rules, saying which one should be before
the other. For example, if I am constructing a stairs, first I need the
concrete and then I can construct a stairs. Thus based on preconditions the
actions will be organized in the order of its execution. In this case my
goal was construct a stair, but if I had put also action floor, probably my
goal would be construct a new floor, and stair will only be an intermediate
step. More or less, I hope you have understood what I am doing...

About the book, I can buy it, but is it different from the Docs in Jess, or
they are similar? Do you really encourage me to buy it? 

Thank you very much, I will probably post another message about some other
problems I am having when implementing Jess with Java beans. 

Daniela   


-Message d'origine-
De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la
part de James C. Owen
Envoyi : mercredi 25 janvier 2006 20:36
@ : jess-users@sandia.gov
Objet : Re: JESS: Goal in each action

Deniela:

As stated before, which you might not have seen, most of the problems with
newbies and rulebased systems is that the process is declarative rather than
procedural as with most other languages.  When a rule is refracted (removed
from the agenda permanently because it has
already) the rule that is deleted is the rule+data, meaning that the same
rule logic may appear several times but with a different set of data.  If
the data are changed, then the rule logic might appear again.

Now, to goal-oriented rules.  Normally, in most rulebased systems, recency
is one of the first items to consider.  So, if a new goal is asserted it
will take precedence over any other goals.  That's why the goal usually
appears as the first condition in the rule.  The manner in which the rules
are processed is not like other languages; it is determined as an abstract
problem and is solved by the conflict resolution strategy.  And, yes, under
the covers, each OR is broken down into two rules complete with data
associated with that rule.

Here is a fairly easy way to think of the rules:  All of the rules and all
of the data are put into a big pot.  Each rule associates itself with a set
of data and becomes an object.  When we use goal- oriented rules, we
restrict each set of rules to only those with the current goal - which can
change if any of the rules assert another goal.

During the first cycle, all of the rules+data are examined (1) to associated
each datum with a specific rule, (2) to associate a rule with specific data
and (3) to see if any of the rules evaluate to TRUE.  All of the rules that
evaluate to TRUE are put on the Agenda Table as well as being put into a
truth maintenance table.  Then the rules are evaluated according to conflict
resolution.  If any datum is changed then any rule that used that datum is
RE-evaluated to see if (1) it was false and is now true and it will be put
on the Agenda table or (2) if it was true and on the Agenda table and is now
false it will be removed.  ONLY those rules where the data are changed are
evaluated.  And numerous tests over the years have determined that even with
thousands of rules, only two or three rules are changed during one cycle of
rules.  Meaning that not all of the rules need to be checked - only those
who data have changed.

I know that all of this might seem a bit low-level and simplistic, but
sometimes we tend to forget that rules are kind of data driven
- it's also sometimes called forward chaining which may or may not be a
misnomer.  Above all, read the book on Jess, Jess in Action, and go
through the examples and tutorials before attempting to design your own
system.

If I sound condescending, I apologize but it's most difficult to answer
questions over the internet without sounding like a professor talking to a
student.  If this has been of any help, good.  If not, then just toss it.
:-)

SDG
jco

James C. Owen
Senior Consultant
[EMAIL PROTECTED]
http://www.kbsc.com
Never give up.  Never give up.  Never, never, never give up.
 From a speech by former Prime Minister, Winston Churchill, during the most
trying times of the British Empire; a great leader too soon forgotten by his
country after keeping it from being swallowed up by the Nazi Empire during
the second world war.



On Jan 25, 2006, at 2:51 AM, Daniela CLARO wrote:

 Thank you Ernest,
  I have more questions about it...The first one is that I'd read that 
 Jess memorizes each rule that it passes and so Jess doesn't pass two 
 times in the same rule

Re: JESS: Goal in each action

2006-01-26 Thread Roger Studner
To jump in.. I suggest that everyone buys that book if they are going to use
Jess.  It *does* repeat some material available in the online docs and other
places, but also includes quite a good bit more code and examples than I
found anywhere else.

Roger Studner


On 1/26/06, Daniela CLARO [EMAIL PROTECTED] wrote:

 Hi James,
 Thank you very much for your deeply answer. I have some comments to add..