클립

2012-05-05 2 views
0

이 사람이 어떤 생각 이유가 있습니까 간단한 규칙 :클립

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

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

가 작동하지 않는? 첫 번째 규칙을 삭제하면 올바르게 작동합니다. 감사합니다.

답변

0

어떤 행동을 보입니까? gigel 규칙의 동작은 initx 규칙의 존재 여부와 관계없이 동일합니다.

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> 
관련 문제