JESS: [EXTERNAL] nested foreach to return from the inner loop

2013-05-23 Thread Przemyslaw Woznowski
Hi Jess users, I have the following function: (deffunction similarity-score (?base ?other) (bind ?score 0) (bind ?totalDistance 0) (bind ?counter 0) (foreach ?x ?base (bind ?counter (+ ?counter 1)) (printout t counter is: ?counter) (bind ?partialDistance

Re: JESS: [EXTERNAL] nested foreach to return from the inner loop

2013-05-23 Thread Jason Morris
Did you try the (break)http://www.jessrules.com/jess/docs/71/functions.html#breakfunction? Arguments:NoneReturns:N/ADescription: Immediately exit any enclosing loop or control scope. Can be used inside of forhttp://www.jessrules.com/jess/docs/71/functions.html#for, while

JESS: [EXTERNAL] Nested not/and syntax question

2012-01-06 Thread Theodore Patkos
Hello everyone and best wishes for the new year could someone please give me an explanation why the following two rules behave in a different way, although they express the same logical formula (i.e., not (Object ^ Pred) )? In fact, only the second rule reaches correct conclusions, as I note

Re: JESS: [EXTERNAL] nested or-and-not

2011-12-21 Thread Lode Hoste
Hi, Maybe this helps you in understanding: http://www.jessrules.com/jess/docs/71/rules.html#not_ce Note that a not pattern cannot define any variables that are used in subsequent patterns (since a not pattern does not match any facts, it cannot be used to define the values of any variables!) You

JESS: [EXTERNAL] nested or-and-not

2011-12-12 Thread Al C
Hello all, First, I apologize for the length of this post. I have an issue with the syntax of a rule of mine that is puzzling me. The rule is as follows (i copy it exactly as it appears in its program, all parentheses are as shown): (defrule ColorChange (Time (timepoint ?t2)) ?e0 -