Ernest et. al. 

I must not have made myself clear.  Same rules (in the same order), same
data (in the same order), same engine (same version and release date)
THEN results should be the same.  A state machine, by definition,
returns the same result for the same set of circumstances.  Change the
rules, change the data, change the order, then you do NOT have the same
beginning state.  

Arrival time of facts or data is part of the data state.  Besides, in a
computer there is no such thing as a random number.  Given the same seed
and the same algorithm you will always get the same number.  Randomness
is a human thing, not a machine thing.  :-)

BTW, some rule engines do NOT use threads.  This is so that they can be
used without change as a J2EE bean in an EJB environment.  JRules is (I
think) threaded while OPSJ definitely isn't.  Neither is (I think)
Advisor.  I can check on all of this if necessary.  Just depends on the
guy(s) who wrote the stuff as to what they wanted to do and how.

SDG
jco
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of [EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 4:23 PM
To: [EMAIL PROTECTED]
Subject: Re: Aspects and rules (was RE: JESS: Jason Morris interview)


I think James Owen wrote:
> ... But, back to the original supposition (Same
> data, same rules, same engine) if you don't get the same result then 
> you have a real problem.

Only if "time" is part of the data. In a multithreaded environment
(a.k.a. a real-world environment) this isn't true. As long as data is
arriving asynchronously from rule execution, the ordering of arrival of
facts can change the outcome. Only if a rule engine is running in a
single, self-contained thread can this be considered to be true.
Otherwise, any rule like "if X and not Y" will fire differently
depending on the order in which X and Y arrive, because if X gets there
first, then at one point, X is true, but not Y. This is how the real
world works.

Remember the TV commercials in which the hapless diner eats something
nasty and then whacks herself on the forehead in realization and
exclaims, "I could have had a V8!" If the V8 cart had arrived before the
hot-dog cart, the outcome would have been different; but in the real
world, either outcome is equally likely.

There's also the old puzzle about the man with two girlfriends who live
at opposite ends of town, and he takes the first train that arrives
randomly to visit either girlfriend. But he sees one 9 times more often
than the other. Why? Because the trains run ten minutes apart, one on
the nines, the other on the tens. He's only got a one-minute window in
which he'll get on the tens train. In a static production-system world,
he'd visit both equally often. In the real world, not so much.

Now, this single, self-contained thread model is actually very common in
the rule-engine biz; most commercial rule engines assume that you'll
stuff in some objects, run the engine, and then extract the results. You
can use Jess this way, but you can also have the data arrive
continuously and asynchronously while processing continues. This isn't
the classical model of a production system anymore, but it's a much more
useful model in real software.


---------------------------------------------------------
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]
--------------------------------------------------------------------

--------------------------------------------------------------------
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