Loading ...
Sorry, an error occurred while loading the content.

Rule in CLIPS

Expand Messages
  • Alberto Vera
    Hello I made this rule: (defrule warning ?suma ?error 1) = (retract ?suma) (printout t ?error WARNING ?error crlf) ) I want to
    Message 1 of 2 , Sep 11, 2002
    • 0 Attachment

      Hello

      I made this rule:

      (defrule warning
         ?suma <- (numerrores ?error)
         (> ?error 1)
         =>
         (retract ?suma)  
         (printout t ?error " WARNING " ?error crlf)
      )

      I want to execute this if ?error is > 1, but i don't see any message.

      What is wrong in my rule?

      Can you help me?

      Thanks


      Yahoo! Messenger
      Nueva versión: Webcam, voz, y mucho más ¡Gratis!
    • Serguei Mokhov
      ... From: Alberto Vera Sent: September 11, 2002 3:34 PM ... Personally, I don t see anything wrong with your rule with
      Message 2 of 2 , Sep 16, 2002
      • 0 Attachment
        ----- Original Message -----
        From: "Alberto Vera" <artificialintelligenceperu@...>
        Sent: September 11, 2002 3:34 PM

        > (defrule warning
        > ?suma <- (numerrores ?error)
        > (> ?error 1)
        > =>
        > (retract ?suma)
        > (printout t ?error " WARNING " ?error crlf)
        > )
        >
        > I want to execute this if ?error is > 1, but i don't see any message.
        >
        > What is wrong in my rule?

        Personally, I don't see anything wrong with your rule with exception of one little thing,
        but you haven't provided much of a context you are trying
        to test your rule in anyway. For it to fire, you have to have
        a fact (numerrores N) where N>1 in your facts base,
        and change (> ?error 1) to (test (> ?error 1)) because
        (> ?error 1) isn't really a fact and you are tyring to match it
        as if it were one.

        hth,
        -s
      Your message has been successfully submitted and would be delivered to recipients shortly.