On Jun 11, 2007, at 3:24 AM, Wolfgang Laun wrote:

The following Jess program uses working memory elements as slot values, and this one doesn't fire the rule crossover, although I think it should.


....
(defrule crossover
  ?e <- (side (name ?ename) {occup == FALSE})
  ?w <- (side (name ?wname) {occup == TRUE})
  ?br <- (bridge (name ?bname){occup == FALSE}
                (east $east){east == ?e}
                (west $west){west == ?w})
  =>
  (printout t ?bname " " ?ename " " ?wname  crlf)
)

Unfortunately these "simple patterns" have confusing semantics, so they're being redefined somewhat for Jess 7.1. The confusing thing is that a name like "occup" in the above represents a variable that is bound automatically to the value of the first slot in which its used. If you use the same name later in the rule, that variable represents a unification -- i.e., the same value. Therefore it works just the same as variables in the regular Jess syntax; unfortunately this syntax makes it easy to believe otherwise. Anyway, the rule above can never fire, as it requires that the same variable be both TRUE and FALSE.


---------------------------------------------------------
Ernest Friedman-Hill
Advanced Software Research          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