规则片段到PROLOG

时间:2018-12-29 16:44:02

标签: prolog clips

在CLIPS和PROLOG之间创建规则有什么区别? 如果我有一个CLIPS规则(如示例中所示),那么它在PROLOG中的翻译是什么?

(defrule Rule1
(declare (salience 1))
?a<-(factf (classfact agg|sost|nonst|scon)(valore ?x)(idstruttura ?id)(pos ?n) )
?canc<-(fn (inter[ ?sin)(componenti $?comp)(genere ?gen)(numero ?num)(]inter ?des) )
(not (fn (inter[ ?sin)(]inter ?n)))
(test (= ?n (+ 1 ?des)))
=>
(retract ?canc)
(bind ?*idstruct* (+ 1 ?*idstruct*))
(printout t  crlf"********** Rule1 **********"crlf)
(assert (fn (inter[ ?sin)(componenti  $?comp ?id)(genere ?gen)(numero ?num)(]inter ?n)(idstruttura ?*idstruct*)))
)

0 个答案:

没有答案