This is certainly a candidate for the FAQ.
The answer is that no, sorry, you can't do this. You can't do it in
CLIPS, so originally you couldn't do this in Jess, either.
Now, so many people have asked for this that I'm beginning to wonder
if it wouldn't be worth figuring out how to implement it. It's not
quite as simple as you'd think, but it could be done.
I think Mike Leiper wrote:
> Hello all,
>
> I want to calculate expressions in the left hand side of a JESS rule
> and bind these expressions to variables so that I can refer to
> these variables in the right hand side of the rule. Is this possible?
>
> Example:
> (defrule Test
> (GROSS (VALUE ?g))
> (COST (VALUE ?c))
> (test (<= (- ?g ?c) 1000))
> =>
> (printout t (- ?g ?c) crlf)
>
> I would like to bind (-?g ?c) to a variable (say ?r) in the left hand
> side and then use that variable in (test (<= ?r 1000)) and also
> (printout t ?r crlf).
>
> I know that I can use the 'bind' function in the RHS of a rule but have
> been unsuccessful using it
> in the LHS of a rule. I'm sure someone has done this before. I'm new to
> JESS and expert systems
> and can't find how to do this in the JESS documentation.
>
> Thank you. This mail group has been very helpful in getting me aquainted
> with JESS.
>
> mike
>
>
> ---------------------------------------------------------------------
> 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]
> ---------------------------------------------------------------------
>
---------------------------------------------------------
Ernest Friedman-Hill
Distributed Systems Research Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
Org. 8920, MS 9012 [EMAIL PROTECTED]
PO Box 969 http://herzberg.ca.sandia.gov
Livermore, CA 94550
---------------------------------------------------------------------
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]
---------------------------------------------------------------------