English 中文(简体)
Clips matching expression is not working
原标题:

hello in clips i have this template:

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

and this fact :

(start 1 1)

then i have this claus in the LHS :

?start<-(start ?x ?y)

and i want to get the variable ?a1

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

it seems that it s not allowed to add to the variable "(+ ?x 1)" so how can i achieve what i want.

问题回答
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> 




相关问题
Expert System (?) algorithm

I have an algorithmic problem which can be reduced to this task: Suppose we have a list of n diseases and m symptoms. For each disease d and symptom s, we have one of three options: the symptom is ...

Dereferencing a Slot in a Matched Fact in Clips

How do you dereference a slot in a fact matched in the LHS of a rule? If a variable matches a fact, I can t find how to create further conditions that match slots within that fact. For example, in ...

Clips matching expression is not working

hello in clips i have this template: (deftemplate cell(slot x)(slot y)(slot alive)) and this fact : (start 1 1) then i have this claus in the LHS : ?start<-(start ?x ?y) and i want to get ...

How to read line in CLIPS?

I need to read a string in CLIPS so i m usign (readline) but it doesn t seem to work. It doesn t let me enter anything and it just returns "". Any ideea what s the issue? CLIPS> (readline) "" ...

Pruning Deductions in Expert Systems

In a rule system, or any reasoning system that deduces facts via forward-chaining inference rules, how would you prune "unnecessary" branches? I m not sure what the formal terminology is, but I m just ...

what languages are used in AI research today?

I am currently dabbling in expert systems, emacs lisp, and reading up about artificial intelligence. Traditionally, artificial intelligence is associated with LISP and expert systems with CLIPS. ...

Neural Network Expert System

Does anyone know how to emulate an Expert Systems using Neural Networks? An example of this is the 20q.net website. I m more curious to how the network would be designed; ie how many inputs, what the ...

热门标签