expert system - CLIPS constant compiler directive -


similar compiler directive constants in c, there way can following in clips?

#define infinity 1000000000  (deftemplate foo     (slot num (type integer) (default infinity)) )  ...  (defrule bar     (foo (num infinity))     =>     ... ) 

you can define global variable , treat constant:

clips> (defglobal ?*infinity* = 1000000000) clips>  (deftemplate foo     (slot num (type integer) (default ?*infinity*))) clips>  (defrule bar    (foo (num ?num&:(eq ?num ?*infinity*)))    =>) clips> (assert (foo)) <fact-1> clips> (facts) f-0     (initial-fact) f-1     (foo (num 1000000000)) total of 2 facts. clips> (agenda) 0      bar: f-1 total of 1 activation. clips>  

Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -