I didn't see a reply from anyone but you, Ernest. No Wolfgang.
A triggering fact I had in mind was...'moving an obj causes it to be at a new
location'...
(cause (trigger (do (agent ?p1) (act physMove) (obj ?o1) (from ?from1) (to
?to1) (time ?t1)))
(outcome (physLoc (obj ?o1) (loc ?to1) (time =(+ ?t1 1)))) )
There may be grounded instantiations of this in wm, so my rule tests that the
time is unbound before asserting the outcome part. (maybe I need to wrap the
?Outcome consequent in 'assert' also - i'm still trying to get a feel for how
to encode my FOPC.)
-----Original Message-----
From: "Ernest Friedman-Hill" <[EMAIL PROTECTED]>
To: "jess-users" <[email protected]>
Sent: 10/7/08 9:24 PM
Subject: Re: JESS: How to test if a var is bound/not-bound?
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]
--------------------------------------------------------------------
--------------------------------------------------------------------
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]
--------------------------------------------------------------------