Правило Клипы к ПРОЛОГУ - PullRequest
0 голосов
/ 29 декабря 2018

Каковы различия в создании правил между 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*)))
)
...