As Wolfgang points out, this pseudocode is far enough from real Jess
code that I can't quite tell what it's intended to do.
To determine if an actual variable is bound or not, you could use a
deffunction like this:
(deffunction bound (?name)
((context) isVariableDefined ?name))
which you could call as "(bound x)", where x is the name of the
variable without the leading "?". But I don't see anything in your
pseudocode where this would actually apply.
On Oct 7, 2008, at 3:59 AM, David Pautler 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) ))
---------------------------------------------------------
Ernest Friedman-Hill
Informatics & Decision Sciences, Sandia National Laboratories
PO Box 969, MS 9012, 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]
--------------------------------------------------------------------