我必须输入一个症状并希望得到问题的名称,但是当我写了defrule check-input时,我收到了一个错误。代码如下,请帮忙 我认为,问题在于defrule checking-input
RouteConfig.cs
答案 0 :(得分:1)
一些注意事项:
这是你的工作脚本:
(deftemplate probelm
(multislot name)
(slot symptom))
(deffacts probelms
(probelm (name (create$ "Air filter" "fuel injector problem" "fuel pressure regualtor"))
(symptom Black-Smoke))
)
;; add others problems
(reset)
(defrule reading-input
=>
(printout t "Enter the symptom your car Shows: " )
(assert (var (read))))
(defrule checking-input
(var ?symptom)
(probelm (symptom ?symptom1)(name $?name1))
(test (eq ?symptom ?symptom1))
=>
(printout t "Problems can be " $?name1 crlf))
(run)
(exit)
再见 尼古拉
PS:如果有用,请记得投票给答案;)