【问题标题】:Taking all values of multislot slot using the fact-address in CLIPS使用 CLIPS 中的事实地址获取多槽槽的所有值
【发布时间】:2014-07-09 00:46:15
【问题描述】:

是否有可能在剪辑中使用事实的事实地址以某种方式获取多槽槽中的所有值?例如:

(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 槽中的所有值,但看起来情况并非如此。根本不可能吗?

【问题讨论】:

  • 检索槽值的简写语法只能在事实集查询函数中使用。使用“(fact-slot-value ?f changeinfo)”而不是?f:changeinfo。

标签: clips expert-system inference-engine


【解决方案1】:

根据加里的评论:

检索槽值的简写语法只能在事实集查询函数中使用。使用 "(fact-slot-value ?f changeinfo)" 而不是 ?f:changeinfo

【讨论】:

    猜你喜欢
    • 2014-07-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-07
    • 2020-01-17
    • 1970-01-01
    相关资源
    最近更新 更多