【发布时间】:2016-05-22 00:49:09
【问题描述】:
我对 CLIPS 和类有一个大问题。 我在 CLIPS 中开发了一个小型安全评估,但是在询问用户是否需要更好的解释时,他可以单击一个按钮,他会收到解释。 为此,我的系统有一个这样的类:
(defclass QUESTION (is-a USER)
(role concrete)
(pattern-match reactive)
(slot id (type STRING))
(slot description (type STRING) (create-accessor read)))
还有一组这样的实例:
(definstances EXPLANATION
(E1 of QUESTION (id "GQ01")(description "Choose YES if you don't know ... ")))
要检索系统使用此操作的描述::
(send (find-instance ((?f QUESTION)) (str-compare ?f:id ?id-question)) get-description)
问题是在执行它时我收到这条消息:
[MSGFUN1] No applicable primary message-handlers found for get-description.
[PRCCODE4] Execution halted during the actions of deffunction explain-question.
[PRCCODE4] Execution halted during the actions of deffunction yes-or-no-p.
[PRCCODE4] Execution halted during the actions of defrule ask-for-component-needed.
我该如何解决?我希望如果 ?id-question 等于实例集的 id of an instance,系统将打印与该实例关联的描述。
【问题讨论】:
标签: clips expert-system