Hi,

I am wondering whether the following would accomplish what you wanted.

Here is the complete clp file. You can change the weight of the door at
the bottom of the clp file.

(import House)
(import Door)

(deftemplate House
    (declare (from-class House)
                 (include-variables TRUE)))

(deftemplate Door
    (declare (from-class Door)
                 (include-variables TRUE)))

(defrule rule
    (House (door ?door&:(> (?door getWeight) 25)))
    =>
    (printout t "weight: " (?door getWeight) crlf)
)
;
; create a House
(bind ?house (new House))

; create Door and add it to the House
(bind ?door (new Door))
(?house setDoor ?door)
(set-member ?door weight 22)

; add the house to the working memory
(add ?house)

(run)


I hope this helps.

Son

Reply via email to