JESS: [Q] Using (bind ...) function in JESS

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

JESS: [Q] Using (bind ...) function in JESS

Young-Jin Lee-4
Dear all,

While following the "Jess in action" book to learn JESS, I run into a question.

On page 207 of the book, there is one line of code that I cannot understand fully. The part of the Listing 13.1 has (bind ?s ?question " ") and I don't quite understand why the additional " " was used in this bind method.

I tried to see the effect of the additional " " by experimenting it in the JESS command line, but did not find any meaningful difference.
For example,
JESS prompt> (bind ?question "Hello")
JESS prompt> (bind ?s ?question " ")
JESS prompt> ?s ;; returns "Hello" without the space
JESS prompt> (bind ?question "Hello")
JESS prompt> (bind ?s ?question "123")
JESS prompt> ?s ;; returns only "Hello" without 123

Can any one explain when I need to use additional " " or any string in the bind method in JESS?

Thanks in advance.

Young-Jin Lee  



--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

Re: JESS: [Q] Using (bind ...) function in JESS

Friedman-Hill, Ernest
Looks like an error in the book. Thanks for reporting it.


On Feb 15, 2011, at 10:31 AM, GMail (KU) wrote:

> Dear all,
>
> While following the "Jess in action" book to learn JESS, I run into  
> a question.
>
> On page 207 of the book, there is one line of code that I cannot  
> understand fully. The part of the Listing 13.1 has (bind ?s ?
> question " ") and I don't quite understand why the additional " "  
> was used in this bind method.
>
> I tried to see the effect of the additional " " by experimenting it  
> in the JESS command line, but did not find any meaningful difference.
> For example,
> JESS prompt> (bind ?question "Hello")
> JESS prompt> (bind ?s ?question " ")
> JESS prompt> ?s ;; returns "Hello" without the space
> JESS prompt> (bind ?question "Hello")
> JESS prompt> (bind ?s ?question "123")
> JESS prompt> ?s ;; returns only "Hello" without 123
>
> Can any one explain when I need to use additional " " or any string  
> in the bind method in JESS?
>
> Thanks in advance.
>
> Young-Jin Lee
>

---------------------------------------------------------
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 [hidden email]'
in the BODY of a message to [hidden email], NOT to the list
(use your own address!) List problems? Notify [hidden email].
--------------------------------------------------------------------

Reply | Threaded
Open this post in threaded view
|

JESS: reasoning about Jess Rules

Nadia Abchiche
In reply to this post by Young-Jin Lee-4
Dear all,

What I want to do with Jess is to reason about the LHS and RHS rules, to
know for example, about the rules whitch conclude to the same RHS and
which are activated. It's a kind of conflicting set for the same conclusion.
Is there any way to deal with the RHS as a Jess fact?

Thanks in advance,
Nadia

nadia_abchiche.vcf (308 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: JESS: reasoning about Jess Rules

Wolfgang Laun-2
You can access objects of class Defrule using the API. Methods getNActions() and getAction( int i ) let you retrieve all the actions, which are of type Funcall. You can create facts from this information.

And then? How do you intend to reason over these facts? Even the simple task of determining whether two sequences of Funcalls are equal is by no means easy.

-W


On 17 June 2011 12:13, Nadia Abchiche <[hidden email]> wrote:
Dear all,

What I want to do with Jess is to reason about the LHS and RHS rules, to know for example, about the rules whitch conclude to the same RHS and which are activated. It's a kind of conflicting set for the same conclusion.
Is there any way to deal with the RHS as a Jess fact?

Thanks in advance,
Nadia