I have tried loading the following code with the batch command, then
(run)ing the whole lot, unfortunately my rule is not firing. I was expecting
the rule to fire, and as a result there should be several new
locality-street-match facts.

The code includes:

(watch activations)

(deftemplate potential-element (slot type)(slot value) )
(deftemplate agreement (slot of-type)(slot of-value)(slot with-type)(slot
with-value) )
(deftemplate locality-street-match (slot locality-value)(slot street-value)

(defrule locality-street (and (agreement (of-type "locality")(of-value
?ov)(with-type "street")(with-value ?wv)) (potential-element (type
"locality")(value ?locality)) (potential-element (type "street")(value
?street)) (eq ?ov ?locality) (eq ?wv ?street) ) => (assert
(locality-street-match (locality-value ?locality)(street-value ?street) ) )

(assert (potential-element (type "locality")(value "south perth") ) )
(assert (potential-element (type "locality")(value "wembley") ) )
(assert (potential-element (type "locality")(value "bentley") ) )
(assert (potential-element (type "locality")(value "floreat") ) )
(assert (potential-element (type "locality")(value "osborne park") ) )

(assert (potential-element (type "street")(value "marlow") ) )
(assert (potential-element (type "street")(value "coode") ) )
(assert (potential-element (type "street")(value "jutland") ) )
(assert (potential-element (type "street")(value "grantham") ) )
(assert (potential-element (type "street")(value "giles") ) )

(assert (agreement (of-type "locality")(of-value "south perth")(with-type
"street")(with-value "coode") ) )
(assert (agreement (of-type "locality")(of-value "wembley")(with-type
"street")(with-value "marlow") ) )
(assert (agreement (of-type "locality")(of-value "dalkeith")(with-type
"street")(with-value "jutland") ) )
(assert (agreement (of-type "locality")(of-value "wembley")(with-type
"street")(with-value "grantham") ) )
(assert (agreement (of-type "locality")(of-value "floreat")(with-type
"street")(with-value "marlow") ) )


then I (run) it.

Any ideas? - thank you so much.


Matthew Hutchinson
Ph.D. Candidate
Department of Spatial Sciences
Curtin University of Technology
GPO Box U1987
Perth, Western Australia 6845

Visiting Scholar
Department of Geography and Planning
University of Akron
Akron, Ohio USA

Reply via email to