I'm wondering why the 'not' conditional behaves different than
expected. For instance:
(defrule hello
(not (> (+ 1 1) 1))
=>
(printout t "123"))
is an invalid rule. It gives a syntax error at the open brackets for
the + operator.
Another parsing problem is found in the following definition:
(defrule hello
(not (= 1 1))
=>
(printout t "123"))
Note that the following examples do work:
(defrule hello
(not (> 1 1))
=>
(printout t "123"))
(defrule hello
(not (eq 1 1))
=>
(printout t "123"))
Is there a specific reason why these (arithmetic?) limitations are imposed?
Greetings,
Lode
I'm trying to compose a negation condition with fact matching and test
functions.
My invalid rule:
(deftemplate Foo (slot bar))
(deffunction complexFunction (?a ?b) FALSE)
(defrule hello
(Foo (bar ?a))
(not (Foo (bar ?b))
(test (complexFunction ?a ?b)))
=>
(printout t "123"))
The alternative (although harder to read) does work:
(defrule hello2
(Foo (bar ?a))
(not (Foo (bar ?b&:(complexFunction ?a ?b))))
=>
(printout t "123"))
Is there a reason for this limitation?
Thank you
2011/8/5 CLIPS Support <gdronl...@swbell.net>:
> --
> You received this message because you are subscribed to the Google Groups "CLIPSESG" group.
> To post to this group, send email to CLIP...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
>
> --> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Click on "Edit my membership" link.
> Select the "No Email" radio button.
> Click the "Save these settings" button.
>
> --> IF YOU WANT TO UNSUBSCRIBE <--
> Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
> Sign in
> Click on "Edit my membership" link.
> Click the "Unsubscribe" button.
> Note: This appears to be the most reliable way to unsubscribe
>
> Alternately, send email to CLIPSESG-u...@googlegroups.com. You will receive an email which you must respond to as well to unsubscribe. Clicking the link mentioned in the unsubscribe reply does not appear to work reliably.
For more options, visit this group at http://groups.google.com/group/CLIPSESG?hl=en
--> IF YOU NO LONGER WANT TO RECEIVE EMAIL <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en
Click on "Edit my membership" link.
Select the "No Email" radio button.
Click the "Save these settings" button.
--> IF YOU WANT TO UNSUBSCRIBE <--
Visit this group at http://groups.google.com/group/CLIPSESG?hl=en