causse@lifia.imag.fr (Olivier Causse) (06/06/91)
Dear CLIPS users, I fond a very tedious limitation in CLIPS syntax (it may not exist in the newest version, tell me if its true). Here is the problem, I'd like to express the following LHS condition (defrule problem [(<<preceding patterns>>)] (not (and (A ?x ?y) (B ?x ?z&:(neq ?z ?y)) ) ) [(<<other patterns>>)] => ... ) I know that AND and OR logic blocks may not be placed inside of a NOT pattern. In fact, I'd like to know 1) Why such a restriction ? 2) How to express the same condition in another (generic) way ? 3) Do other expert system working with RETE algorithm have the same limit ? Thanks a lot for any comments. Olivier. -- CAUSSE Olivier A LISP programmer knows the value of everything, LIFIA - INPG but the cost of nothing. 46, Av. Felix Viallet 38031 Grenoble. CEDEX
news@dftsrv.gsfc.nasa.gov (06/12/91)
In article <8023@uklirb.informatik.uni-kl.de>, causse@lifia.imag.fr (Olivier Causse) writes: > Here is the problem, I'd like to express the following LHS condition > > (defrule problem > [(<<preceding patterns>>)] > (not > (and > (A ?x ?y) > (B ?x ?z&:(neq ?z ?y)) > ) > ) > [(<<other patterns>>)] > => > ... > ) > > I know that AND and OR logic blocks may not be placed inside of a > NOT pattern. > > In fact, I'd like to know > > 1) Why such a restriction ? > 2) How to express the same condition in another (generic) way ? Well the main purpose of the NOT operator is to test for the non-existance of a pattern. One good reason to have such a restriction is the ambiguity of the statement. Does the AND imply that you are testing for the existing of both patterns? If what you want to do is check for multiple patterns that do not exist you can just have multiple not statements as follows: ... (not (A ? ?)) (not (B ? ?)) ... Or in your case are you just using it as a negation operator? If this is true, wouldn't the following be logically equivalent: (defrule problem [(<<preceding patterns>>)] (A ?x ?y) (B ?x ?z&:(eq ?z ?y)) [(<<other patterns>>)] => ------------- Robert Dominy NASA Goddard Space Flight Center