Consider the following example:
 
(deftemplate entity
    (multislot attributes)
)
 
Now consider an extremely simple instance
 
(bind ?e (assert (entity (attributes (create$ 1 2 3 4 5 6 7 8 9 10)))))
 
I am asking if there is a way to write a Jess rule LIKE:
 
(defrule match-a-seven
    ?e <- (entity (attributes $&*pre 7 $&*post)) ;;; match an entity whose attribues are pre followed by 7 followed by post
                                                       ;;; where pre is zero or more elements and post is zero or more elements
    =>
    (printout t "Found 7" crlf)
    (modify ?e (attributes (union$ $&pre $&post)))   ;; update so it need not find it again
)
 
Thanks for any pointers in advance.
 
Sukesh Patel
 

Reply via email to