Hi,
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:
-
I would help to pretty-print your rules. If you had, you could see that you
have (eq ?ov ?locality) (eq ?wv ?street) as patterns within an "and" to be
matched rather than (test (and (eq ?ov ?locality) (eq ?wv ?street))). By the
way, the outer "and" on the LHS of locality-stree is unnecessary.
The tests require using a test construct ...
(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))
(test
It would be more efficient to use pattern matching rather than test.
(defrule locality-street
(agreement (of-type "locality") (of-value ?ov)
(with-type "street") (with-value ?wv))
(potential-element (type "locality") (value ?locality&?ov))
(potential-element (type "stree