是否有可能在剪辑中使用事实的事实地址以某种方式获取多槽插槽中的所有值?例如:
(deftemplate MAIN::simplecause
(multislot coraxinfo (type INTEGER) (default 0))
(multislot changeinfo (type SYMBOL) (default undefined)))
(deftemplate MAIN::finalcause
(multislot coraxinfo (type INTEGER) (default 0))
(multislot changeinfo (type SYMBOL) (default undefined)))
(deftemplate MAIN::finalcausefinal
(multislot coraxinfo (type INTEGER) (default 0))
(multislot changeinfo (type SYMBOL) (default undefined))
(slot casecount (type INTEGER) (default 2)))
我有一个名为 count-coraxes 的函数,它在输入中接收多槽值,所以我尝试编写这样的规则:
(defrule final_cause_reason_count
?f <- (finalcause (coraxinfo ?corax $?) (changeinfo ?change $?))
(simplecause (coraxinfo $? ?corax $?) (changeinfo $? ?change $?))
=>
(assert (finalcausefinal(coraxinfo ?f:coraxinfo) (changeinfo ?f:changeinfo) (casecount (count-coraxes ?f:coraxinfo)))))
我假设 ?f:coraxinfo 将使用 factadress ?f 提取 coraxinfo 插槽中的所有值,但看起来情况并非如此。根本不可能吗?