【问题标题】:Using find fact in CLIPS在 CLIPS 中使用 find fact
【发布时间】:2017-04-03 02:21:49
【问题描述】:

我有一个事实

(is-started TRUE)

我想知道事实是否存在

(any-factp ((?is (is-started TRUE))) TRUE)

但这让我缺少 is-started 的函数声明。

我如何使用 any-factp 确定这个事实是否存在?

【问题讨论】:

    标签: clips expert-system


    【解决方案1】:

    隐含的deftemplate事实的字段可以使用隐含定义的名为implicit的多字段槽来访问:

    CLIPS> (assert (is-started TRUE))
    <Fact-1>
    CLIPS> (any-factp ((?f is-started)) TRUE)
    TRUE
    CLIPS> (any-factp ((?f is-started)) (eq ?f:implied (create$ TRUE)))
    TRUE
    CLIPS> (any-factp ((?f is-started)) (eq ?f:implied (create$)))
    FALSE
    CLIPS> 
    

    【讨论】:

    • 感谢您的示例,文档中不太清楚
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多