In the following jess / clips code, variable x is not well referenced. Why?
(assert (item 2))
(assert (item 12))
(defrule ex1not
(not (item ?x))
(item ?y & (> ?x 10)) <- HERE I GET "No such variable x"
=>
)
In the following jess / clips code, variable x is not well referenced. Why?
(assert (item 2))
(assert (item 12))
(defrule ex1not
(not (item ?x))
(item ?y & (> ?x 10)) <- HERE I GET "No such variable x"
=>
)
Copyright © 2021 Jogjafile Inc.
The first pattern matches in the absence of a fact
(item ?x), for any value of?x; it is true when there are no(item)facts at all. The second pattern would then try to compare that?xto 10. If we were somehow at the second pattern, then since?xdidn't match anything, it has no value, so you can't compare it to anything.If you edit your question to add what you're actually trying to express, in English, I can edit my answer to show you how.