2016-05-06 50 views
0

我知道如何搜索檢查事實插槽是否存在,我需要知道如何獲得這一事實的其他插槽的價值我可以在搜索後檢索事實的價值嗎?剪輯

(deftemplate details 
(slot name(type STRING))(slot occ (type STRING))......) 
and 
(deffacts details 
    (details (occ "student")(name "mike")) 
    (details (occ "professor")(name "john")) 
    ....... 
) 

(defrule搜索

(用戶信息(OCC?OCC )) (詳細信息(OCC?OCC))

=> 

????????????????????????? )

回答

0

只要在規則條件下綁定它們:

(defrule search 
    (userinfo (occ ?occ)) 
    (details (occ ?occ) (name ?name)) 
    => 
    (printout t "Name is " ?name crlf))