Negation of conditional element not working?

Help
Tony
2011-05-31
2012-11-23
  • 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
       (or
         (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))
    <Fact-0>
    CLIPS> (load check1.clp)
    Defining defrule: check1 +j+j
    +j
    TRUE
    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.

    -tony

     
  • 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.