最后,当程序应该打印百分比确定性时,程序挂起。可能有什么问题?它必须是计算百分比规则,因为当删除时,将打印非百分比数据。
(defmodule PRINT-RESULTS (import MAIN ?ALL))
(defrule PRINT-RESULTS::calculate-percentages
?var <- (religion (name ?religion) (aspects $?aspects) (certainty ?certainty))
=>
(modify ?var (certainty =(*(/ ?certainty 700)100))))
(defrule PRINT-RESULTS::print-religion
?rel <- (religion (name ?religion) (aspects $?aspects) (certainty ?certainty))
=>
(retract ?rel)
(printout t crlf RELIGION: " "
?religion crlf ASPECTS: " "
?aspects crlf CERTAINTY: " "
?certainty crlf))