Well, first, an aside. Both "exists" and "test" are reserved CE
names. I'm not sure if you mean them as hypotheticals or in their real
context.
In any event, read manual section 2.8.1.4 regarding the "not" CE. All
you need to do is to include the relevant pattern inside a
(not). Because "exists" is defined as "not not", "not exists" == "not
not not" or "not" (since two wrongs make a right, at least in this
case.)
Note also that (as 2.8.1.4 says) if the (not) is the first pattern on
the LHS of a rule, there's an implicit (initial-fact) before it, so
you must use (reset) before the rule will fire.
To recap: let's say you want a rule that will fire if there are no foo
facts. Then the rule is
(defrule no-foo
(not (foo))
=>
(printout t "No foo facts!" crlf))
Jess> (reset)
Jess> (run)
No foo facts!
1
Jess>
I think Kyle Thornton wrote:
> Hi!
>
> I have a list of scenarios currently, and need to
> add another that checks to see if a fact has not
> been asserted i.e.
>
> (defrule test
> (not (exists test))
> =>
> do something
> )
>
> But I cannot seem to get this to work, any ideas
> on how to use such negative logic?
>
> Thanks
> Kyle
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------