0
votes

does anybody have any idea why this:

(defrule initx
      (declare(salience 90))
      =>
      (assert (blabla 10))
)

(defrule gigel
    (declare(salience 89))
      =>
      (printout t "test" crlf)
)

is not working? When I delete first rule it works. Thank you.

1

1 Answers

0
votes

What's the behavior that you're seeing? The behavior of the gigel rule is the same regardless of whether the initx rule is present or not.

CLIPS> 
(defrule initx
  (declare(salience 90))
  =>
  (assert (blabla 10)))
CLIPS> 
(defrule gigel
  (declare(salience 89))
  =>
  (printout t "test" crlf))
CLIPS> (reset)
CLIPS> (run)
test
CLIPS> (facts)
f-0     (initial-fact)
f-1     (blabla 10)
For a total of 2 facts.
CLIPS> (clear)
CLIPS> 
(defrule gigel
  (declare(salience 89))
  =>
  (printout t "test" crlf))
CLIPS> (reset)
CLIPS> (run)
test
CLIPS> (facts)
f-0     (initial-fact)
For a total of 1 fact.
CLIPS>