Negation of conditional element not working?

  • Tony

    Tony - 2011-05-31

    Hi all,
      I just started using CLIPS. Here is my problem,  I defined a rule called check in 'check1.clp':
    (defrule check1
         (not (input 10)) 
         (input 5)
      (assert (result 10)) 
      (bind ?temp 10)
      (printout t ?temp crlf))
    And at top-level, I did this, but nothing happens:
    CLIPS> (clear)
    CLIPS> (assert (input 100))
    CLIPS> (load check1.clp)
    Defining defrule: check1 +j+j
    CLIPS> (run)

    How come the negation operator does not work? Do I use it in a wrong way? Thanks for your help. Very much appreciated.


  • Gary Riley

    Gary Riley - 2011-05-31

    Issue a (reset) command before you do the (assert (input 100))) command.
    The (reset) is necessary for negated patterns to work properly.


Log in to post a comment.