in the Basic Programmers Guide, you write about the way, an OR-condition is handled. An OR-condition will be translated to several new rules and thereby, the OR-condition itself will be replaced by one of the conditions inside the OR. Okay, i understand, why that work in simple cases. But, when my OR-condition is nested e.g. in a NOT-condition, like here:
CLIPS> (deftemplate wurst (slot name) (slot gewicht) )
CLIPS> (assert (wurst (name "bockwurst") (gewicht 100) ))
CLIPS> (assert (wurst (name "bratwurst") (gewicht 200) ))
CLIPS> (assert (wurst (name "grillwurst") (gewicht 300) ))
CLIPS> (defrule rarara
(wurst (name "hanswurst"))
(wurst (gewicht 200))
(printout t "fofo" crlf)
it is not as simple as that, is it? how is an OR-condition handled in this and in similar cases?
From the Basic Programming Guide:
126.96.36.199 Or CEs Following Not CEs
If an or CE immediately follows a not CE, then the not/or CE combination is replaced with an
and/not CE combination where each of the CEs contained in the original or CE is enclosed
within a not CE and then all of the not CEs are enclosed within a single and CE. For example,
the following rule
(not (or (b ?x)
would be changed as follows.
(and (not (b ?x))
(not (c ?x)))
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.