If I understand you correctly, the assertion order matters here; i.e., your "fact 1" is the first one asserted, and "fact 2" is the second. The order in which facts are asserted is normally not a concern, but Jess does track it, and you can make a rule conditional on it; you might do something like this. Let's call the object type "O" and the slot "S":

(defrule rule-1
  ?o1 <- (O (S ?s1))
  ?o2 <- (O (S ?s2))
  (test (and (> ?o2 ?o1) (> ?s1 ?s2)))
  => ...

Comparing ?o1 and ?o2 here assures that the object with the higher fact index (i.e., the one that was asserted later) is the one with the lower value in S.


On Oct 1, 2007, at 11:01 PM, ameng wrote:


Hello,
From java program, I added a couple of shadow facts of same object type into working memory in particular order. When defining a rule, how I can do thing
like:

value of slot 1 in fact1 > value of slot 1 in fact 2
=>
doing something


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

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