0

クリップでこんにちは、私はこのテンプレートを持っています:

(deftemplate cell(slot x)(slot y)(slot alive))

そしてこの事実:

(start 1 1)

それから私はLHSにこの節を持っています:

?start<-(start ?x ?y)

変数を取得したい?a1

(cell (x (+ ?x 1) )(y ?y)(alive ?a1))

変数に追加することは許可されていないよう"(+ ?x 1)"です。どうすれば私が望むものを達成できますか。

4

1 に答える 1

1
CLIPS> (deftemplate cell (slot x) (slot y) (slot alive)) 
CLIPS>  
(deffacts initial
    (start 1 1)
    (cell (x 2) (y 1) (alive yes)))
CLIPS>     
(defrule example
    (start ?x ?y)
    (cell (x =(+ ?x 1)) (y ?y) (alive ?a1))
    =>
    (printout t "?a1 = " ?a1 crlf))
CLIPS> (reset)
CLIPS> (run)
?a1 = yes
CLIPS> 
于 2011-02-17T17:16:46.940 に答える