人工智能clips第二部分

日期:2019-08-26     浏览:77    下载:0     体积:79.5K     评论:0    


您还没有登录,请登录后查看详情


 CLIPS变量的组成总是由一个问号和一个标识字段名组成(必须由一个字符开头)
如:?speed     ?sensor   ?noun    ?color  (问号的标识字段之间没有空格)
说明:在规则的LHS上可使用变量保存槽值,这些槽值可与规则的LHS上的其它值想比较,或者可以在规则的RHS上访问这些槽值。
例如:
(deftemplate person
(slot name)
(slot eyes)
(slot hair))
(deffacts people 
(person (name jane) (eyes blue) (hair red))
(person (name jack) (eyes blue) (hair black)))
(defrule find-blue-syss
person (name ?name) (eyes blue)
=>
(printout t ?name”has blue eyes.” crlf))
运行结果:jack has blue eyes.
    jane has blue eyes.
 
打赏
0相关评论
本类推荐
下载排行

(c)2008-2019 AI-BI.CN SYSTEM All Rights Reserved

服务热线:400-027-0706 ICP备案号:京ICP备19054748号-1