There are several problems with this rule.

The notion of a slot of some fact being bound doesn't make sense. A slot
always has a value, possibly nil, and you can simply compare a slot to
this symbol.

You cannot simply write a boolean function as another term in a
rule's LHS. So, the (< ...) must be wrapped in a test, but it would be better
to have this test in the pattern for the currentTimeStep fact.

The two opening parentheses after "=>" are in error.

You cannot - and need not - re-assert ?Outcome. Use the modify function
to update a fact's slot value, e.g.,
    (modify ?Outcome (time ?T))

Please consult the Jess manual for more detailed explanations.
-W

On Tue, Oct 7, 2008 at 9:59 AM, David Pautler <[EMAIL PROTECTED]> wrote:
> How can one test if a var is bound or not bound (rather than testing if it's
> bound or not to a specific value)?
>
> For example, I would like to write something like this:
>
> (defrule causation-1
>     "When a causal trigger is present, the outcome occurs"
>     (and (cause (trigger ?Trigger) (outcome ?Outcome))
>          (test (not (bound ?Outcome.time)))                    ;test of
> whether ?Outcome.time is bound
>          (currentTimeStep ?T)
>          (< ?Trigger.time ?T) )
>     =>
>     ((assert ?Outcome)
>      (bind ?Outcome.time ?T) ))
>


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