I think Rich wrote:
> (defrule AC01
> (input (num ?n&:(eq ?n 4)))
> (block (value $?x&:(eq (first$ $?x) -2)))
> =>
> (printout t "AC01" crlf))
>
The first$ function returns a list consisting of the first item in its
argument list. That single-item list is not equal to the number -2, so
this rule doesn't get activated. Before you complain, note that the
semantics of the first$ function are inherited from CLIPS -- I didn't
design it.
Now, in any event, you shouldn't use functions when you can match
things directly instead (I feel like I'm repeating myself a lot
lately...) The following rule is exactly the same as what you
intended, but more efficient and easier to read, too.
(defrule AC01
(input (num 4))
(block (value -2 $?rest))
=>
(printout t "AC01" crlf))
---------------------------------------------------------
Ernest Friedman-Hill
Science and Engineering PSEs 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]
--------------------------------------------------------------------