I think roberval.rao wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hi all
>
> I'm trying to acess a fact already asserted and I've tried
> some ways but the used rule only skips.
> This is a part of the code:
>
...
> (assert (important_fact ?x)) ;?x is a list
...
>
> (defrule thi_rule ; this rule is not firing
> ?aux1 <- (important_fact ?x)
When you pattern-match an ordered fact, each regular variable stands
in for one data item in the fact. This pattern matches only if the
list you asserted previously contained exactly one item. This pattern
(important_fact ?x ?y ?z)
matches only if the list was three items long. If you want to match
any number of items, you have to use a multifield:
(important_fact $?x)
This matches any number of items in a list; on the RHS of the rule,
all the items are bound to the variable $?x (or ?x, it's the same
thing) as a list.
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
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]
--------------------------------------------------------------------