Any function calls can be put into an "if" control structure to make tests like this:

(if (eq ?distance 1) then
    (assert (outside...)))


On Sep 3, 2009, at 8:56 PM, Lucia Masola wrote:

Hi, I'm having some problems with a simple matter. I've written the following rule, but i need to do the assert only in case the variable ?distance is equals to 1 (one) and i don't know how to express that. I'll appreciate if anyone can help me with this!!

(defrule generate_outside_execution_relations
    "comment"
(call (call_id ?call_1) (caller_id ?method_X) (callee_id ? method_Y) (precedence ?precedence_1)) (call (call_id ?call_2) (caller_id ?method_X) (callee_id ? method_Z) (precedence ?precedence_2))
    =>
    (bind ?distance (- ?precedence_2 ?precedence_1))
(assert (outside_execution_relation (call_id ?call_1) (call_id2 ? call_2) (distance ?distance)))
 )



---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences          Phone: (925) 294-2154
Sandia National Labs
PO Box 969, MS 9012                            [email protected]
Livermore, CA 94550                             http://www.jessrules.com





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