我可以在搜索后检索事实的价值吗?剪辑
can i retrieve fact's value after searching for it? Clips
我知道如何搜索以检查事实槽是否存在,我需要知道如何获取该事实中其他槽的值
(deftemplate details
(slot name(type STRING))(slot occ (type STRING))......)
and
(deffacts details
(details (occ "student")(name "mike"))
(details (occ "professor")(name "john"))
.......
)
(阻止搜索
(用户信息(occ?occ))
(详细信息(occ?occ))
=>
???????????????????
)
在规则的条件下绑定即可:
(defrule search
(userinfo (occ ?occ))
(details (occ ?occ) (name ?name))
=>
(printout t "Name is " ?name crlf))
我知道如何搜索以检查事实槽是否存在,我需要知道如何获取该事实中其他槽的值
(deftemplate details
(slot name(type STRING))(slot occ (type STRING))......)
and
(deffacts details
(details (occ "student")(name "mike"))
(details (occ "professor")(name "john"))
.......
)
(阻止搜索
(用户信息(occ?occ)) (详细信息(occ?occ))
=>
??????????????????? )
在规则的条件下绑定即可:
(defrule search
(userinfo (occ ?occ))
(details (occ ?occ) (name ?name))
=>
(printout t "Name is " ?name crlf))