Re: JESS: infinite loop again
Hi Rose,
Aside from some Jess usage issues, I think you have a big logic flaw in your rules.
Look at what you have written in the first rule:
You are essentially trying to match any (object) that is-a-tumor-patient with any (object) that is-a-tumor. However, I don't see any slot binding that is common to either of those patterns that logically joins them so that you can draw the conclusion that a particular patient has a certain type of tumor leading to a certain disease. You are pulling the conclusions out of thin air. The fact that the individual rules fire or not is immaterial in the face of this.
If I'm right, then if you were to just take your first rule, assert two patient objects and three tumor objects, and run Jess, you should get the Cartesian product of 6 firings of your rule. Using both rules should cause the infinite loop because they will alternately change the facts, perpetually activating each other.
A more rigorous diagnosis rule might look like this:
IF
We have a patient, p AND
This patient has a tumor, t AND
This tumor has an attribute, a(1) AND
...
This tumor has an attribute, a(n)
The patient exhibits symptom s(1) AND
...
The patient exhibits symptom s(m)
THEN
Conclude that patient p has disease d caused by tumor-type t with the score z.
Also, what is that (slot-set..) function on the RHS of your rules? Are you developing this in Protege?
Cheers,
Jason
On Mon, May 25, 2009 at 1:51 PM, Rose S <black_rose_u2@...> wrote:
Hello, I've declared no-loop in my rule to avoid infinite loop, but I have two rules that when I use them separately (I mean when I define one of them) there's no loop but when I define both of them in my project and run them an infinite
loop would happen. what's the problem with that? is there some thing wrong with my rules?
Thanks in advance Rose
|
Get your new Email address!
Grab the Email name you've always wanted before someone else does!
--
-----------------------------------------------------------
Morris Technical Solutions LLC
consulting@...
(517) 304-5883