1

我正在使用 PyCLIPS 将 CLIPS 集成到应充当 ECA 服务器(事件条件操作)的程序中。有传入事件与系统状态一起,可能会或可能不会触发规则,然后在消息总线上发出操作。

系统状态以实例的形式表现出来,这些实例的插槽根据传入的事件进行修改。

该软件旨在成为一项长期服务,但当在执行规则期间发生错误时,例如通过错误命名的处理程序:

ERROR: [MSGFUN1] No applicable primary message-handlers found for event-handler.
[PRCCODE4] Execution halted during the actions of defrule event-rule.

剪辑会话变得对新消息没有响应。插槽不再使用以下方式更新:

clips_instance.Send(event, event_args)

clips.DebugConfig.WatchAll()即使没有调试输出,剪辑中也不会发生任何事情。

例子:

>>> import clips
>>> clips.Build("(defclass POINT (is-a USER) (slot x) (slot y))")
>>> clips_instance = clips.BuildInstance("p1","POINT","(x 3) (y 5)")
>>> clips_instance.Send("get-x","")
<Integer 3>
>>> clips_instance.Send("get-z","")
<Symbol 'FALSE'>
>>> clips_instance.Send("get-y","")
<Symbol 'FALSE'>
>>> 

有没有可能避免这种情况或从这种状态中恢复?

4

0 回答 0