0
不確定爲什麼這不起作用。短片或聲明未觸發
(defrule contain-red?
(initial-fact)
=>
(bind ?reply (get-text-from-user "Does it contain x (y/n?"))
(assert (existing-text ?reply)))
(defrule partOne
(existing-text "y")
=>
(bind ?reply (get-text-from-user "give me a number"))
(assert (credit-value-bsc-first-result (explode$ ?reply))))
(defrule partTwo
(existing-text "n")
=>
(bind ?reply (get-text-from-user "give me a number"))
(assert (credit-value-bsc-second-result (explode$ ?reply))))
(defrule learn-about-120?
(credit-value-bsc-first-result ?n)
(credit-value-bsc-second-result ?x)
(test (or (<= ?n 20) (<= ?x 20)))
=>
(bind ?reply (get-text-from-user "Reponse here)"))
(assert (learn-about-120-response ?reply)))
我可以得到使用和在不同的情況下工作的最終規則。將此加載到wxCLIPS中時不會出現錯誤,但是當我運行它並輸入相關數據時,最終規則不會觸發。
謝謝!我有一種感覺,變量是空的可能是一個問題。 – Joe