Jess: define a rule with "not" syntax

198 Views Asked by At

Jess somehow does not check for not existing facts. I want to define a rule like this:

(defrule (not (fact)) => (assert (something)))

But it does not seem to be possible, because this rule never becomes true, regardless if there is this fact in the working memory or not!

(It does work without the (not ... ) and if this fact exists, of course!)

1

There are 1 best solutions below

0
On

Most likely, you did not call

(reset)

to trigger the insertion of (initial-fact), which for some reason or other (see the manual) is essential for the proper working of some patterns using (not).