One might very well argue that the automatic definition of a template for ordered facts, as in
(defrule r (t 1 ?two) => ... )
or any fact definition is somewhat dangerous since it might cover up anything from a simple typos to a major syntax error. Adding the option of suppressing the auto-definition of ordered templates would be one way. Another way is the study of cross-references for templates by rules and queries, and vice versa. For obtaining the latter, see http://herzberg.ca.sandia.gov/jesswiki/view?TempsByRulesUserFunction and http://herzberg.ca.sandia.gov/jesswiki/view?RulesByTempsUserFunction

Cheers
Wolfgang


Robert Kirby wrote:

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.

Bob Kirby

At 11:48 AM 7/30/2007, Matthew J Hutchinson wrote:
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:
-----------------------------------------------

(reset)
(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.

Cheers,
Matt




--
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

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------


--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to