JESS: [EXTERNAL]

2013-02-19 Thread Ernest Friedman-Hill
7])
by mailgate2.sandia.gov (8.14.4/8.14.4) with ESMTP id r0559c8F004910
for ; Fri, 4 Jan 2013 22:09:38 -0700
Received: from sentry-four.sandia.gov (localhost.localdomain [127.0.0.1])
by localhost (Email Security Appliance) with SMTP id 
B61E913EE057_E7B592B
for ; Sat,  5 Jan 2013 05:09:38 + (GMT)
Received: from sentry.sandia.gov (mm03snlnto.sandia.gov [132.175.109.20])
by sentry-four.sandia.gov (Sophos Email Appliance) with ESMTP id 
8F5EB13EB=
683_E7B592F
for ; Sat,  5 Jan 2013 05:09:38 + (GMT)
Received: from [132.175.109.17] by sentry.sandia.gov with ESMTP (SMTP
 Relay 01 (Email Firewall v6.3.2)); Fri, 04 Jan 2013 22:09:29 -0700
X-Server-Uuid: AF72F651-81B1-4134-BA8C-A8E1A4E620FF
X-WSS-ID: 0MG4ZNQ-0C-0P1-02
X-TMWD-Spam-Summary: TS=3D20130105050926; ID=3D1; SEV=3D2.4.4;
 DFV=3DB2013010506; IFV=3DNA; AIF=3DB2013010506; RPD=3D7.03.0049; ENG=3DNA;
 RPDID=3D7374723D303030312E30413031303230322E35304537423538382E303033432C73=
733D312C72653D302E3030302C6667733D30;
 CAT=3DNONE; CON=3DNONE; SIG=3D0VXSqwAAAg=3D=3D
X-TMWD-IP-Reputation: SIP=3D209.85.210.171;
 IPRID=3D7469643D303030312E30413031303330322E35304537423538372E30303146;
 CTCLS=3DR5; CAT=3DUnknown
Received: from mail-ia0-f171.google.com (mail-ia0-f171.google.com
 [209.85.210.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No
 client certificate requested) by sentry-three.sandia.gov ( Postfix)
 with ESMTP id 2B0E84643FF for ; Fri, 4 Jan 2013
 22:09:25 -0700 ( MST)
Received: by mail-ia0-f171.google.com with SMTP id k27so14445348iad.16
 for ; Fri, 04 Jan 2013 21:09:27 -0800 (PST)
DKIM-Signature: v=3D1; a=3Drsa-sha256; c=3Drelaxed/relaxed; d=3Dgmail.com;
 s=3D20120113;
 h=3Dmime-version:x-received:sender:date:x-google-sender-auth:message-id :
 subject:from:to:content-type;
 bh=3DNbWHpPWjsr1y3psWS5nSuCyIanVTGrw/ueEn4B3ZJ30=3D;
 b=3DcVyPc3IMqmwgJkt5lk+Znbf16baGRo0KZj5VNxwmKZyeNz9Wa1O1LOiJewL99QrV3W
 oLr6QKuTmzFllAncgeNZ4T8bC74wtC7qj/fNsxdES29w/fpJIS6JeFoX0Q3SbxaRuCRu
 iDOJeyVr5YbQFLPjI26LuzNXmJ5wrS7CSjbzlSAzmaCjy+GKjcRfAH+h8XPs9/0LEH/h
 3AUjltDhtX64K02XlIl6GP1tMp21ZLb+uSXFflStUNnyNzPAm1aRtRlHwkHPQyd25j/9
 VYJGRoEwqjLuc0Yu35h1U9K4OK7+OOcrPNO2ek60E7USjW62BYa15lVdX1WclXKMIfm8
 YDjQ=3D=3D
MIME-Version: 1.0
X-Received: by 10.50.163.98 with SMTP id yh2mr782401igb.2.1357362567526;
 Fri, 04 Jan 2013 21:09:27 -0800 (PST)
Sender: gret...@gmail.com
Received: by 10.64.45.201 with HTTP; Fri, 4 Jan 2013 21:09:27 -0800 (
 PST)
Date: Fri, 4 Jan 2013 23:09:27 -0600
X-Google-Sender-Auth: bGz_8nfUup2r7jFexVK35HW9BME
Message-ID: 
Subject: Slowly documenting project setup steps
From: "Grant Rettke" 
To: jess-users@sandia.gov
X-TMWD-Spam-Summary: TS=3D20130105050932; ID=3D2; SEV=3D2.3.1;
 DFV=3DB2012110920; IFV=3DNA; AIF=3DB2012110920; RPD=3D5.03.0010; ENG=3DNA;
 RPDID=3D7374723D303030312E30413031303230322E35304537423538422E303032302C73=
733D312C6667733D30;
 CAT=3DNONE; CON=3DNONE; SIG=3DfQ=3D=3D
X-MMS-Spam-Filter-ID: B2012110920_5.03.0010
X-WSS-ID: 7CF96A030I89503247-01-01
Content-Type: multipart/alternative;
 boundary=3De89a8f642ec6ab384004d2839972
X-Sophos-ESA: [sentry-four.sandia.gov] 3.7.6.0, Antispam-Engine: 2.7.2.1390=
750, Antispam-Data: 2013.1.5.45414


--e89a8f642ec6ab384004d2839972
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
 charset=3Dutf-8

http://www.wisdomandwonder.com/article/6891/jess-sample-java-setup-project-=
mission-statement

--e89a8f642ec6ab384004d2839972
Content-Transfer-Encoding: 7bit
Content-Type: text/html;
 charset=3Dutf-8

http://www.wisdomandwonder.com/article/6891/jess-sample-java-set=
up-project-mission-statement">http://www.wisdomandwonder.com/article/6891/j=
ess-sample-java-setup-project-mission-statement

--e89a8f642ec6ab384004d2839972--


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: External Address

2004-11-24 Thread malka
Hi,

I have a problem.

I would like to use a class into Jess who return the Class Type :

Here this is my class with the Method Calcul_Float

public class Librairie_Bancaire
{
public Librairie_Bancaire(){}

public -->Float<-- Calcul_Float(Float toto)
{
toto = toto.Div(100);
System.out.println("tutu");
return (toto);
}
}

The  type Float come from another Class.

In jess i made :

(defclass lib fr.ca.robien.moteur.Librairie_Bancaire)
(defglobal ?*lib_banc* = (new fr.ca.robien.moteur.Librairie_Bancaire))

(defclass float fr.ca.robien.tools.Float)
(defglobal ?*flot* = (new fr.ca.robien.tools.Float 45 -1)) --> note i use the
constructor directly

;test float
(defrule test_float
?p <- (Robien (nom_client ?n) (taux ?t)) --> this is a template
=>
(bind ?res (call ?*lib_banc* Calcul_Float ?*flot*))
(printout t ""%?res"" crlf)
)

Jess show me ""

I don't know how to get the Value.

Thank you

Dan MALKA


Groupe E.S.I.E.A.
www.intechinfo.fr


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]




Re: JESS: External Address

2004-11-24 Thread ejfried
I think [EMAIL PROTECTED] wrote:

> (defrule test_float
>   ?p <- (Robien (nom_client ?n) (taux ?t)) --> this is a template
>   =>
>   (bind ?res (call ?*lib_banc* Calcul_Float ?*flot*))
>   (printout t ""%?res"" crlf)
> )
> 
> Jess show me ""

The same way you would get it in Java -- by calling the floatValue()
method:

(printout t "%" (?res floatValue) "" crlf)




-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]




Re: JESS: External Address

2004-11-24 Thread malka
Selon [EMAIL PROTECTED]:

> I think [EMAIL PROTECTED] wrote:
>
> > (defrule test_float
> > ?p <- (Robien (nom_client ?n) (taux ?t)) --> this is a template
> > =>
> > (bind ?res (call ?*lib_banc* Calcul_Float ?*flot*))
> > (printout t ""%?res"" crlf)
> > )
> >
> > Jess show me ""
>
> The same way you would get it in Java -- by calling the floatValue()
> method:
>
> (printout t "%" (?res floatValue) "" crlf)
>
>
>
>
> -
> Ernest Friedman-Hill
> Advanced Software Research  Phone: (925) 294-2154
> Sandia National LabsFAX:   (925) 294-2234
> PO Box 969, MS 9012 [EMAIL PROTECTED]
> Livermore, CA 94550 http://herzberg.ca.sandia.gov
>
> 
> 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]
> 
>
>

The problem is ther is no method who return a value into my class there is only
a constructor...




Groupe E.S.I.E.A.
www.intechinfo.fr




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]




Re: JESS: External Address

2004-11-24 Thread ejfried
I think [EMAIL PROTECTED] wrote:

> 
> The problem is ther is no method who return a value into my class there is 
> only
> a constructor...
> 

In Java. when you call, say, System.out.println(anObject), the method
indirectly calls anObject.toString() and prints the result. That's
what you want to do here.

This comes up so often as a newbie problem, and I've become so weary
of explaining it, that maybe it really needs to be changed. Either
printout should call anObject.toString() and display that, or
Value.toString() should do so. The drawback for me, personally, is
that for objects that don't override toString(), the printed value
would vary at runtime, breaking some automated tests. But perhaps this
could be handled with a "test mode" runtime switch that could revert
to the old behavior.

Would anybody be greatly inconvenienced if Value.toString() forwarded
to m_object.toString() for EXTERNAL_ADDRESS types?



-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov


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]




Re: JESS: External Address

2004-11-25 Thread malka
Ok great i understand..now it work

thank you ;)

Dan


Groupe E.S.I.E.A.
www.intechinfo.fr


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]




RE: JESS: External Address

2004-11-25 Thread Sr. Hernan Flores
Hello,
I4m just begining with Jess. I Would like to use (view) command from Java.
Could somebody tell how could I do it, or better, send me an example.

Thank you.

Hernan

-Mensaje original-
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
nombre de [EMAIL PROTECTED]
Enviado el: Jueves, 25 de Noviembre de 2004 06:34
Para: [EMAIL PROTECTED]
Asunto: Re: JESS: External Address


Ok great i understand..now it work

thank you ;)

Dan


Groupe E.S.I.E.A.
www.intechinfo.fr


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]




RE: JESS: External Address

2004-11-25 Thread malka
Hi,

you can make like this :

import jess.*;

Rete r = new Rete();
r.executecommand("(view)");

good luck

Dan


Selon "Sr. Hernan Flores" <[EMAIL PROTECTED]>:

> Hello,
> I4m just begining with Jess. I Would like to use (view) command from Java.
> Could somebody tell how could I do it, or better, send me an example.
>
> Thank you.
>
> Hernan
>
> -Mensaje original-
> De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> nombre de [EMAIL PROTECTED]
> Enviado el: Jueves, 25 de Noviembre de 2004 06:34
> Para: [EMAIL PROTECTED]
> Asunto: Re: JESS: External Address
>
>
> Ok great i understand..now it work
>
> thank you ;)
>
> Dan
>
> 
> Groupe E.S.I.E.A.
> www.intechinfo.fr
>
> 
> 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]
> 
>
>




Groupe E.S.I.E.A.
www.intechinfo.fr


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]




JESS: [EXTERNAL] loop with facts

2011-11-23 Thread nikos erinis
hi fellows,
i m doing my master-thesis for a civil engineering project and i m using
protege with jess-tab.
i want to make a rule-based system that has "artificial intelligence" and
can "prognose" the next step of the project.
of course i dont have any idea about programming and i m having
difficulties solving the lightest problems.

for example:

i have some pre-defined facts in protege. these facts have a slot named
"classification" and its an integer-slot with allowed values "1, 2, 3 and
4",
but this is not important. whats important is that i want to exclude all
the instances that have a different classification-slot than the above two
and the bellow two facts.
so i thought i need a loop that only compares the one instance with the
other four instances.
the thing is i dont know how to access the facts and how to do the loop. i
can show (printout t) the facts but i cannot exclude some of them due to a
comparison.
any help will be appreciated.

thx a lot, nikos


JESS: [EXTERNAL] Jess Licensing Question

2012-03-05 Thread Yuan Rao

Does anyone have experience licensing Jess for commercial use?

My employer is interested in licensing the software. But getting formal 
references from Sandia turns out would take longer than we'd expected. While 
waiting for Sandia's formal references to come through, I wonder if anyone here 
have had some experience they wouldn't mind sharing.

If you have licensed the software and have anything to say about your 
experience using the software in commercial environment, the process of 
licensing it, and any lessons learned, I'd really appreciate it.

Thanks!

Yuan
  

Re: JESS: [EXTERNAL] Jess Error

2012-03-06 Thread Friedman-Hill, Ernest
Jess is involved here, but this is not a Jess problem per se. As the error
message says, a third-party Jess script called a Java method
"loadOWLResource" in some third-party code, and that Java method threw an
exception. Jess, in turn, throws an exception to report this. The Jess
exception object makes the third-party exception available via the
Throwable.getCause() method, but based on the below it looks like the
third-party code in which Jess is embedded is not calling that method and
reporting the root cause exception.

So in any case, Jess is doing everything it's supposed to do here; the
fault lies with the various other pieces of software you're using, so
you'll want to talk to those vendors to help you figure out what's wrong.



On 3/4/12 5:32 PM, "Faten"  wrote:

>Hello,
>My goal is to test an example with the algorithm "OWL-S Matcher".
>
>I created a folder: "BravoAirService" under the folder examples ".
>Then I put in the folder: "BravoAirService" the following files:
>BravoAirService.owl, BravoAirGrounding.owl, BravoAirProcess.owl,
>BravoAirProfile.owl
>Now I want to run "MatchingGUI.java".
>The interface "OWL-S Matching Interface" is displayed. I click "Open
>Requested File".
>I did not understand exactly the path to choose in my case.
>I tried with the path of : "BravoAirService.owl".
>and also I tried writing this path:
>"http://localhost:80/BravoAirService/BravoAirService.owl";  and
>writing the path: 
>"http://localhost:80/BravoAirService/BravoAirProcess.owl";
>But nothing happens and in console I get:
>
>Exception in thread "Thread-3" OWLJessKBError:
>Error running rete to apply semantics
>Jess reported an error in routine call
>   while executing (call ?*owljesskb* loadOWLResource ?x FALSE)
>   while executing deffunction loadOWL
>   while executing (loadOWL ?import)
>   while executing defrule MAIN::owl-imports-ontologies.
>  Message: Called method threw an exception.
>   at
>edu.drexel.gicl.semanticweb.owljesskb.error.DefaultSystemError.reteRunErro
>r(Unknown
>Source)
>   at 
>edu.drexel.gicl.semanticweb.owljesskb.OWLJessKB.loadOWLResource(Unknown
>Source)
>   at 
>edu.drexel.gicl.semanticweb.owljesskb.OWLJessKB.loadOWLResource(Unknown
>Source)
>   at de.tuberlin.ivs.owl.matching.Reasoner.loadOwlFile(Reasoner.java:157)
>   at de.tuberlin.ivs.owl.service.OwlsParser.parse(OwlsParser.java:136)
>   at de.tuberlin.ivs.owl.gui.LoadThread.run(LoadThread.java:94)
>
>
>
>Please have you any idea about my problem?
>Thank you in advance.
>
>
>--
>View this message in context:
>http://jess.2305737.n4.nabble.com/Jess-Error-tp504p504.html
>Sent from the Jess mailing list archive at Nabble.com.
>
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Second order JESS?

2012-04-16 Thread Sam Sarjant
Hello,
  I'm looking to use JESS within an application where second-order logic is
needed (or at least it makes things easier). Does JESS support second-order
logic in any form?

For example, a rule such as:
(ruleDef (factPredicate ?foo) (factArgs ?bar))
=>
(assert (?foo ?bar)))

is an example of the structure I am looking for (where factPredicate is a
String slot and factArgs is a multislot). The LHS of the rule compiles fine
(with the appropriate ruleDef deftemplate), but the RHS throws an exception
as it is expecting a template name after assert.

-- 
- Thanks, Sam Sarjant
www.samsarjant.com


JESS: [EXTERNAL] Jess and negation

2012-07-11 Thread André Lämmer
Hello,

 

Do I have the same problems in Jess with negation and disjunction like with
horn clauses in prolog?

 

Best regards,

 

André Lämmer



JESS: [EXTERNAL] Ordered facts question

2012-10-11 Thread Grant Rettke
Hi,

I'm working on

5.4. Ordered facts

in

file:///C:/x86/Jess71p2/docs/memory.html

with Jess "Jess Version 7.1p2 11/5/2008"

where there is an example

Jess> (number (value 6))

I expected the ordered fact "number" to get created on-demand but instead got:

Jess reported an error in routine Funcall.execute
while executing (number (value 6)).
  Message: Undefined function number.
  Program text: ( number ( value 6 ) )  at line 1.

What am I doing wrong?

Best wishes,

Grant

--
((λ (x) (x x)) (λ (x) (x x)))
http://www.wisdomandwonder.com/
ACM, AMA, COG, IEEE




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Rete network visualization

2013-02-19 Thread Grant Rettke
Hi,

I'm learning rules engines with JESS. The (view) popup is interesting.

While learning about the network itself and how to understand it, I got
curious about visualizing it differently.

I've been looking for an excuse to learn a nice GUI graphing framework, and
maybe this is it.

Is all of that information available at runtime using JESS commands?
Or programmatic ally?

Best wishes,

-- 
Grant Rettke | ACM, AMA, COG, IEEE
gret...@acm.org | http://www.wisdomandwonder.com/
Wisdom begins in wonder.
((λ (x) (x x)) (λ (x) (x x)))


JESS: [EXTERNAL] Semantic network implementations

2013-05-21 Thread Ahmed Abdeen Hamed
Hello respected scientists,

Is JESS the best environment to implement a semantic network? If it is
indeed, is there an example I can follow? There isn't any in the JESS in
Action book.

Sincerely,

-Ahmed


JESS: [EXTERNAL] Corrupted Negcnt Error

2013-05-30 Thread Dwight Hare
During a run I started getting the error

Jess reported an error in routine NodeNot2.tokenMatchesRight
while executing rule LHS (Node2)
while executing rule LHS (TECT).
  Message: Corrupted Negcnt (< 0) .

Any idea what this means?

Dwight



JESS: [EXTERNAL] nested or-and-not

2011-12-12 Thread Al C

Hello all,

First, I apologize for the length of this post. I have an issue with the syntax 
of a rule of mine that is puzzling me. The rule is as follows (i copy it 
exactly as it appears in its program, all parentheses are as shown):

(defrule ColorChange
(Time (timepoint ?t2))
?e0 <- (event (name StartPressing) (arg B1))
(EC (predicate Happens) (event ?e0 ) (time ?t1))
(test (= (+ ?t1 5) ?t2))
(or (not (event (name StopPressing) (arg B1)))
(and ?e2 <- (event (name StopPressing) (arg B1))
 (not (EC (predicate Happens) (event ?e2 ) (time ?t3 )
(test (>= ?t3 ?t1))
(test (< ?t3 ?t2))
?event <- (event (name ChangeColor) (arg B1))
=>
(assert (EC (predicate Happens)
(epistemic no)
(event ?event)
(time ?t2

The idea is that ?t1<= ?t3 < ?t2, where ?t2 = ?t1 + 5. That is, if event 
StartPressing(B1) occurs at ?t1 a ChangeColor event will occur after 5 
timepoints, given that no StopPressing(B1) event happened in the meantime 
(events may or may not appear in the KB, yet their occurences are what we are 
interested in).

The rule at first seems to work fine, but then I noticed that ?t3 is declared 
outside the scope of its declaration. In fact, although it is correctly 
instantiated somehow, i cannot print its value using (printout t ?t3 crlf) in 
the head of the rule ("Message: No such variable t3")

On the other hand, if I omit the first disjunct and write

(defrule ColorChange

(Time (timepoint ?t2))

?e0 <- (event (name StartPressing) (arg B1))

(EC (predicate Happens) (event ?e0 ) (time ?t1))

(test (= (+ ?t1 5) ?t2))

?e2 <- (event (name StopPressing) (arg B1))

(not (EC (predicate Happens) (event ?e2 ) (time ?t3)))

(test (>= ?t3 ?t1))

(test (< ?t3 ?t2))

?event <- (event (name ChangeColor) (arg B1))

=>

(assert (EC (predicate Happens)

(epistemic no)

(event ?event)

(time ?t2


i get "Message: Variable used before definition: t3" during parsing, as 
expected.

The fact that ?t3 is instantiated correctly has been tested by running 
different cases, where all events exists in the KB and StopPressing(B1) happens 
before and after StartPressing(B1) (in the former the rule fires, in the latter 
it does not).

In addition, trying to figure out whether the tests for ?t3 are actually 
considered or not, I added a "trivial" test condition (test (> 1 0)) just after 
the last test. When this condition is true and the rule should not fire 
(StopPressing(B2) has happened), indeed it does not fire. Surprisingly, when 
the condition is false (test (eq 1 0)) and the rule should not fire.. it fires. 
Even without the existence of the ?t3 tests in the body of the rule.

I cannot ascribe this behavior (or even why ?t3 is instantiated in the first 
place) to anything. I could use some ideas to understand where to focus the 
syntactical reshaping.

Thank you

Alex


  

AW: JESS: [EXTERNAL] Jess Licensing Question

2012-03-06 Thread Henschel, Joerg
Hi - we have licensed JESS and are using it in a commercial application for 2.5 
years now. While I can't speak for the licensing process, we have made good 
experiences with the technical side of things. It's easy to integrate, well 
documented and the mailing list is generally responsive to specific problems. 
We also have a support/maintenance agreement that we use now and then for 
specific issues.

Our lessons learned, very subjective of course: Jess does what it says it will 
do - which might not be what you expect it to do. Spend time to learn it. A lot 
of problems turn out to be not actual problems but rather "as designed" 
mechanisms. For us, it's fast, it's stable and with the source code it's also 
changeable - although we try to stay away from that. Overall experience - very 
good, I'd say.

Regards,
Joerg

Von: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] Im 
Auftrag von Yuan Rao
Gesendet: Dienstag, 6. März 2012 01:10
An: jess-users@sandia.gov
Betreff: JESS: [EXTERNAL] Jess Licensing Question

Does anyone have experience licensing Jess for commercial use?

My employer is interested in licensing the software. But getting formal 
references from Sandia turns out would take longer than we'd expected. While 
waiting for Sandia's formal references to come through, I wonder if anyone here 
have had some experience they wouldn't mind sharing.

If you have licensed the software and have anything to say about your 
experience using the software in commercial environment, the process of 
licensing it, and any lessons learned, I'd really appreciate it.

Thanks!

Yuan


Re: JESS: [EXTERNAL] Jess Licensing Question

2012-03-06 Thread Peter Lin
Back in 2002-2003 I used JESS to build a pre-trade compliance engine
for a trading platform.

JESS is a fantastic expert system shell. Like any other tool, the key
is taking time to learn how to use it. Logic programming is different
than imperative or OOP. The benefit is the result of how JESS is used.
I recommend to most people that ask "which rule engine would you use?"

On Mon, Mar 5, 2012 at 7:10 PM, Yuan Rao  wrote:
> Does anyone have experience licensing Jess for commercial use?
>
> My employer is interested in licensing the software. But getting formal
> references from Sandia turns out would take longer than we'd expected. While
> waiting for Sandia's formal references to come through, I wonder if anyone
> here have had some experience they wouldn't mind sharing.
>
> If you have licensed the software and have anything to say about your
> experience using the software in commercial environment, the process of
> licensing it, and any lessons learned, I'd really appreciate it.
>
> Thanks!
>
> Yuan


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] question on sorting

2012-03-06 Thread Wolfgang Laun
This will not improve efficiency but here's a single rule doing the job, at
the cost of one additional fact.

(deftemplate driver (slot driverId) (slot score) (slot rank))
(deftemplate rover  (slot rank))

(defrule rank-drivers
   ?d <- (driver (score ?s1) (rank nil))
   (not (driver (score ?s2&:(> ?s2 ?s1)) (rank nil)))
   ?r <- (rover (rank ?x))
=>
   (modify ?d (rank ?x))
   (modify ?r (rank (++ ?x)))
)

(reset)
..
(assert (rover (rank 1)))

Cheers
Wolfgang

On 6 March 2012 16:55, Friedman-Hill, Ernest  wrote:

>  That's about the best you can do purely with rules, I'm afraid. The only
> way to do better would be to query for all the facts, sort them using an
> explicit sort, and then run through the list, modifying them one at a time.
> That wouldn't be too hard to code up in Java.
>
>  Now that I'm saying this, it seems like it should be possible to write a
> generic Userfunction which sorted facts based on some given criteria. That
> would be an interesting addition to Jess's library.
>
>   From: Felix Chan 
> Reply-To: 
> Date: Mon, 5 Mar 2012 17:57:25 -0800
> To: 
> Subject: JESS: [EXTERNAL] question on sorting
>
>  Hi,
>
> I need to rank a set of facts based on a score. I came up with the idea
> that I first find the top ranked fact using one rule, followed by ranking
> the remaining facts using another rule.
>
> It works. But I suspect that this method will not be very efficient if I
> have to rank thousands of facts, rather than just 4 as in my example below.
> I also suspect that someone must have solved this sorting problem in a much
> better way.
>
> Any recommendation would be much appreciated. Many thanks.
>
> Felix
>
>
>
> /**/
>
> (deftemplate driver (slot driverId) (slot score) (slot rank))
>
> (defrule rankFirstDriver
> "find top ranked driver if none has been ranked"
> (not (driver (rank ~nil)))   ; if no drivers have been
> ranked
> ?d1 <- (driver (score ?s1))  ; if we can find a driver
> with score s1
> (not (driver (score ?s2&:(> ?s2 ?s1  ; but no other drivers have a
> score higher than s1
> =>
> (modify ?d1 (rank 1))
> )
>
> (defrule rankOtherDrivers
> "rank other drivers after top ranked drivers have been found"
> (driver (rank 1)) ; if top ranked driver has been found
>
> ; find lowest ranked driver
> (driver (rank ?r1&~nil))
> (not (driver (rank ?r2&~nil&:(> ?r2 ?r1
>
> ; find unranked driver with highest score
> ?d <- (driver (score ?s1) (rank nil))
> (not (driver (score ?s2&:(> ?s2 ?s1)) (rank nil)))
>
> =>
> (modify ?d (rank (+ ?r1 1)))
> )
>
> (reset)
> (assert (driver (driverId 1) (score 100)))
> (assert (driver (driverId 2) (score 50)))
> (assert (driver (driverId 3) (score 200)))
> (assert (driver (driverId 4) (score 75)))
>
> (run)
> (facts)
>
>
>
> /*/
>
> /* OUTPUT **/
>
>
> f-0   (MAIN::initial-fact)
> f-1   (MAIN::driver (driverId 1) (score 100) (rank 2))
> f-2   (MAIN::driver (driverId 2) (score 50) (rank 4))
> f-3   (MAIN::driver (driverId 3) (score 200) (rank 1))
> f-4   (MAIN::driver (driverId 4) (score 75) (rank 3))
> For a total of 5 facts in module MAIN.
>


Re: JESS: [EXTERNAL] Second order JESS?

2012-04-16 Thread David Scuse
An alternative that would permit you to manipulate your facts 
in a somewhat second-order manner is to define a predicate such as my-fact
and then use:
(assert (my-fact ?foo ?bar))

This way, ?foo is no longer a predicate but instead is a term within the fact 
my-fact.
  - Original Message - 
  From: Friedman-Hill, Ernest 
  To: jess-users 
  Sent: Monday, April 16, 2012 10:27 AM
  Subject: Re: JESS: [EXTERNAL] Second order JESS?


  You can build the fact you want as a string and assert that — for example


  (assert-string (str-cat "(" ?foo " " ?bar ")"))




  From: Sam Sarjant 
  Reply-To: 
  Date: Sun, 15 Apr 2012 13:21:47 +1200
  To: 
  Subject: JESS: [EXTERNAL] Second order JESS?



  Hello, 
I'm looking to use JESS within an application where second-order logic is 
needed (or at least it makes things easier). Does JESS support second-order 
logic in any form?


  For example, a rule such as:
  (ruleDef (factPredicate ?foo) (factArgs ?bar))
  =>
  (assert (?foo ?bar)))


  is an example of the structure I am looking for (where factPredicate is a 
String slot and factArgs is a multislot). The LHS of the rule compiles fine 
(with the appropriate ruleDef deftemplate), but the RHS throws an exception as 
it is expecting a template name after assert.


  -- 
  - Thanks, Sam Sarjant 
  www.samsarjant.com




JESS: [EXTERNAL] Using Jess from Java

2012-06-07 Thread Cecilia Zanni-Merk (INSA de Strasbourg)

Dear colleagues

I'm absolutely new to using Jess from a Java program,
When I try to test a software done by someone at my team a couple of 
years ago, Eclipse gives me these errors


!ENTRY org.eclipse.osgi 4 0 2012-06-07 21:29:27.775
!MESSAGE Application error
!STACK 1
java.lang.ThreadDeath
at jess.Jesp.(Unknown Source)
at jess.Rete.g(Unknown Source)
at jess.Rete.(Unknown Source)
at jess.Rete.(Unknown Source)
at 
fr.insa.mamas.Initialization.createAgents(Initialization.java:356) <-- 
where Initialization is one of the classes of our project.


Everything is imported correctly, son I do not understand why I get 
jess.Rete. (Unknown Source)


Any suggestion is more than welcome

Thank you very much in advance

Regards

Cecilia


--
===
Cecilia Zanni-Merk
INSA de Strasbourg
24 Bd de la Victoire - 67084 Strasbourg - France
Phone: +33 3 88 14 47 00 (4864)

"Beware of bugs in the above code; I have only proved
it correct, not tried it". Donald Knuth



To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Jess and negation

2012-07-11 Thread Wolfgang Laun
On 09/07/2012, André Lämmer  wrote:
>
> Do I have the same problems in Jess with negation and disjunction like with
> horn clauses in prolog?
>

Why do you have problems with horn clauses in Prolog?
-W




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Fuzzy Jess available anywhere?

2012-10-08 Thread dselva80
Hi,

Can I find Bob Orchard's fuzzy Jess toolkit for download anywhere? (academic
license) All links to the toolkit seem to be broken since Bob retired, and I
don't really want to reimplement all this functionality from scratch...

Thanks in advance,

Daniel



--
View this message in context: 
http://jess.2305737.n4.nabble.com/Fuzzy-Jess-available-anywhere-tp4654087.html
Sent from the Jess mailing list archive at Nabble.com.


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Emacs Jess Users?

2012-10-10 Thread Friedman-Hill, Ernest
I still use Emacs 22 on my MacBook, so I didn't realize there was a
problem. If you have a patch, let me know and I can post it for other
people to use.

On 10/9/12 11:57 PM, "Grant Rettke"  wrote:

>Hi,
>
>Emacs v24 jess-mode users, are you out there?
>
>I just found a fix to make jess-mode play nice with Emacs 24 was
>wondering if anyone else is using it.
>
>Everything just works so far and I wanted to have someone to bounce
>ideas off of.
>
>Best wishes,
>
>Grant Rettke




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Emacs Jess Users?

2012-10-11 Thread Grant Rettke
On Wed, Oct 10, 2012 at 9:04 AM, Friedman-Hill, Ernest
 wrote:
> If you have a patch, let me know and I can post it for other people to use.

Someone already posted describing the fix here but with a patch for it:

http://planetjava.org/java-jess/2004-05/msg6.html

Here is my patch with their fix:

http://www.wisdomandwonder.com/wordpress/wp-content/uploads/2012/10/jess-mode-1.2-emacs-24.patch_.gz

Thanks!


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Emacs Jess Users?

2012-10-11 Thread Andre Luiz Tietbohl Ramos
Hello,

I'm having a problem to start Jess in ubuntu 12.04.  I have jess-mode
installed in /usr/share/emacs/site-lisp/jess-mode and when I try M-x
jess-mode I receive the error below:

setq: Symbol's value as variable is void: shared-lisp-mode-map

Would anyone know how to solve this please?  Jess works fine in a
terminal.

Thanks,

Andre Luiz


On Tue, 2012-10-09 at 22:57 -0500, Grant Rettke wrote:

> Hi,
> 
> Emacs v24 jess-mode users, are you out there?
> 
> I just found a fix to make jess-mode play nice with Emacs 24 was
> wondering if anyone else is using it.
> 
> Everything just works so far and I wanted to have someone to bounce
> ideas off of.
> 
> Best wishes,
> 
> Grant Rettke
> 




Re: JESS: [EXTERNAL] Emacs Jess Users?

2012-10-11 Thread Grant Rettke
On Wed, Oct 10, 2012 at 8:33 PM, Andre Luiz Tietbohl Ramos
 wrote:
> I'm having a problem to start Jess in ubuntu 12.04.  I have jess-mode
> installed in /usr/share/emacs/site-lisp/jess-mode and when I try M-x
> jess-mode I receive the error below:
>
> setq: Symbol's value as variable is void: shared-lisp-mode-map
>
> Would anyone know how to solve this please?  Jess works fine in a terminal.

I had the same problem described here
http://www.wisdomandwonder.com/link/6442/making-jess-mode-v1-2-work-on-emacs-24
and patched here

http://www.wisdomandwonder.com/wordpress/wp-content/uploads/2012/10/jess-mode-1.2-emacs-24.patch_.gz

I run Emacs 24 on Lubuntu 12.04 and it seems to work fine so far.


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Ordered facts question

2012-10-11 Thread Friedman-Hill, Ernest
You can't type a fact directly at the prompt. You can add a fact to
working memory using the (assert) function (as shown in section 5.2) or
you can use the (deffacts) construct to create a group of facts that will
then be added to working memory on reset events (as in section 5.5) .

As a general rule, in the HTML manual, the light red blocks show
interactive sessions with Jess -- things you can type directly at the
prompt -- while the green ones do not. The red ones show the actual
"Jess>" prompt; the "number" fact you typed in below is from a green
block, and is meant to indicate how the fact data structures look.  There
are also violet-colored blocks: those are compilable Java code.
 
I'm actually rather proud of what the Jess test suite does to verify the
manual. The dialogs in the red blocks are actually parsed from the XML
source of the manual and verified: if one of the red blocks says that Jess
gives a particular response to a given input, that is actually verified in
the test suite. Likewise, the code in the violet blocks is compiled, and
if output is shown in the manual, the output is verified correct. The
green boxes are the escape mechanism: they can contain pretty much
anything, and no validation is done on them.


On 10/11/12 4:43 PM, "Grant Rettke"  wrote:

>Hi,
>
>I'm working on
>
>5.4. Ordered facts
>
>in
>
>file:///C:/x86/Jess71p2/docs/memory.html
>
>with Jess "Jess Version 7.1p2 11/5/2008"
>
>where there is an example
>
>Jess> (number (value 6))
>
>I expected the ordered fact "number" to get created on-demand but instead
>got:
>
>Jess reported an error in routine Funcall.execute
>   while executing (number (value 6)).
>  Message: Undefined function number.
>  Program text: ( number ( value 6 ) )  at line 1.
>
>What am I doing wrong?
>
>Best wishes,
>
>Grant
>
>--
>((λ (x) (x x)) (λ (x) (x x)))
>http://www.wisdomandwonder.com/
>ACM, AMA, COG, IEEE
>
>
>
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] passing by reference ?

2013-01-03 Thread Grant Rettke
On Sat, Dec 22, 2012 at 10:19 AM, burama  wrote:

> how to do passing by reference in jess ?


May you give more context and maybe an example of what you want to do?


Re: JESS: [EXTERNAL] Multislot and queries

2013-04-09 Thread Friedman-Hill, Ernest
Use QueryResult.get("visites") and then call listValue() on the result.

On 4/8/13 1:05 PM, "mike donald"  wrote:

>hello,
>I am a beginner in jess, I'm stuck on my application since
>I have two deftemplates
>
>(deftemplate Individu
> (slot age)
>(slot sexe) 
> (multislot visites (default (create$) ) )
>)
>
>(deftemplate Visite
>(slot id_visite)
>(slot nom)
>(slot pr)
>)
>
>I have the following query:
>
>(defquery objetHistogramme
>   ?i <- (Individu {sexe != F } (age ?ag) (sexe ?sex) (visites
>$?visites))
>)
>
>In my java program, I call my query as follows:
>
>QueryResult result = engine.runQueryStar("objetHistogramme", new
>ValueVector());
>   while (result.next()) {
>int x  = result.getInt("ag");//age
>
>Object v = result.getObject("visites"); //
>Erroorr is it
>
> }
>
>I get an error when I want to retrieve the elements of multislot "visit"
>to
>the display.
>How to recover the multislot?
>
>
>Mike
>
>
>
>
>--
>View this message in context:
>http://jess.2305737.n4.nabble.com/Multislot-and-queries-tp4654137.html
>Sent from the Jess mailing list archive at Nabble.com.
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




RE: JESS: [EXTERNAL] Corrupted Negcnt Error

2013-05-30 Thread Friedman-Hill, Ernest
It's an internal consistency check. Usually it means that a non-value class (a 
class whose identity, defined by hashCode()/equals(), changes during a run) is 
being used in an indexed field. Look at this section of the manual and see if 
you can use it to fix the problem:

http://www.jessrules.com/jess/docs/71/functions.html#set-value-class

In the past, very rarely, this message indicated a bug in Jess. I don't think 
this will be the case here - I think any bugs that trigger this assert were 
found and fixed long ago.


From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Dwight Hare
Sent: Wednesday, May 29, 2013 5:05 PM
To: jess-users
Subject: JESS: [EXTERNAL] Corrupted Negcnt Error

During a run I started getting the error

Jess reported an error in routine NodeNot2.tokenMatchesRight
while executing rule LHS (Node2)
while executing rule LHS (TECT).
  Message: Corrupted Negcnt (< 0) .

Any idea what this means?

Dwight



RE: JESS: [EXTERNAL] Corrupted Negcnt Error

2013-05-30 Thread Dwight Hare
By "indexed field" do you mean slot values? I don't use any Java objects other 
than simple primitives (Integer, Float, Boolean, String). I've looked at all my 
calls to the Value constructor.

Dwight

From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Friedman-Hill, Ernest
Sent: Thursday, May 30, 2013 7:36 AM
To: jess-users
Subject: RE: JESS: [EXTERNAL] Corrupted Negcnt Error

It's an internal consistency check. Usually it means that a non-value class (a 
class whose identity, defined by hashCode()/equals(), changes during a run) is 
being used in an indexed field. Look at this section of the manual and see if 
you can use it to fix the problem:

http://www.jessrules.com/jess/docs/71/functions.html#set-value-class

In the past, very rarely, this message indicated a bug in Jess. I don't think 
this will be the case here - I think any bugs that trigger this assert were 
found and fixed long ago.


From: owner-jess-us...@sandia.gov<mailto:owner-jess-us...@sandia.gov> 
[mailto:owner-jess-us...@sandia.gov] On Behalf Of Dwight Hare
Sent: Wednesday, May 29, 2013 5:05 PM
To: jess-users
Subject: JESS: [EXTERNAL] Corrupted Negcnt Error

During a run I started getting the error

Jess reported an error in routine NodeNot2.tokenMatchesRight
while executing rule LHS (Node2)
while executing rule LHS (TECT).
  Message: Corrupted Negcnt (< 0) .

Any idea what this means?

Dwight



RE: JESS: [EXTERNAL] Corrupted Negcnt Error

2013-05-30 Thread Friedman-Hill, Ernest
Yes, that's what I mean, mutable Java objects in your slots. If that's not the 
problem, then a bug is a possibility. Can you provide me a 
SSCCE<http://sscce.org/> that displays the error? (Off-list)

From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Dwight Hare
Sent: Thursday, May 30, 2013 1:00 PM
To: jess-users
Subject: RE: JESS: [EXTERNAL] Corrupted Negcnt Error

By "indexed field" do you mean slot values? I don't use any Java objects other 
than simple primitives (Integer, Float, Boolean, String). I've looked at all my 
calls to the Value constructor.

Dwight

From: owner-jess-us...@sandia.gov<mailto:owner-jess-us...@sandia.gov> 
[mailto:owner-jess-us...@sandia.gov] On Behalf Of Friedman-Hill, Ernest
Sent: Thursday, May 30, 2013 7:36 AM
To: jess-users
Subject: RE: JESS: [EXTERNAL] Corrupted Negcnt Error

It's an internal consistency check. Usually it means that a non-value class (a 
class whose identity, defined by hashCode()/equals(), changes during a run) is 
being used in an indexed field. Look at this section of the manual and see if 
you can use it to fix the problem:

http://www.jessrules.com/jess/docs/71/functions.html#set-value-class

In the past, very rarely, this message indicated a bug in Jess. I don't think 
this will be the case here - I think any bugs that trigger this assert were 
found and fixed long ago.


From: owner-jess-us...@sandia.gov<mailto:owner-jess-us...@sandia.gov> 
[mailto:owner-jess-us...@sandia.gov] On Behalf Of Dwight Hare
Sent: Wednesday, May 29, 2013 5:05 PM
To: jess-users
Subject: JESS: [EXTERNAL] Corrupted Negcnt Error

During a run I started getting the error

Jess reported an error in routine NodeNot2.tokenMatchesRight
while executing rule LHS (Node2)
while executing rule LHS (TECT).
  Message: Corrupted Negcnt (< 0) .

Any idea what this means?

Dwight



JESS: [EXTERNAL] Jess rule validation algorithm

2013-06-06 Thread Wessel, Alexander
Hi Jess-users,
I' m a german computer senice student working on my master thesis.  The topic 
is rule verification in rule based systems. We are using Jess as rule engine. 
Currently I'm looking for an implementation of a rule checker for Jess.  
Alternative I'm looking for an algorithm to recognize rule errors like subsumed 
rules, circular rules, conflicting rules and so one.

I would appreciate if you can me give me an advice where I can find an 
implementation or an algorithm for further research?

Thanks for your help.

best regards

Alexander Wessel

Email: a.wes...@itcampus.de
Phone: +49 341 49287-0 | Fax: +49 341 49287-790
itCampus Software- und Systemhaus GmbH | a Software AG Company
Nonnenstrasse 37 | 04229 Leipzig | Germany | 
http://www.itcampus.de
Amtsgericht Leipzig HRB 15872 | Managing Director: Guido Laures
USt-IdNr DE202041156




JESS: [EXTERNAL] Dynamic rule-base analysis

2013-08-15 Thread Przemyslaw Woznowski
Dear Jess users.

What I am trying to do is to dynamically list all the defrules together
with their LHS and RHS facts excluding any conditions. Basically what I
mean is that, for example, if there are Person and Car facts on the rule's
LHS and the rule asserts an Owner fact, deletes the Car fact and modifies
the Person fact. I would like to create a data structure that would, for
each rule, carry it's name and the facts it needs to fire (excluding any
conditions just deftemplate's name) and any deftemplates that appear on the
rule's RHS. So for the example above, something like:
Rule_1
 needs: Person, Car
 asserts: Owner
 modifies: Person
 deletes: Car

I can get a list of all defrules via the listDefrules() method called on
the Rete object but then it gets tricky. The listNodes() method called on
the HasLHS object gives a textual description of the rule's LHS but I
cannot find a method that would simply return name of facts on the LHS.
Some text processing would solve the rule's LHS problem as I can look for
occurrences of "::" to find facts. However, the rule's RHS is more
problematic as I cannot find a method that would give me what I want.

I would appreciate your help with this one.

Best regards,
Pete

-- 
Przemyslaw (Pete) Woznowski, PhD candidate & RA
Email: p.r.woznow...@cs.cardiff.ac.uk
Room C/2.06, Desk 8
Cardiff School of Computer Science & Informatics,
Cardiff University,
Queen's Buildings,
5 The Parade, Roath,
Cardiff, CF24 3AA, UK
& School of Healthcare Studies,
Cardiff University
Cardigan House
Heath Park Campus
Cardiff, CF14 4XN, UK


View command (was Re: JESS: External Address

2004-11-25 Thread ejfried
I think Sr. Hernan Flores wrote:
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> Hello,
> I4m just begining with Jess. I Would like to use (view) command from Java.
> Could somebody tell how could I do it, or better, send me an example.
> 

The view command isn't exposed as a Java API. You can run it, or any
other Jess function, using the executeCommand() method of the Rete
class.

Rete engine = new Rete();
...
engine.executeCommand("(view)");

Also: please ask a new question by sending mail directly to the list,
not by replying to someone else's post. This will make your question
stand out for people who use threaded newsreaders, and also help keep
the archives organized.




-
Ernest Friedman-Hill  
Advanced Software Research  Phone: (925) 294-2154
Sandia National LabsFAX:   (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov




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]




JESS: [EXTERNAL] Using tests in query variables

2011-11-23 Thread Sam Sarjant
Hello.
  Is it possible to use tests as variables submitted to queries? Or do
variables always have to be concrete facts (or already bound facts)?

For example, given the facts (num 0) (num 1) (num 2)..., is it possible to
perform a query that looks something like (run-query* numQuery ?X&:(<= 0 ?X
5)) which will return all nums between 0 and 5 (inclusive).

I gave the above example a go (with the proper definitions and such), but
it threw an exception at me, telling me 'No such variable X'. This is
mostly a question out of curiosity, as I don't absolutely need queries to
accept test variables, but it would be nice if there was some sort of
functionality to perform this task.

-- 
- Thanks, Sam Sarjant
www.samsarjant.com


Re: JESS: [EXTERNAL] nested or-and-not

2011-12-21 Thread Lode Hoste
Hi,

Maybe this helps you in understanding:
http://www.jessrules.com/jess/docs/71/rules.html#not_ce

"Note that a not pattern cannot define any variables that are used in
subsequent patterns (since a not pattern does not match any facts, it
cannot be used to define the values of any variables!) You can
introduce variables in a not pattern, so long as they are used only
within that pattern"

i.e. you cannot (read: should not) use ?t3 outside of the not expression.
Please correct me if I'm wrong..


2011/12/12 Al C :
> Hello all,
>
> First, I apologize for the length of this post. I have an issue with the
> syntax of a rule of mine that is puzzling me. The rule is as follows (i copy
> it exactly as it appears in its program, all parentheses are as shown):
>
> (defrule ColorChange
>     (Time (timepoint ?t2))
>     ?e0 <- (event (name StartPressing) (arg B1))
>     (EC (predicate Happens) (event ?e0 ) (time ?t1))
>     (test (= (+ ?t1 5) ?t2))
>     (or     (not (event (name StopPressing) (arg B1)))
>         (and     ?e2 <- (event (name StopPressing) (arg B1))
>          (not (EC (predicate Happens) (event ?e2 ) (time ?t3 )
>     (test (>= ?t3 ?t1))
>     (test (< ?t3 ?t2))
>     ?event <- (event (name ChangeColor) (arg B1))
> =>
> (assert (EC (predicate Happens)
>     (epistemic no)
>     (event ?event)
>     (time ?t2
>
> The idea is that ?t1<= ?t3 < ?t2, where ?t2 = ?t1 + 5. That is, if event
> StartPressing(B1) occurs at ?t1 a ChangeColor event will occur after 5
> timepoints, given that no StopPressing(B1) event happened in the meantime
> (events may or may not appear in the KB, yet their occurences are what we
> are interested in).
>
> The rule at first seems to work fine, but then I noticed that ?t3 is
> declared outside the scope of its declaration. In fact, although it is
> correctly instantiated somehow, i cannot print its value using (printout t
> ?t3 crlf) in the head of the rule ("Message: No such variable t3")
>
> On the other hand, if I omit the first disjunct and write
>
> (defrule ColorChange
>     (Time (timepoint ?t2))
>     ?e0 <- (event (name StartPressing) (arg B1))
>     (EC (predicate Happens) (event ?e0 ) (time ?t1))
>     (test (= (+ ?t1 5) ?t2))
>     ?e2 <- (event (name StopPressing) (arg B1))
>     (not (EC (predicate Happens) (event ?e2 ) (time ?t3)))
>     (test (>= ?t3 ?t1))
>     (test (< ?t3 ?t2))
>     ?event <- (event (name ChangeColor) (arg B1))
> =>
> (assert (EC (predicate Happens)
>     (epistemic no)
>     (event ?event)
>     (time ?t2
>
> i get "Message: Variable used before definition: t3" during parsing, as
> expected.
>
> The fact that ?t3 is instantiated correctly has been tested by running
> different cases, where all events exists in the KB and StopPressing(B1)
> happens before and after StartPressing(B1) (in the former the rule fires, in
> the latter it does not).
>
> In addition, trying to figure out whether the tests for ?t3 are actually
> considered or not, I added a "trivial" test condition (test (> 1 0)) just
> after the last test. When this condition is true and the rule should not
> fire (StopPressing(B2) has happened), indeed it does not fire. Surprisingly,
> when the condition is false (test (eq 1 0)) and the rule should not fire..
> it fires. Even without the existence of the ?t3 tests in the body of the
> rule.
>
> I cannot ascribe this behavior (or even why ?t3 is instantiated in the first
> place) to anything. I could use some ideas to understand where to focus the
> syntactical reshaping.
>
> Thank you
>
> Alex
>
>



To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Nested not/and syntax question

2012-01-06 Thread Theodore Patkos

Hello everyone and best wishes for the new year

could someone please give me an explanation why the following two rules 
behave in a different way, although they express the same logical 
formula (i.e., not (Object ^ Pred) )? In fact, only the second rule 
reaches correct conclusions, as I note below.


(defrule Rule1
(not
   (and
  ?o <- (Object (name B))
  (Pred (obj ?o))
))
=>
(printout t "OK1" crlf)
)


(defrule Rule2
(or
   (not (Object (name B)))
   (and
  ?o <- (Object (name B))
  (not (Pred (obj ?o)))
))
=>
(printout t "OK2" crlf)
)

The definition of facts could be like:
(deftemplate Object (slot name))
(assert (Object (name A)))
(assert (Object (name B)))
(deftemplate Pred (slot obj))

where  is the id of some Object fact, eg.

(defrule Rule
(declare (salience 10))
?o <- (Object (name A))
=>
(assert (Pred (obj ?o)))
)


What I notice is that Rule1 behaves erroneously when the Object fact 
exists in the KB, but not the Pred fact: although it is supposed to be 
triggered, it is not! Rule2, on the other hand, behaves correctly all 
the times.


When both Object and Pred facts exist or when the Object does not exist, 
both rules behave fine.


So, what is wrong with the syntax of the first rule? No variable 
definition is used outside the not pattern..


Thanks

Theodore



To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Using Jess from Java

2012-06-07 Thread Friedman-Hill, Ernest
The "Unknown Source" just means that line number info isn't stored in the
binary (non-source code) distribution you are using; that's not a problem
at all. The problem is the "ThreadDeath" message -- it means that you're
using a  trial or time-limited licensed version, and the trial period or
license period has expired. You'll need to contact Craig Smith,
casm...@sandia.gov, to obtain a current license.



On 6/7/12 3:31 PM, "Cecilia Zanni-Merk (INSA de Strasbourg)"
 wrote:

>Dear colleagues
>
>I'm absolutely new to using Jess from a Java program,
>When I try to test a software done by someone at my team a couple of
>years ago, Eclipse gives me these errors
>
>!ENTRY org.eclipse.osgi 4 0 2012-06-07 21:29:27.775
>!MESSAGE Application error
>!STACK 1
>java.lang.ThreadDeath
> at jess.Jesp.(Unknown Source)
> at jess.Rete.g(Unknown Source)
> at jess.Rete.(Unknown Source)
> at jess.Rete.(Unknown Source)
> at 
>fr.insa.mamas.Initialization.createAgents(Initialization.java:356) <--
>where Initialization is one of the classes of our project.
>
>Everything is imported correctly, son I do not understand why I get
>jess.Rete. (Unknown Source)
>
>Any suggestion is more than welcome
>
>Thank you very much in advance
>
>Regards
>
>Cecilia
>
>
>-- 
>===
>Cecilia Zanni-Merk
>INSA de Strasbourg
>24 Bd de la Victoire - 67084 Strasbourg - France
>Phone: +33 3 88 14 47 00 (4864)
>
>"Beware of bugs in the above code; I have only proved
>it correct, not tried it". Donald Knuth
>
>
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Fuzzy Jess available anywhere?

2012-10-08 Thread Friedman-Hill, Ernest
Sandia has a license from NRC to redistribute the FuzzyJ toolkit. I will
put it up on the Jess web site as soon as the site comes back from system
time.

On 10/7/12 5:55 AM, "dselva80"  wrote:

>Hi,
>
>Can I find Bob Orchard's fuzzy Jess toolkit for download anywhere?
>(academic
>license) All links to the toolkit seem to be broken since Bob retired,
>and I
>don't really want to reimplement all this functionality from scratch...
>
>Thanks in advance,
>
>Daniel
>
>
>
>--
>View this message in context:
>http://jess.2305737.n4.nabble.com/Fuzzy-Jess-available-anywhere-tp4654087.
>html
>Sent from the Jess mailing list archive at Nabble.com.
>
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Fuzzy Jess available anywhere?

2012-10-08 Thread Bob Orchard
Send me an email at orcha...@rogers.com and I'll see what I can do.

Bob Orchard.

On 2012-10-07, at 5:55 AM, dselva80 wrote:

> Hi,
> 
> Can I find Bob Orchard's fuzzy Jess toolkit for download anywhere? (academic
> license) All links to the toolkit seem to be broken since Bob retired, and I
> don't really want to reimplement all this functionality from scratch...
> 
> Thanks in advance,
> 
> Daniel
> 
> 
> 
> --
> View this message in context: 
> http://jess.2305737.n4.nabble.com/Fuzzy-Jess-available-anywhere-tp4654087.html
> Sent from the Jess mailing list archive at Nabble.com.
> 
> 
> To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
> in the BODY of a message to majord...@sandia.gov, NOT to the list
> (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
> 
> 





To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Fuzzy Jess available anywhere?

2012-10-10 Thread Friedman-Hill, Ernest
The FuzzyJ Toolkit is now available at
http://www.jessrules.com/user.programs/FuzzyJToolkit.zip .

On 10/8/12 11:44 AM, "Friedman-Hill, Ernest"  wrote:

>Sandia has a license from NRC to redistribute the FuzzyJ toolkit. I will
>put it up on the Jess web site as soon as the site comes back from system
>time.
>
>On 10/7/12 5:55 AM, "dselva80"  wrote:
>
>>Hi,
>>
>>Can I find Bob Orchard's fuzzy Jess toolkit for download anywhere?




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Jess on Android Revisited

2012-11-15 Thread Friedman-Hill, Ernest
Grant -- 

Your message is *very* timely. We've just started working on an official,
supported Android port, and hope to make it available in the first months
of 2013. This will be in conjunction with the Jess 8.0 release, which will
include a rollup of tons of bug fixes and other patches accumulated since
7.1p2.

On 11/15/12 9:08 AM, "Grant Rettke"  wrote:

>Hi,
>
>Curious about running Jess on Android 




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Jess in a multithreaded environment

2012-12-18 Thread Nguyen, Son

Hi Jess experts,

We use Jess in a multi-threaded environment and have experienced some
performance degradation when going from a single thread to multiple
threads.
Our implementation uses the Slot Specific feature. 

Using a Java profiler, HashCodeComputer.isValueObject() stood out as one
of the main contributing factors, if not the most likely,  to the
degradation.
This method is synchronized using the static List m_nonValueClasses
member. The averege time of this method execution is
0,2022 microsec for one thread and 1,2192 microsec for two threads.
Basically, 0.2 microsec for one threads and 1 microsec for 2 and 4
threads.
There are hundreds of thousands of these calls for a single Rete.run.

Is it possible that HashCodeComputer.isValueObject() has such an effect
on scalability and performance?
If so, what can be done about it?

I am looking forward to hearing any feedback.

Son Nguyen


Re: JESS: [EXTERNAL] Certainty factors in FuzzyJess

2013-03-28 Thread Bob Orchard
Hello Horatio,

I'm out of town right now but can address this next week when I return. There 
are a couple of issues ... 1 . I have to review things and think about this 
proposal.
2. I have to see if I can get the source code released to you (been working on 
this for a long time but some progress has been made recently).

Bob Orchard


On 2013-03-09, at 8:13 AM, Horacio Paggi wrote:

> Dear Sirs:
> In the docs attached to the FuzzyJess Toolkit it is mentioned the use of 
> certainty factors in the rules' specifications.   As long as I understand, to 
> allow the  processing of the rules, these values should be static in order to 
> be be determined prior the execution of any rule. However, it's very luring 
> to have VARIABLE  CFs so they can be changed automatically as long the system 
> is used (so it learns in some way).  Do you think that this is possible?In 
> your opinion, what would be the required effort  to implement this change? 
> I'm asking this because I have to mentor a degree student, in his final 
> engineering project (comprising a whole year) and I was thinking in yo have 
> him implement it and build a brief application of the  modified FuzzyJess, 
> but I do not want to overwhelm him.
> Thank you in advance for your advice,
> Horacio Paggi





To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Certainty factors in FuzzyJess

2013-03-28 Thread Jason Morris
Hi Bob,

I can't believe it's been nine years since I traveled out to IEA/AIE 2004!
I trust you and yours are doing well.

Did I understand correctly that you are you actively working on Fuzzy Jess
again?
Will the NRCC be re-releasing the Fuzzy-J tool kit to the public?

Cheers,
Jason

On Tue, Mar 12, 2013 at 11:20 PM, Bob Orchard  wrote:

> Hello Horatio,
>
> I'm out of town right now but can address this next week when I return.
> There are a couple of issues ... 1 . I have to review things and think
> about this proposal.
> 2. I have to see if I can get the source code released to you (been
> working on this for a long time but some progress has been made recently).
>
> Bob Orchard
>
>
> On 2013-03-09, at 8:13 AM, Horacio Paggi wrote:
>
> > Dear Sirs:
> > In the docs attached to the FuzzyJess Toolkit it is mentioned the use of
> certainty factors in the rules' specifications.   As long as I understand,
> to allow the  processing of the rules, these values should be static in
> order to be be determined prior the execution of any rule. However, it's
> very luring to have VARIABLE  CFs so they can be changed automatically as
> long the system is used (so it learns in some way).  Do you think that this
> is possible?In your opinion, what would be the required effort  to
> implement this change? I'm asking this because I have to mentor a degree
> student, in his final engineering project (comprising a whole year) and I
> was thinking in yo have him implement it and build a brief application of
> the  modified FuzzyJess, but I do not want to overwhelm him.
> > Thank you in advance for your advice,
> > Horacio Paggi
>
>
>
>
> 
> To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
> in the BODY of a message to majord...@sandia.gov, NOT to the list
> (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
> 
>
>


-- 
*Jason C. Morris*
President, Principal Consultant
Morris Technical Solutions LLC
President, Rules Fest Association
Chairman, IntelliFest 2012: International Conference on Reasoning
Technologies

phone: +01.517.376.8314
skype: jcmorris-mts
email: consult...@morris-technical-solutions.com
mybio: http://www.linkedin.com/in/jcmorris



www.intellifest.org
Invent * Innovate * Implement at IntelliFest!


Re: JESS: [EXTERNAL] Jess rule validation algorithm

2013-06-06 Thread Peter Lin
the literature on rule validation and ruleset validation is pretty deep.
Check on ACMQueue for old papers on the subject dating back to 80's and
90's.

There's too much prior art to attempt any sort of explanation on a mailing
list. I've been studying the topic since 2000 and the bottom line is it's
very tough. The simplest approach is to generate facts for each rule,
assert those facts and check the rule fired. Beyond that, you'd have to
analyze the RETE network to calculate the rule dependency graph and compare
the rules fired against the dependency graph.

peter lin


On Thu, Jun 6, 2013 at 10:52 AM, Wessel, Alexander wrote:

>  Hi Jess-users,
>
> I’ m a german computer senice student working on my master thesis.  The
> topic is rule verification in rule based systems. We are using Jess as
> rule engine. Currently I’m looking for an implementation of a rule checker
> for Jess.  Alternative I’m looking for an algorithm to recognize rule
> errors like subsumed rules, circular rules, conflicting rules and so one.
> 
>
> ** **
>
> I would appreciate if you can me give me an advice where I can find an
> implementation or an algorithm for further research?
>
> ** **
>
> Thanks for your help.
>
> ** **
>
> best regards
>
> ** **
>
> Alexander Wessel
>
> ** **
>
> Email: a.wes...@itcampus.de
> Phone: +49 341 49287-0 | Fax: +49 341 49287-790
>
> itCampus Software- und Systemhaus GmbH | a Software AG Company
> Nonnenstrasse 37 | 04229 Leipzig | Germany | http://www.itcampus.de
> Amtsgericht Leipzig HRB 15872 | Managing Director: Guido Laures
> USt-IdNr DE202041156
>
> ** **
>
> ** **
>


JESS: [EXTERNAL] Question on QueryResult close() function

2013-06-27 Thread Daniel Selva
Hi,

I am experiencing a memory leak problem in a Matlab-Jess application and I
am trying to locate the leak. I came across the definition of the close()
method of the QueryResult class. I have never called this method after
using queries.

1) Should I call close() after using a query?
2) Could not calling close() be the cause of the leak?

If not, I would appreciate any tips on typical causes of leaks in
Matlab-Jess applications.

Thanks in advance,

Daniel


JESS: [EXTERNAL] Problems with fuzzy jess implementations

2013-07-03 Thread Martín Rodríguez
Dear Doctor Orchar,

Hi my name is Martin Rodriguez and Im studen of engineering. As final
project Im developing a system with Jade, Jess and fuzzy jess.
The purpose of the system is to provide medical diagnosis.
Thats why i needed a rules based system with backward chaining, and I
choose Jess.

Well, my problem is when I begin to use FuzzyJ on my Jess files.

I send you as an attachment, a short file with the code complete.

My first problem occurs when I write the next rule:

*(defrule intensidad_tos*
* (declare (auto-focus TRUE))*
*(check diagnostico-b)*
*(answer (ident fuzzy_tos) (text ?ht&:(fuzzy-match ?ht
"secaContinua")))*
*=>*
*(assert (tos (new nrc.fuzzy.FuzzyValue ?*fuzzyTos*
"secaContinua")))*
*)*
*
*
this code does not even compile and send me the next error message:

*Jess reported an error in routine ReteCompiler.addRule.**  Message: Can't
use funcalls in backchained patterns text.*

Well, my next and last problem is when I remove de line * (answer (ident
fuzzy_tos) (text ?ht&:(fuzzy-match ?ht "secaContinua"))) *on the rule
before, and I replace with
*(answer (ident fuzzy_tos) (text 5)).*
I response with a number 5 and the rule asserts the *tos FuzzyValue. *That
trigger the next rule:

*(defrule intensidad_dolor_cabeza*
* (declare (auto-focus TRUE))*
*(check diagnostico-b)*
*(tos ?t&:(fuzzy-match ?t "secaContinua"))*
*(answer (ident fuzzy_dolor_cabeza) (text 5))*
*=>*
*(assert (dolor_de_cabeza (new nrc.fuzzy.FuzzyValue
?*fuzzyDolorCabeza* "intenso")))*
*)*
*
*
but when this rule trigger, send me the next error:

*Jess reported an error in routine fuzzy-match*
* while executing (fuzzy-match ?t(0,0,0) "secaContinua")*
* while executing rule LHS (MTEQ)*
* while executing rule LHS (MTELN)*
* while executing rule LHS (TECT)*
* while executing (assert (interview::tos (new nrc.fuzzy.FuzzyValue
?*fuzzyTos* "secaContinua")))*
* while executing defrule interview::intensidad_tos.*
*  Message: Error during execution.*
*
*
Please, I send you the clp file complete on the attachment, and if you can
help me I'll be very grateful, because Im stuck with this problem.
Thanks again for your time!!

regards!!

Martin Rodriguez


Motor_Diagnostico_General.clp
Description: Binary data


Re: JESS: [EXTERNAL] Dynamic rule-base analysis

2013-08-15 Thread Wolfgang Laun
Rete has listDefrules and Defrule has getConditionalElements, which
lets you retrieve its constituents, depending on it being a Pattern or
Accumulate; if it is a Group you must recurse down... It's like
walking an AST

RHS is similar. But note that fact modifications are possible in
functions, so if one of these is called on the RHS, you'll have to
investigate in depth.

Expect to have some fun ;-)

Cheers
Wolfgang


On 14/08/2013, Przemyslaw Woznowski  wrote:
> Dear Jess users.
>
> What I am trying to do is to dynamically list all the defrules together
> with their LHS and RHS facts excluding any conditions. Basically what I
> mean is that, for example, if there are Person and Car facts on the rule's
> LHS and the rule asserts an Owner fact, deletes the Car fact and modifies
> the Person fact. I would like to create a data structure that would, for
> each rule, carry it's name and the facts it needs to fire (excluding any
> conditions just deftemplate's name) and any deftemplates that appear on the
> rule's RHS. So for the example above, something like:
> Rule_1
>  needs: Person, Car
>  asserts: Owner
>  modifies: Person
>  deletes: Car
>
> I can get a list of all defrules via the listDefrules() method called on
> the Rete object but then it gets tricky. The listNodes() method called on
> the HasLHS object gives a textual description of the rule's LHS but I
> cannot find a method that would simply return name of facts on the LHS.
> Some text processing would solve the rule's LHS problem as I can look for
> occurrences of "::" to find facts. However, the rule's RHS is more
> problematic as I cannot find a method that would give me what I want.
>
> I would appreciate your help with this one.
>
> Best regards,
> Pete
>
> --
> Przemyslaw (Pete) Woznowski, PhD candidate & RA
> Email: p.r.woznow...@cs.cardiff.ac.uk
> Room C/2.06, Desk 8
> Cardiff School of Computer Science & Informatics,
> Cardiff University,
> Queen's Buildings,
> 5 The Parade, Roath,
> Cardiff, CF24 3AA, UK
> & School of Healthcare Studies,
> Cardiff University
> Cardigan House
> Heath Park Campus
> Cardiff, CF14 4XN, UK
>

To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Dynamic rule-base analysis

2013-08-17 Thread Przemyslaw Woznowski
Thanks Wolfgang, this helps a lot! I must have missed the
getConditionalElements in the API. The analysis of the rule's LHS is
working great and it's RHS is more complex but do-able.

Once again, thanks for the advice,
Pete


On Thu, Aug 15, 2013 at 6:51 PM, Wolfgang Laun wrote:

> Rete has listDefrules and Defrule has getConditionalElements, which
> lets you retrieve its constituents, depending on it being a Pattern or
> Accumulate; if it is a Group you must recurse down... It's like
> walking an AST
>
> RHS is similar. But note that fact modifications are possible in
> functions, so if one of these is called on the RHS, you'll have to
> investigate in depth.
>
> Expect to have some fun ;-)
>
> Cheers
> Wolfgang
>
>
> On 14/08/2013, Przemyslaw Woznowski  wrote:
> > Dear Jess users.
> >
> > What I am trying to do is to dynamically list all the defrules together
> > with their LHS and RHS facts excluding any conditions. Basically what I
> > mean is that, for example, if there are Person and Car facts on the
> rule's
> > LHS and the rule asserts an Owner fact, deletes the Car fact and modifies
> > the Person fact. I would like to create a data structure that would, for
> > each rule, carry it's name and the facts it needs to fire (excluding any
> > conditions just deftemplate's name) and any deftemplates that appear on
> the
> > rule's RHS. So for the example above, something like:
> > Rule_1
> >  needs: Person, Car
> >  asserts: Owner
> >  modifies: Person
> >  deletes: Car
> >
> > I can get a list of all defrules via the listDefrules() method called on
> > the Rete object but then it gets tricky. The listNodes() method called on
> > the HasLHS object gives a textual description of the rule's LHS but I
> > cannot find a method that would simply return name of facts on the LHS.
> > Some text processing would solve the rule's LHS problem as I can look for
> > occurrences of "::" to find facts. However, the rule's RHS is more
> > problematic as I cannot find a method that would give me what I want.
> >
> > I would appreciate your help with this one.
> >
> > Best regards,
> > Pete
> >
> > --
> > Przemyslaw (Pete) Woznowski, PhD candidate & RA
> > Email: p.r.woznow...@cs.cardiff.ac.uk
> > Room C/2.06, Desk 8
> > Cardiff School of Computer Science & Informatics,
> > Cardiff University,
> > Queen's Buildings,
> > 5 The Parade, Roath,
> > Cardiff, CF24 3AA, UK
> > & School of Healthcare Studies,
> > Cardiff University
> > Cardigan House
> > Heath Park Campus
> > Cardiff, CF14 4XN, UK
> >
> 
> To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
> in the BODY of a message to majord...@sandia.gov, NOT to the list
> (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
> 
>
>


-- 
Przemyslaw (Pete) Woznowski, PhD candidate & RA
Email: p.r.woznow...@cs.cardiff.ac.uk
Room C/2.06, Desk 8
Cardiff School of Computer Science & Informatics,
Cardiff University,
Queen's Buildings,
5 The Parade, Roath,
Cardiff, CF24 3AA, UK
& School of Healthcare Studies,
Cardiff University
Cardigan House
Heath Park Campus
Cardiff, CF14 4XN, UK


JESS: [EXTERNAL] Docstrings in from-class deftemplates

2013-11-26 Thread Henrique Lopes Cardoso
Hi,

Is there a limitation on the use of documentation strings on deftemplates
using the from-class declaration?
I have something like:

(deftemplate Foo extends Bar
"Documentation string for Foo"
(declare (from-class Foo)) )

Whe accessing the docstring as per Deftemplate.getDocstring(), I am getting
something like "$JAVA-OBJECT$ Foo", instead of the documentation string
proper.

Am I missing something?

Thanks.

Henrique


Re: JESS: [EXTERNAL] Using tests in query variables

2011-11-23 Thread Wolfgang Laun
Within a (defquery) you use (declare (variables ...)) to specify query
parameters, and the (run-query*) function lets you provide values for them.

Usually the condition would have to be part of the query pattern, with only
the value being provided by the run-query* parameter.

-W

On 23 November 2011 00:34, Sam Sarjant  wrote:

> Hello.
>   Is it possible to use tests as variables submitted to queries? Or do
> variables always have to be concrete facts (or already bound facts)?
>
> For example, given the facts (num 0) (num 1) (num 2)..., is it possible to
> perform a query that looks something like (run-query* numQuery ?X&:(<= 0 ?X
> 5)) which will return all nums between 0 and 5 (inclusive).
>
> I gave the above example a go (with the proper definitions and such), but
> it threw an exception at me, telling me 'No such variable X'. This is
> mostly a question out of curiosity, as I don't absolutely need queries to
> accept test variables, but it would be nice if there was some sort of
> functionality to perform this task.
>
> --
> - Thanks, Sam Sarjant
> www.samsarjant.com
>
>


Re: JESS: [EXTERNAL] Jess Rules and CMD Prompt

2012-04-20 Thread Dusan Sormaz
Show us what you tried to do and error that is displayed, and somebody 
may be able to help you.


Dusan Sormaz

On 4/20/2012 10:10 AM, Gianluigi Loffreda wrote:

I have a problem with the Jess Installation.
Following the jess installation instructions I read that right after the
unzip I could create an environment variable JAVA_HOME with the path of the
java.exe to use the Jess also from the Command Prompt.

I created the variable and set it with the correct path but I get a message
that states that the path is uncorrect because it is not a J2SDK
installation.

Does anybody have any idea on how to fix this issue?

Many thanks.

Gianluigi

--
View this message in context: 
http://jess.2305737.n4.nabble.com/Jess-Rules-and-CMD-Prompt-tp4574100p4574100.html
Sent from the Jess mailing list archive at Nabble.com.


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.



-
No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2127 / Virus Database: 2411/4947 - Release Date: 04/19/12



--
***
* Dusan Sormaz, PhD, Associate Professor
* Ohio University
* Department of Industrial and Systems Engineering
* 284 Stocker Center, Athens, OH 45701-2979
* phone: (740) 593-1545
* fax: (740) 593-0778
* e-mail: sor...@ohio.edu
* url: http://www.ohio.edu/people/sormaz
***



To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Jess Rules and CMD Prompt

2012-04-20 Thread Friedman-Hill, Ernest
JAVA_HOME isn't the path to java.exe; it's the path to bin/java.exe. In
other words, JAVA_HOME will be something like

C:\Program Files\jdk1.6.0_23



On 4/20/12 10:10 AM, "Gianluigi Loffreda" 
wrote:

>I have a problem with the Jess Installation.
>Following the jess installation instructions I read that right after the
>unzip I could create an environment variable JAVA_HOME with the path of
>the
>java.exe to use the Jess also from the Command Prompt.
>
>I created the variable and set it with the correct path but I get a
>message
>that states that the path is uncorrect because it is not a J2SDK
>installation. 
>
>Does anybody have any idea on how to fix this issue?
>
>Many thanks. 
>
>Gianluigi
>
>--
>View this message in context:
>http://jess.2305737.n4.nabble.com/Jess-Rules-and-CMD-Prompt-tp4574100p4574
>100.html
>Sent from the Jess mailing list archive at Nabble.com.
>
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Activate a Behaviour Jade from Jess

2012-07-11 Thread lyes
Hello,

I wish activate a behavior of agent from jess.

Exemple : 

My class Agent
--
public class Test1 extends Agent{

protected void setup() {

   System.out.println ("Agent " + getLocalName()+ " I am here
");

   Rete engine = new Rete();
try {
 engine.batch("ex.clp");
Value v = 
engine.executeCommand("(assert(ACLMessage(contenu A)))");
engine.executeCommand("(run)");

} catch (JessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}


public class MyAction extends OneShotBehaviour {

@Override
public void action() {

// TODO Auto-generated method stub

 System.out.println ("Agent " + getLocalName()+
" I am here ");

}

}
}

My file ex.clp
--
(deftemplate ACLMessage  (slot contenu))
(defrule test (ACLMessage (contenu A)) => [// i wish activate behaviour
MyAction Defined in Agent java  for excute instructions//])

Please Help me.
Thank's 


--
View this message in context: 
http://jess.2305737.n4.nabble.com/Activate-a-Behaviour-Jade-from-Jess-tp4654077.html
Sent from the Jess mailing list archive at Nabble.com.


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Jess in a multithreaded environment

2012-12-18 Thread Friedman-Hill, Ernest
Are you adding non-value classes to the list yourself, or is this just with the 
small number of default listings?

This method will get called when you evaluate the hash code of a Java object in 
the Rete memory; this will happen often during pattern matching. There's 
actually enough room to cache the hash code in the members of the Value class 
that are unused for Java object values, so we could try that as a performance 
improvement.  Do you have a source license, so I could send you a patch to try?

From: , Son Nguyen 
mailto:son.ngu...@softwareag.com>>
Reply-To: jess-users 
mailto:jess-us...@mailgate.sandia.gov>>
Date: Thursday, December 13, 2012 11:04 AM
To: jess-users 
mailto:jess-us...@mailgate.sandia.gov>>
Subject: JESS: [EXTERNAL] Jess in a multithreaded environment



Hi Jess experts,

We use Jess in a multi-threaded environment and have experienced some 
performance degradation when going from a single thread to multiple threads.

Our implementation uses the Slot Specific feature.

Using a Java profiler, HashCodeComputer.isValueObject() stood out as one of the 
main contributing factors, if not the most likely,  to the degradation

WG: JESS: [EXTERNAL] Jess in a multithreaded environment

2013-01-03 Thread Henschel, Joerg
Yes, we (Software AG) have a source license, so it'd be great if you could 
provide a patch for this.

Thanks!

Jörg Henschel
Director Research & Development

Email: j.hensc...@itcampus.de
Phone: +49 341 49287-700 | Fax: +49 341 49287-01

itCampus Software- und Systemhaus GmbH | a Software AG Company
Nonnenstrasse 37 | 04229 Leipzig | Germany | http://www.itcampus.de
Amtsgericht Leipzig HRB 15872 | Managing Director: Guido Laures



-Ursprüngliche Nachricht-
Von: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] Im 
Auftrag von Friedman-Hill, Ernest
Gesendet: Dienstag, 18. Dezember 2012 19:50
An: jess-users
Betreff: Re: JESS: [EXTERNAL] Jess in a multithreaded environment

Are you adding non-value classes to the list yourself, or is this just with the 
small number of default listings?

This method will get called when you evaluate the hash code of a Java object in 
the Rete memory; this will happen often during pattern matching. There's 
actually enough room to cache the hash code in the members of the Value class 
that are unused for Java object values, so we could try that as a performance 
improvement.  Do you have a source license, so I could send you a patch to try?

From: , Son Nguyen 
mailto:son.ngu...@softwareag.com>>
Reply-To: jess-users 
mailto:jess-us...@mailgate.sandia.gov>>
Date: Thursday, December 13, 2012 11:04 AM
To: jess-users 
mailto:jess-us...@mailgate.sandia.gov>>
Subject: JESS: [EXTERNAL] Jess in a multithreaded environment



Hi Jess experts,

We use Jess in a multi-threaded environment and have experienced some 
performance degradation when going from a single thread to multiple threads.

Our implementation uses the Slot Specific feature.

Using a Java profiler, HashCodeComputer.isValueObject() stood out as one of the 
main contributing factors, if not the most likely,  to the degradation




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Jess in a multithreaded environment

2013-01-03 Thread Wolfgang Laun
Warning: I may have misunderstood the issue completely.

If there is a list (or any other collection) maintaining the set of
value classes, it stands to reason that it is synchronized for use in
a multithreaded environment, and the contention for its lock may very
well cause a performance hit.  If a lookup using this list is
necessary for distinguishing between constant and non-constant hash
codes, I don't see how caching a constant hash code may improve the
situation.

-W


On 03/01/2013, Henschel, Joerg  wrote:
> Yes, we (Software AG) have a source license, so it'd be great if you could
> provide a patch for this.
>
> Thanks!
>
> Jörg Henschel
> Director Research & Development
>
> Email: j.hensc...@itcampus.de
> Phone: +49 341 49287-700 | Fax: +49 341 49287-01
>
> itCampus Software- und Systemhaus GmbH | a Software AG Company
> Nonnenstrasse 37 | 04229 Leipzig | Germany | http://www.itcampus.de
> Amtsgericht Leipzig HRB 15872 | Managing Director: Guido Laures
>
>
>
> -Ursprüngliche Nachricht-
> Von: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] Im
> Auftrag von Friedman-Hill, Ernest
> Gesendet: Dienstag, 18. Dezember 2012 19:50
> An: jess-users
> Betreff: Re: JESS: [EXTERNAL] Jess in a multithreaded environment
>
> Are you adding non-value classes to the list yourself, or is this just with
> the small number of default listings?
>
> This method will get called when you evaluate the hash code of a Java object
> in the Rete memory; this will happen often during pattern matching. There's
> actually enough room to cache the hash code in the members of the Value
> class that are unused for Java object values, so we could try that as a
> performance improvement.  Do you have a source license, so I could send you
> a patch to try?
>
> From: , Son Nguyen
> mailto:son.ngu...@softwareag.com>>
> Reply-To: jess-users
> mailto:jess-us...@mailgate.sandia.gov>>
> Date: Thursday, December 13, 2012 11:04 AM
> To: jess-users
> mailto:jess-us...@mailgate.sandia.gov>>
> Subject: JESS: [EXTERNAL] Jess in a multithreaded environment
>
>
>
> Hi Jess experts,
>
> We use Jess in a multi-threaded environment and have experienced some
> performance degradation when going from a single thread to multiple
> threads.
>
> Our implementation uses the Slot Specific feature.
>
> Using a Java profiler, HashCodeComputer.isValueObject() stood out as one of
> the main contributing factors, if not the most likely,  to the degradation
>
>
>
> 
> To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
> in the BODY of a message to majord...@sandia.gov, NOT to the list
> (use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
> 
>
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Jess in a multithreaded environment

2013-01-03 Thread Friedman-Hill, Ernest
Hi Wolfgang, 

Jess needs a constant hashcode for any given object, so this mechanism
distinguishes between objects that provide their own constant hashcode and
objects that can't be trusted to do so. The caching I was talking about
would be actually sorting objects into these categories right when the
jess.Value object is created, and storing the (constant) hashcode that was
determined. The only weak point in this is that it would force the user to
establish that a class is a value class before any objects of that type
are referred to.

Another approach would be to use a lock-free container for that list of
classes (i.e., ConcurrentLinkedQueue) which retains that flexibility;
that's what we're actually trying first.


On 1/3/13 12:28 PM, "Wolfgang Laun"  wrote:

>Warning: I may have misunderstood the issue completely.
>
>If there is a list (or any other collection) maintaining the set of
>value classes, it stands to reason that it is synchronized for use in
>a multithreaded environment, and the contention for its lock may very
>well cause a performance hit.  If a lookup using this list is
>necessary for distinguishing between constant and non-constant hash
>codes, I don't see how caching a constant hash code may improve the
>situation.
>
>-W
>
>
>On 03/01/2013, Henschel, Joerg  wrote:
>> Yes, we (Software AG) have a source license, so it'd be great if you
>>could
>> provide a patch for this.
>>
>> Thanks!
>>
>> Jörg Henschel
>> Director Research & Development
>>
>> Email: j.hensc...@itcampus.de
>> Phone: +49 341 49287-700 | Fax: +49 341 49287-01
>>
>> itCampus Software- und Systemhaus GmbH | a Software AG Company
>> Nonnenstrasse 37 | 04229 Leipzig | Germany | http://www.itcampus.de
>> Amtsgericht Leipzig HRB 15872 | Managing Director: Guido Laures
>>
>>
>>
>> -Ursprüngliche Nachricht-
>> Von: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] Im
>> Auftrag von Friedman-Hill, Ernest
>> Gesendet: Dienstag, 18. Dezember 2012 19:50
>> An: jess-users
>> Betreff: Re: JESS: [EXTERNAL] Jess in a multithreaded environment
>>
>> Are you adding non-value classes to the list yourself, or is this just
>>with
>> the small number of default listings?
>>
>> This method will get called when you evaluate the hash code of a Java
>>object
>> in the Rete memory; this will happen often during pattern matching.
>>There's
>> actually enough room to cache the hash code in the members of the Value
>> class that are unused for Java object values, so we could try that as a
>> performance improvement.  Do you have a source license, so I could send
>>you
>> a patch to try?
>>
>> From: , Son Nguyen
>> mailto:son.ngu...@softwareag.com>>
>> Reply-To: jess-users
>> mailto:jess-us...@mailgate.sandia.gov>>
>> Date: Thursday, December 13, 2012 11:04 AM
>> To: jess-users
>> mailto:jess-us...@mailgate.sandia.gov>>
>> Subject: JESS: [EXTERNAL] Jess in a multithreaded environment
>>
>>
>>
>> Hi Jess experts,
>>
>> We use Jess in a multi-threaded environment and have experienced some
>> performance degradation when going from a single thread to multiple
>> threads.
>>
>> Our implementation uses the Slot Specific feature.
>>
>> Using a Java profiler, HashCodeComputer.isValueObject() stood out as
>>one of
>> the main contributing factors, if not the most likely,  to the
>>degradation
>>
>>
>>
>> 
>> To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>> in the BODY of a message to majord...@sandia.gov, NOT to the list
>> (use your own address!) List problems? Notify
>>owner-jess-us...@sandia.gov.
>> 
>>
>>
>
>
>
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Re: Slowly documenting project setup steps

2013-02-19 Thread Grant Rettke
Hi Jessers,

Sorry for just sending a link.

What is going is that I'm blogging the set-up of a Jess+Java project using
my preferred setup.

My goal is to provide a Maven managed project that makes it real easy to
play with Java and Jess together, and figured if anyone might be interested
then they would be on this list.

If it is OK then I will keep posting whenever I put something new out there

RE: JESS: [EXTERNAL] Question on QueryResult close() function

2013-06-28 Thread Friedman-Hill, Ernest
Hi Daniel,

Closing a QueryResult doesn't really do anything important; normal garbage 
collection will free all of its resources.

I used Google to see if there was a standard Jess/Matlab integration that I 
didn't know about, but I didn't find one; I'm afraid I don't know anything 
about how Jess and Matlab are typically used together. Jess does "warm up" for 
a few iterations if run repeatedly with the same rules - i.e., "(reset)" won't 
necessarily get you back to the same memory usage as before the first run - but 
this levels off quickly. It would be a good idea to run a heap analyzer tool to 
see what kind of objects are being leaked; that might give us a clue as to 
what's happening.

From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Daniel Selva
Sent: Thursday, June 27, 2013 12:53 PM
To: jess-users
Subject: JESS: [EXTERNAL] Question on QueryResult close() function

Hi,

I am experiencing a memory leak problem in a Matlab-Jess application and I am 
trying to locate the leak. I came across the definition of the close() method 
of the QueryResult class. I have never called this method after using queries.

1) Should I call close() after using a query?
2) Could not calling close() be the cause of the leak?

If not, I would appreciate any tips on typical causes of leaks in Matlab-Jess 
applications.

Thanks in advance,

Daniel


Re: JESS: [EXTERNAL] Question on QueryResult close() function

2013-06-28 Thread Peter Lin
Hi Daniel,

How are you measuring the leak?

It is important to look at the heap used and not the total heap allocated
to the JVM process. What I've done in the past with JESS is write a
function that uses java's runtime class to get actual memory used stats.

Runtime rt = Runtime.getRuntime();
long free = rt.freeMemory();
long total = rt.totalMemory();

If you have concerns about JVM heap getting to big, then set -Xmx to the
value you desire. If runtime stats don't help, your only viable option is
to use a profiling tool like YourKit, JProbe or some other profiler to
track down the leak.

peter


On Fri, Jun 28, 2013 at 9:21 AM, Friedman-Hill, Ernest
wrote:

>  Hi Daniel,
>
> ** **
>
> Closing a QueryResult doesn’t really do anything important; normal garbage
> collection will free all of its resources.
>
> ** **
>
> I used Google to see if there was a standard Jess/Matlab integration that
> I didn’t know about, but I didn’t find one; I’m afraid I don’t know
> anything about how Jess and Matlab are typically used together. Jess does
> “warm up” for a few iterations if run repeatedly with the same rules –
> i.e., “(reset)” won’t necessarily get you back to the same memory usage as
> before the first run – but this levels off quickly. It would be a good idea
> to run a heap analyzer tool to see what kind of objects are being leaked;
> that might give us a clue as to what’s happening.
>
> ** **
>
> *From:* owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] *On
> Behalf Of *Daniel Selva
> *Sent:* Thursday, June 27, 2013 12:53 PM
> *To:* jess-users
> *Subject:* JESS: [EXTERNAL] Question on QueryResult close() function
>
> ** **
>
> Hi,
>
> ** **
>
> I am experiencing a memory leak problem in a Matlab-Jess application and I
> am trying to locate the leak. I came across the definition of the close()
> method of the QueryResult class. I have never called this method after
> using queries. 
>
> ** **
>
> 1) Should I call close() after using a query?
>
> 2) Could not calling close() be the cause of the leak? 
>
> ** **
>
> If not, I would appreciate any tips on typical causes of leaks in
> Matlab-Jess applications. 
>
> ** **
>
> Thanks in advance,
>
>
> Daniel
>


JESS: [EXTERNAL] Fwd: Problems with fuzzy jess implementations

2013-07-11 Thread Martín Rodríguez
Hi, I could overcome some problems with FuzzyJess implementation, and now I
have a fuzzy rule that never executes when it should.
My Clip run using BackwardChaining, Im sure that the *intensidad_tos *rule
assert the gripe fuzzyvalue fine, but the *global_influenza *rule never
trigger,

Somebody can help me with that??

Thanks

The code is the next:

*(defglobal ?*fuzzyDiagnosticoGripe* = (new FuzzyVariable
"Diagnostico_gripal" 0.0 5.0 "integer"))*
*
*
*
(defrule diagnostico_init
=>
;; the nrc FuzzyJess functions are loaded
(load-package nrc.fuzzy.jess.FuzzyFunctions)
(bind ?rlf (new RightLinearFunction))
(bind ?llf (new LeftLinearFunction))
;; terms
(?*fuzzyDiagnosticoGripe* addTerm "Comun" (new RFuzzySet 0.0 2.5
?rlf))
(?*fuzzyDiagnosticoGripe* addTerm "N1H1" (new LFuzzySet 2.5 5.0
?llf))
)

(defrule intensidad_tos
(declare (auto-focus TRUE))
(check diagnostico-b)
(answer (ident fuzzy_tos) (text yes))
=>
(assert (gripe (new nrc.fuzzy.FuzzyValue ?*fuzzyDiagnosticoGripe*
"N1H1")))
)

(defrule global_influenza
(gripeGlobal ?gg&:(fuzzy-match ?gg "N1H1"))
 =>
   (MAIN::recommend-action "N1H1")
   (halt)
)
*


Motor_Diagnostico_General.clp
Description: Binary data


JESS: [EXTERNAL] Representing jess rule from nested objects

2013-07-11 Thread srinaththaiyar . aravamudan
Hi Jess Experts,

I am a JESS newbie and want to understand whether I am writing the below rule 
in JESS correctly:

We have a User Object and each user has a set of applications associated. Each 
application has a set of accounts and in turn each account has a set of 
profiles.

User Hierarchy:

User {username}
List of Applications {Application - {appName, userName}}
List of Accounts - { Account - {accountName, appName, username}}
List of Profiles - {Profile - {name, accountName, username}}

The rule we want to check is
If an user has a Profile (name = A) in account 1, Profile (name = B) in the 
same account (account 1)
and Profile (name = C) in account 2, Profile (name = D) in account 2
then fire the rule.


Jess Rule:

(defrule AFTS_RULE_01
(User (userName ?userName))
(Application (appName ?appName&:(eq ?appName "AFTS")) (userName ?userName))
(Account (accountName ?accountName1) (userName ?userName))
(Profile (name ?name1&:(eq ?name1 "A")) (accountName ?accountName1) (userName 
?userName))
(Profile (name ?name2&:(eq ?name2 "B")) (accountName ?accountName1) (userName 
?userName))
(Account (accountName ?accountName2&~accountName1) (userName ?userName))
(Profile (name ?name3&:(eq ?name3 "C")) (accountName ?accountName2) (userName 
?userName))
(Profile (name ?name4&:(eq ?name4 "D")) (accountName ?accountName2) (userName 
?userName))
=>
(printout t "ATFS Rule satisfied for " ?appName crlf)
)

Currently we have introduced a variable username in all the objects to maintain 
the relationship between the User object and the child objects.

Is the above rule representation correct or is there a better way to represent 
this rule in Jess?

Regards
Srinath

___

This message is for information purposes only, it is not a recommendation, 
advice, offer or solicitation to buy or sell a product or service nor an 
official confirmation of any transaction. It is directed at persons who are 
professionals and is not intended for retail customer use. Intended for 
recipient only. This message is subject to the terms at: 
www.barclays.com/emaildisclaimer.

For important disclosures, please see: 
www.barclays.com/salesandtradingdisclaimer regarding market commentary from 
Barclays Sales and/or Trading, who are active market participants; and in 
respect of Barclays Research, including disclosures relating to specific 
issuers, please see http://publicresearch.barclays.com.

___


JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Aurelien Mazurie
Dear Jess users,
I am wondering how to write a rule that would dynamically match multiple
facts based on their names.

Let say I have two types of facts; one representing the information that an
item (with a given name) exists, and the other one representing a list of
items (e.g., as a list of names in a multislot). It could be something like
this:

  (deftemplate item (slot name))
  (deftemplate bag-of-items (multislot names))

  (assert (item (name A))
  (assert (bag-of-items (names A B))

What I am trying to write is a rule that would, for any bag-of-items fact,
fire if all the items listed in the multislot 'name' are item facts that
have been asserted.

I am wondering if there is an easy way to do that, or if I'll need to hack
my way through it with loops and tests in the LHS of my rule.

Any suggestion?
Best,
Aurélien



--
View this message in context: 
http://jess.2305737.n4.nabble.com/Dynamic-rule-matching-in-the-LHS-tp4654176.html
Sent from the Jess mailing list archive at Nabble.com.



To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] Issue with static methods (or generics?)

2013-08-07 Thread Aurélien Mazurie
Dear Jess users,
I am having trouble instantiating a Java class from within a rule's RHS, and 
cannot figure out how to solve this problem.

The code in my RHS creates an instance of a class from the JGraphT library. As 
seen in  
https://github.com/jgrapht/jgrapht/blob/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java
 (lines 91-92), the creation of a DefaultDirectedGraph instance require another 
class as argument; here, DefaultEdge.

I couldn't find an example in the Jess documentation about how to do that. For 
example, I tried the following:

(bind ?edge-class org.jgrapht.graph.DefaultEdge)
(bind ?graph (new org.jgrapht.graph.DefaultDirectedGraph ?edge-class))

I also tried variations such as

(bind ?edge-class org.jgrapht.graph.DefaultEdge)
(bind ?graph (new org.jgrapht.graph.DefaultDirectedGraph (?edge-class 
getClass))

or

(bind ?edge-class (new org.jgrapht.graph.DefaultEdge))
(bind ?graph (new org.jgrapht.graph.DefaultDirectedGraph ?edge-class))

Any idea about what the syntax should be to properly instantiate the 
DefaultDirectedGraph class? For information (but not certain how relevant it is 
here), I succeeded in the past in using java.util.regex.Pattern and its static 
method 'compile' by typing

(bind ?pattern-class java.util.regex.Pattern)
(bind ?matches ((?pattern-class compile "...") matcher ?string))

Best,
Aurélien

JESS: [EXTERNAL] Access public enum inside of a class

2011-12-07 Thread Hunter McMillen
Hi everyone,

I am trying to use an enum from one of my Java classes inside of Jess. I
read a forum post that said I could use the (import ) feature to
import enums into Jess, but that only seems to work when the enum is itself
in a separate file.

I have a class called UnitType, inside of it there is a public enum called
UnitTypes where all of the UnitTypes in my game are listed. In Java to
access this I would use UnitType.UnitTypes. to get to the
enum.

When I try this in Jess however, I get an error:
*Rete engine = new Rete();*
*engine.executeCommand("(import eisbot.proxy.types.UnitType.UnitTypes)");*

an error occurs,* "java.lang.ClassNotFoundException:
eisbot.proxy.types.UnitType.UnitTypes"*

I am curious as to how I could go about accessing an enum that is inside of
a Java class from Jess.

any help would be appreciated.

Thanks
Hunter McMillen


JESS: [EXTERNAL] Iterate over a Java List in Jess

2011-12-13 Thread Hunter McMillen
Is there anyway to iterate over a Java List object from Jess?

I have a Java object that I store in a Jess variable:

engine.getGlobalContext().setVariable("bwapi", new Value(bwapi));

one of the methods that can be called on bwapi returns a Java ArrayList,
and I would like to be able to iterate over this list to check certain
properties of its elements.

Right now I am doing this:

engine.executeCommand("(bind ?units (create$ =(?bwapi getMyUnits)))");
engine.executeCommand("foreach ?u ?units (printout t ?u crlf))");

but when the units are supposed to be printed all I get is:

=


Any ideas?

Thanks,
Hunter M


JESS: [EXTERNAL] Jess asserts fact that is not true

2012-06-26 Thread Dwight Hare
I am trying to reason about the passage of time in my rules. I would like to 
write the following rule:

(defrule Test
?r <- (logical (CurrentTime))
(logical (Condition (time ?time&:(> (+ ?time 5) ?r.t
=>
(assert (Condition-met))
)

Where "CurrentTime" is a fact that holds the current time, and I change the 
slot value "t" as time progresses. The rule fires if the "time" slot in the 
Condition plus 5 is greater than the current time (that is, is true within the 
last 5 time increments). But this syntax is not allowed because you cannot 
access a dotted variable (the "?r.t") here.

My first alternative was to declare a defglobal called "*time*" and have that 
change value as time progresses. But there is no way to make the global a 
"logical" dependency of the asserted condition-met so it doesn't get retracted 
when the global changes in value sufficient to make the rule no longer be true.

I came up with a workaround where in addition to the defglobal "*time*" I 
assert a Fact called CurrentTime that holds the same value in the "t" slot. Now 
my rule is:

(defrule Test
?r <- (logical (CurrentTime (t ?t&:(= ?t ?*time*
(logical (Condition (time ?time&:(> (+ ?time 5) ?*time* 
 ; Note I use the global here instead of the dotted var but the value is the 
same
=>
(assert (Condition-met (globtime ?*time*)(facttime ?r.t)))
)

This says that if there is a CurrentTime fact whose slot "t" has the same value 
as the global "*time*" and there is a Condition whose "time" slot plus 5 is 
greater than that time, then assert the Condition-met. My java code sets the 
global to "4", asserts the fact "(CurrentTime (t 4))", and then asserts the 
fact "(Condition (time 0))". Since all the conditions are met the rules engine 
asserts the fact "(MAIN::Condition-met (globtime 4) (facttime 4))". All is well 
though a bit clumsy. Now I want to move time forward where the "Condition-met" 
should no longer be true. I change the global to 10 and modify the CurrentTime 
fact and set the "t" slot to 10 too.

Then I run the rules engine and it retracts the "(MAIN::Condition-met (globtime 
4) (facttime 4))" but then mysteriously asserts "(MAIN::Condition-met (globtime 
10) (facttime 10))". Since the Condition time of 0 plus 5 is not greater than 
10, it should not have asserted this. Here is a dump of the facts in the rules 
engine at the end:

0: (MAIN::CurrentTime (t 10))
1: (MAIN::Condition (time 0))
3: (MAIN::Condition-met (globtime 10) (facttime 10))

I see no justification for the 3rd fact given the only rule I have.

Is there a better way of accomplishing this?

Dwight


Re: JESS: [EXTERNAL] Activate a Behaviour Jade from Jess

2012-07-11 Thread Friedman-Hill, Ernest
In your setup() method, do something like

Rete engine = new Rete();
try {
engine.store("AGENT", this);
engine.batch("ex.clp");
Value v = engine.executeCommand("(assert(ACLMessage(contenu A)))");
engine.executeCommand("(run)");
...

Then in Jess code, you can get access to the "Test1" object by calling

(fetch "AGENT")

And call Java methods on that object as needed. I'm afraid I can't help
any more than that, since you haven't told us anything about what
"activating a behavior" might entail.



On 7/11/12 7:36 AM, "lyes"  wrote:

>Hello,
>
>I wish activate a behavior of agent from jess.
>
>Exemple : 
>
>My class Agent
>--
>public class Test1 extends Agent{
>   
>   protected void setup() {
>
>   System.out.println ("Agent " + getLocalName()+ " I am here
>");
>
>   Rete engine = new Rete();
>   try {
>engine.batch("ex.clp");
>   Value v = 
> engine.executeCommand("(assert(ACLMessage(contenu A)))");
>   engine.executeCommand("(run)");
>   
>   } catch (JessException e) {
>   // TODO Auto-generated catch block
>   e.printStackTrace();
>   }
>}
>
>
>public class MyAction extends OneShotBehaviour {
>
>   @Override
>   public void action() {
>   
>   // TODO Auto-generated method stub
>
> System.out.println ("Agent " +
>getLocalName()+
>" I am here ");
>   
>   }
>   
>   }
>}
>
>My file ex.clp
>--
>(deftemplate ACLMessage  (slot contenu))
>(defrule test (ACLMessage (contenu A)) => [// i wish activate behaviour
>MyAction Defined in Agent java  for excute instructions//])
>
>Please Help me.
>Thank's 
>
>
>--
>View this message in context:
>http://jess.2305737.n4.nabble.com/Activate-a-Behaviour-Jade-from-Jess-tp46
>54077.html
>Sent from the Jess mailing list archive at Nabble.com.
>
>
>To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
>in the BODY of a message to majord...@sandia.gov, NOT to the list
>(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




RE: JESS: [EXTERNAL] Activate a Behaviour Jade from Jess

2012-07-11 Thread lyes

Hello, 
Sorry To disturb you,

My Objective with jess is to run the behaviours of agent.

in méthode setup () i insert in the template information as contenu ..etc, and 
i make rules to resound.

in my class "Test1" i have :

public class Test1 extends Agent{



protected void setup() {


  (insertion into template).
}


And i have somme behavours as fo exemple behaviour to make addition.

 public class Addition extends OneShotBehaviour {


@Override

public void action() {



// TODO Auto-generated method stub


Make (A + B).


}



in jess :
--
I make rule to run behaviours. For exemple : 
(deftemplate ACLMessage  (slot contenu))

(defrule test (ACLMessage (contenu A)) => ( rune behaviour addition ).

But i have 2 problem : when a assert into template from java, he don't make it. 
the seconde problem is to rune behaviour.

Thank's for all 
Date: Wed, 11 Jul 2012 06:22:11 -0700
From: ml-node+s2305737n4654079...@n4.nabble.com
To: clarke_ste...@hotmail.com
Subject: Re: JESS: [EXTERNAL] Activate a Behaviour Jade from Jess



In your setup() method, do something like


Rete engine = new Rete();

try {

engine.store("AGENT", this);

engine.batch("ex.clp");

Value v = engine.executeCommand("(assert(ACLMessage(contenu A)))");

engine.executeCommand("(run)");

...


Then in Jess code, you can get access to the "Test1" object by calling


(fetch "AGENT")


And call Java methods on that object as needed. I'm afraid I can't help

any more than that, since you haven't told us anything about what

"activating a behavior" might entail.




On 7/11/12 7:36 AM, "lyes" <[hidden email]> wrote:


>Hello,

>

>I wish activate a behavior of agent from jess.

>

>Exemple : 

>

>My class Agent

>--

>public class Test1 extends Agent{

>   

>   protected void setup() {

>

>   System.out.println ("Agent " + getLocalName()+ " I am here

>");

>

>   Rete engine = new Rete();

>   try {

>engine.batch("ex.clp");

>   Value v = 
> engine.executeCommand("(assert(ACLMessage(contenu A)))");

>   engine.executeCommand("(run)");

>   

>   } catch (JessException e) {

>   // TODO Auto-generated catch block

>   e.printStackTrace();

>   }

>}

>

>

>public class MyAction extends OneShotBehaviour {

>

>   @Override

>   public void action() {

>   

>   // TODO Auto-generated method stub

>

> System.out.println ("Agent " +

>getLocalName()+

>" I am here ");

>   

>   }

>   

>   }

>}

>

>My file ex.clp

>--

>(deftemplate ACLMessage  (slot contenu))

>(defrule test (ACLMessage (contenu A)) => [// i wish activate behaviour

>MyAction Defined in Agent java  for excute instructions//])

>

>Please Help me.

>Thank's 

>

>

>--

>View this message in context:

>http://jess.2305737.n4.nabble.com/Activate-a-Behaviour-Jade-from-Jess-tp46
>54077.html

>Sent from the Jess mailing list archive at Nabble.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].

>





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












If you reply to this email, your message will be added to the 
discussion below:

http://jess.2305737.n4.nabble.com/Activate-a-Behaviour-Jade-from-Jess-tp4654077p4654079.html



To unsubscribe from Activate a Behaviour Jade from Jess, click 
here.

NAML
  

--
View this message in context: 
http://jess.2305737.n4.nabble.com/Activate-a-Behaviour-Jade-from-Jess-tp4654077p4654081.html
Sent from the Jess mailing list archive at Nabble.com.

Re: JESS: [EXTERNAL] Activate a Behaviour Jade from Jess

2012-07-12 Thread Wolfgang Laun
You cannot call the action() method of a Behaviour subtype. One of the
paradigms to make an Agent do some useful work is to send it messages,
and the agent's behaviour (typically a CyclingBehaviour) processes
these messages. The message contents could be processed by a Jess
engine.

Develop an Agent capable of receiving and printing messages, without
Jess. Make sure that it works.

Separately, develop a Java program running Jess and inserting facts
from Java, and observe that your rules fire. If you have any problems,
post *full* code on this list.

-W


On 11/07/2012, lyes  wrote:
>
> Hello,
> Sorry To disturb you,
>
> My Objective with jess is to run the behaviours of agent.
>
> in méthode setup () i insert in the template information as contenu ..etc,
> and i make rules to resound.
>
> in my class "Test1" i have :
>
> public class Test1 extends Agent{
>
>
>
> protected void setup() {
>
>
>   (insertion into template).
> }
>
>
> And i have somme behavours as fo exemple behaviour to make addition.
>
>  public class Addition extends OneShotBehaviour {
>
>
> @Override
>
> public void action() {
>
>
>
> // TODO Auto-generated method stub
>
>
> Make (A + B).
>
>
> }
>
>
>
> in jess :
> --
> I make rule to run behaviours. For exemple :
> (deftemplate ACLMessage  (slot contenu))
>
> (defrule test (ACLMessage (contenu A)) => ( rune behaviour addition ).
>
> But i have 2 problem : when a assert into template from java, he don't make
> it. the seconde problem is to rune behaviour.
>
> Thank's for all
> Date: Wed, 11 Jul 2012 06:22:11 -0700
> From: ml-node+s2305737n4654079...@n4.nabble.com
> To: clarke_ste...@hotmail.com
> Subject: Re: JESS: [EXTERNAL] Activate a Behaviour Jade from Jess
>
>
>
>   In your setup() method, do something like
>
>
> Rete engine = new Rete();
>
> try {
>
> engine.store("AGENT", this);
>
> engine.batch("ex.clp");
>
> Value v = engine.executeCommand("(assert(ACLMessage(contenu A)))");
>
> engine.executeCommand("(run)");
>
> ...
>
>
> Then in Jess code, you can get access to the "Test1" object by calling
>
>
> (fetch "AGENT")
>
>
> And call Java methods on that object as needed. I'm afraid I can't help
>
> any more than that, since you haven't told us anything about what
>
> "activating a behavior" might entail.
>
>
>
>
> On 7/11/12 7:36 AM, "lyes" <[hidden email]> wrote:
>
>
>>Hello,
>
>>
>
>>I wish activate a behavior of agent from jess.
>
>>
>
>>Exemple :
>
>>
>
>>My class Agent
>
>>--
>
>>public class Test1 extends Agent{
>
>>  
>
>>  protected void setup() {
>
>>
>
>>   System.out.println ("Agent " + getLocalName()+ " I am here
>
>>");
>
>>
>
>>   Rete engine = new Rete();
>
>>  try {
>
>>   engine.batch("ex.clp");
>
>>  Value v = 
>> engine.executeCommand("(assert(ACLMessage(contenu A)))");
>
>>  engine.executeCommand("(run)");
>
>>  
>
>>  } catch (JessException e) {
>
>>  // TODO Auto-generated catch block
>
>>  e.printStackTrace();
>
>>  }
>
>>}
>
>>
>
>>
>
>>public class MyAction extends OneShotBehaviour {
>
>>
>
>>  @Override
>
>>  public void action() {
>
>>  
>
>>  // TODO Auto-generated method stub
>
>>
>
>> System.out.println ("Agent " +
>
>>getLocalName()+
>
>>" I am here ");
>
>>  
>
>>  }
>
>>  
>
>>  }
>
>>}
>
>>
>
>>My file ex.clp
>
>>--
>
>>(deftemplate ACLMessage  (slot contenu))
>
>>(defrule test (ACLMessage (contenu A)) => [// i wish activate behaviour
>
>&

JESS: [EXTERNAL] Invitation to IntelliFest 2012 for Jess Users

2012-07-27 Thread Jason Morris
 
www.intellifest.org

Invent * Innovate * Implement at IntelliFest!

Dear Jess User Group Members,

You are cordially invited to attend this year's IntelliFest: Intenational
Conference on Reasoning Technologies , October
22-26, at the Bahia Resort Hotel in San Diego, CA. IntelliFest is the next
evolution beyond Rules Fest, and the premier conference for developers who
use applied AI.

This year, we're offering a dual track format featuring a new
business/managerial track in addition to our core developer/technical
track.  Our keynotes feature Dr. Douglas Lenat, the originator of the Cyc
Project and CEO of Cycorp.  Our boot camps are back with a full day of
hands-on Drools, and we're adding a whole day-long session on rules
technologies in Healthcare led by Dr. David Sottara and Dr. Emory Fry.

For all the information, go to our website:  http://intellifest.org  and
please contact us at i...@intellifest.org if you have any questions.

 Special Offer For Jess User Group **Members 

Use the code *IF2012_4_JESSUSERS* when you register and receive 10% off
your total invoice!

Hope to see you there!
Cheers,
Jason

-- 
*Jason C. Morris*
President, Principal Consultant
Morris Technical Solutions LLC
President, Rules Fest Association
Chairman, IntelliFest 2012: International Conference on Reasoning
Technologies

phone: +01.517.376.8314
skype: jcmorris-mts
email: consult...@morris-technical-solutions.com
mybio: http://www.linkedin.com/in/jcmorris


JESS: [EXTERNAL] What does the .CLP extension stand for?

2012-11-15 Thread Grant Rettke
What does the .CLP extension stand for?

-- 
Grant Rettke | ACM, AMA, COG, IEEE
gret...@acm.org | http://www.wisdomandwonder.com/
Wisdom begins in wonder.
((λ (x) (x x)) (λ (x) (x x)))


JESS: [EXTERNAL] Anyone ran JESS on a realtime NIX?

2013-03-28 Thread Grant Rettke
Hi,

I'm curious about setting up a balancing robot just for the fun of it.

I'm wondering if any of you have any knowledge of people using JESS on a
realtime UNIXes, or for that matter, doing anything hardware control wise?

Best wishes,

Grant


JESS: [EXTERNAL] [CFP] 3rd CHR Summer School in Berlin

2013-04-04 Thread Thom Fruehwirth


3rd CHR Summer School in Berlin

"Third time's the charm"
Programming and Reasoning with Rules and Constraints
http://met.guc.edu.eg/CHR2013/

After going to Belgium and Egypt, and having attracted over 50
participants to learn about and to discuss engaging topics related to
Constraint Programming (CP) and Constraint Handling Rules(CHR),
the third summer school will take place this year in Germany.

Where? - GUC Berlin, Germany

When?  - 8th to 12th of July, 2013

Why? - To introduce rule-based and constraint-based high-level
   declarative programming, and to provide insights based on
   these concepts for the analysis of programs, whilst
   covering a wide range of topics of varying difficulty
   from theory to practice

Who? - For students, researchers, interested practitioners around the
   world who wish to learn about CP and CHR, the only prerequisites
   are a working knowledge of English and basic knowledge of logic
   and Prolog (typically covered in undergraduate classes)

Topics?
1. Introduction to Constraint Programming and Modeling a Constraint 
Problem

2. Consistency Techniques and Constraint Reasoning
3. Constraint-Based Scheduling
4. Introduction to Constraint Handling Rules (CHR)
5. Implementing Constraint Solvers using CHR
6. Analysis of CHR Solvers
7. Abductive Reasoning and language processing with CHR
8. Probabilistic CHR: CHRiSM
9. Source to Source Transformation for CHR
   10. Parallel Execution of CHR on a Graphical Processing Unit
   11. Confluence Analysis of CHR Programs
   12. Optimizing Compilation of CHR
   13. ASV Roboat - an autonomous sailing boat for ocean monitoring and 
its long-term routing



Early Registration deadline   - April 30, 2013

Normal Registration deadline  - June 15, 2013

http://met.guc.edu.eg/CHR2013/

With support from GUC Egypt and DAAD Germany





To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




RE: JESS: [EXTERNAL] Usage of abstract classes in rules

2013-05-21 Thread Friedman-Hill, Ernest
Typically slots come from JavaBeans properties, not fields – i.e., accessor 
methods like getEventID(). But if you specify “include-variables” when you 
create a deftemplate from a class, then public (and only public!) member fields 
will be used as well. See  
http://www.jessrules.com/jess/docs/71/memory.html#shadow_facts  .

From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Tom De Costere
Sent: Tuesday, May 21, 2013 6:24 AM
To: jess-users
Subject: JESS: [EXTERNAL] Usage of abstract classes in rules

Hello,

I currently have some abstract classes which are then implemented in various 
other classes extending those abstract classes. Now I’ve been trying to get 
Jess to work with both the abstract class as the implementation class, but 
somehow Jess cannot reach to the fields/methods specified in the abstract 
classes?

Is this normal functionality of Jess or must I make such a conversion object 
that contains both the fields from the abstract class as the fields from the 
implementation class?


Example:

My abstract class AbstractApplicationEvent contains following protected fields:
- eventID
- eventName
- eventTimestamp

My subclass ConnectionMadeEvent extending the abstract class above no extra 
fields, but can be extended in the future.

Rule:

(defrule connection_established
(declare (salience 50))
?f1 <- (ConnectionMadeEvent (eventID ?id) (eventTimestamp ?eventTimestamp))
=>
(assert (Notification (icon "ICON_CONNECTION_ACTIVE") (generationTime 
?eventTimestamp) (event ?f1)))
)

Error message:

SEVERE: Error loading Ruleset from: rules/global_rules.clp
Jess reported an error in routine Jesp.parsePattern.
  Message: No such slot eventTimestamp in template MAIN::ConnectionMadeEvent at 
token 'eventTimestamp'.
  Program text: ( defrule connection_established ( declare ( salience 50 ) ) 
?f1 <- ( ConnectionMadeEvent ( eventID ?id ) ( eventTimestamp  at line 110 in 
file rules/global_rules.clp.
...


Thanks in advance!

Tom DC



JESS: [EXTERNAL] Creating an eLearning system following TekMart example

2013-06-24 Thread Rejaul Barbhuiya
Kindly bear with me as I explain my query...

I am developing an Intelligent Tutoring System using Jess + Servlet + Jsp.
It will perform following actions (implemented as rules):

1. if student has completed a given task within specified time then give
him next task. else jess rules will decide a suitable feedback message for
the student (e.g., hurry up!).

2. a student while solving a multiple choice question (maintained as a
question fact) can attempt more than once till answers correctly. Here
number of attempts will be passes from a JSP page to a servlet page. The
servlet will modify the attempt_count SLOT in jess fact and the engine will
run and decide next suitable action.

a question fact initially is:

(deffacts question_objects
(question (object-name "eaxmple1.html") (type question) (lo-id 10302)
(reqd-time 25) (prev-lo-id 10301) (next-lo-id 10303) (diff-level medium)
(attempt-count (default 0)))

(theory (object-name "theory1.html") (type theory) (lo-id 103) (reqd-time
45) (prev-lo-id 102) (next-lo-id 104) (diff-level easy) (status incomplete))
)

Now, dynamically, i want to update the first fact's attempt-count slot
value.

But I have no clue how to get hold of that particular fact to call modify()
from Java?

Please let me know if I should be more detailed.

Thanking you,
-- 
*Rejaul Karim Barbhuiya*
Senior Research Fellow

Department of Computer Science
Jamia Millia Islamia
New Delhi, India
Phone: +91-9891430568


RE: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Friedman-Hill, Ernest
Not sure what "dynamic" means in this context. But you can use the "forall" 
conditional element to implement this rule. You could read the LHS here as "For 
all values of ?name in bag-of-items, there's a corresponding item fact."

(defrule check-bag-valid
(forall
(bag-of-items (names $??name   $?))
(item (name ?name)))
=>
(printout t "The bag is valid" crlf))

NOTE: Like many complex Jess rules, this one won't fire unless before adding 
your facts you've executed the "(reset)" command to asset (initial-fact).


-Original Message-
From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Aurelien Mazurie
Sent: Friday, July 26, 2013 4:56 PM
To: jess-users
Subject: JESS: [EXTERNAL] Dynamic rule matching in the LHS

Dear Jess users,
I am wondering how to write a rule that would dynamically match multiple facts 
based on their names.

Let say I have two types of facts; one representing the information that an 
item (with a given name) exists, and the other one representing a list of items 
(e.g., as a list of names in a multislot). It could be something like
this:

  (deftemplate item (slot name))
  (deftemplate bag-of-items (multislot names))

  (assert (item (name A))
  (assert (bag-of-items (names A B))

What I am trying to write is a rule that would, for any bag-of-items fact, fire 
if all the items listed in the multislot 'name' are item facts that have been 
asserted.

I am wondering if there is an easy way to do that, or if I'll need to hack my 
way through it with loops and tests in the LHS of my rule.

Any suggestion?
Best,
Aurélien



--
View this message in context: 
http://jess.2305737.n4.nabble.com/Dynamic-rule-matching-in-the-LHS-tp4654176.html
Sent from the Jess mailing list archive at Nabble.com.



To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own 
address!) List problems? Notify owner-jess-us...@sandia.gov.




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Jason Morris
Another "old skool" way of doing it using predicate constraints is...

(clear)
(deftemplate item (slot name))
(deftemplate bag-of-items (multislot item-names))

(defrule fire-for-all-members-in-bag
  ; If you have a bag of item names ...
  (bag-of-items (item-names $?item-names))
  ; and there is an item whose name is member of this bag ...
  ?item <-(item (name ?name&:(member$ ?name $?item-names)))
 =>
  ; ...then do something interesting
  (printout t ?name " is in the bag!" crlf))

;; Program
(reset)
(assert (item (name A)))
(assert (item (name B)))
(assert (item (name C)))
(assert (bag-of-items (item-names A B C)))
(run)

*Jason C. Morris*
President, Principal Consultant
Morris Technical Solutions LLC
President, Rules Fest Association
Chairman, IntelliFest 2013: International Conference on Reasoning
Technologies

phone: +01.517.376.8314
skype: jcmorris-mts
email: consult...@morris-technical-solutions.com
mybio: http://www.linkedin.com/in/jcmorris



www.intellifest.org
Invent * Innovate * Implement at IntelliFest!


On Fri, Jul 26, 2013 at 4:55 PM, Aurelien Mazurie wrote:

> Dear Jess users,
> I am wondering how to write a rule that would dynamically match multiple
> facts based on their names.
>
> Let say I have two types of facts; one representing the information that an
> item (with a given name) exists, and the other one representing a list of
> items (e.g., as a list of names in a multislot). It could be something like
> this:
>
>   (deftemplate item (slot name))
>   (deftemplate bag-of-items (multislot names))
>
>   (assert (item (name A))
>   (assert (bag-of-items (names A B))
>
> What I am trying to write is a rule that would, for any bag-of-items fact,
> fire if all the items listed in the multislot 'name' are item facts that
> have been asserted.
>
> I am wondering if there is an easy way to do that, or if I'll need to hack
> my way through it with loops and tests in the LHS of my rule.
>
> Any suggestion?
> Best,
> Aurélien
>
>
>
> --
> View this message in context:
> http://jess.2305737.n4.nabble.com/Dynamic-rule-matching-in-the-LHS-tp4654176.html
> Sent from the Jess mailing list archive at Nabble.com.
>
>
> 
> To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
> in the BODY of a message to majord...@sandia.gov, NOT to the list
> (use your own address!) List problems? Notify owner-jess-us...@sandia.gov

Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-30 Thread Aurelien Mazurie
Thank you very much for this answer. It seems like 'forall' will fire the rule 
only if all the 'bag-of-items' facts are validated (i.e., if all of them have 
'item' facts with the names listed in their 'names' slot). Is that correct?

If yes, then what I am trying to do is slightly different. I do expect to have 
some of the 'bag-of-items' facts failing the validation. What I want is to act 
upon those who pass (and also, incidentally, on those who do not pass).

Is there a way to keep track of which, among all the 'bag-of-items' facts, are 
validated by the 'forall' CE?

Best,
Aurélien

ps: 'dynamic' may be a poor choice of words. I meant that the LHS had to 
dynamically adapt to the content of a fact's multislot, different from one fact 
to another

On Jul 30, 2013, at 8:21 AM, "Friedman-Hill, Ernest [via Jess]" 
 wrote:

> Not sure what "dynamic" means in this context. But you can use the "forall" 
> conditional element to implement this rule. You could read the LHS here as 
> "For all values of ?name in bag-of-items, there's a corresponding item fact." 
> 
> (defrule check-bag-valid 
> (forall 
> (bag-of-items (names $??name   $?)) 
> (item (name ?name))) 
> => 
> (printout t "The bag is valid" crlf)) 
> 
> NOTE: Like many complex Jess rules, this one won't fire unless before adding 
> your facts you've executed the "(reset)" command to asset (initial-fact). 





--
View this message in context: 
http://jess.2305737.n4.nabble.com/Dynamic-rule-matching-in-the-LHS-tp4654176p4654180.html
Sent from the Jess mailing list archive at Nabble.com.

Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-31 Thread Aurelien Mazurie
Thank you for this tip. It is not what I am trying to achieve, however. I must 
apologize if my original email was misunderstood.

My goal is to write a rule that would fire for any 'bag-of-items' fact whose 
item names, as listed in a multislot, are all represented by 'item' facts. The 
rule should not fire if one or more of these items are absent from the fact 
list:

(item (name A))
(item (name B))
(bag-of-items (item-names A))
(bag-of-items (item-names A B))
(bag-of-items (item-names A B C))

In this example the two first 'bag-of-items' facts would fire my hypothetical 
rule, while the third would not, because there is no 'item' fact with name C.

The 'forall' approach suggested by M. Friedman-Hill is quite close to this, 
however it seems that the rule will fire only if _all_ the 'bag-of-items' facts 
have all of their items represented by facts. I.e., in my example above it 
would not fire until I remove the third bag-of-items fact. Once again, it is 
close but no cigar.

Best,
Aurélien

On Jul 30, 2013, at 10:54 AM, "Jason Morris"  wrote:

> Another "old skool" way of doing it using predicate constraints is...
> 
> (clear)
> (deftemplate item (slot name))
> (deftemplate bag-of-items (multislot item-names))
> 
> (defrule fire-for-all-members-in-bag
>  ; If you have a bag of item names ...
>  (bag-of-items (item-names $?item-names))
>  ; and there is an item whose name is member of this bag ...
>  ?item <-(item (name ?name&:(member$ ?name $?item-names)))
> =>
>  ; ...then do something interesting
>  (printout t ?name " is in the bag!" crlf))
> 
> ;; Program
> (reset)
> (assert (item (name A)))
> (assert (item (name B)))
> (assert (item (name C)))
> (assert (bag-of-items (item-names A B C)))
> (run)
> 
> *Jason C. Morris*
> President, Principal Consultant
> Morris Technical Solutions LLC
> President, Rules Fest Association
> Chairman, IntelliFest 2013: International Conference on Reasoning
> Technologies




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-31 Thread Wolfgang Laun
On 30/07/2013, Aurelien Mazurie  wrote:
> Thank you very much for this answer. It seems like 'forall' will fire the
> rule only if all the 'bag-of-items' facts are validated (i.e., if all of
> them have 'item' facts with the names listed in their 'names' slot). Is that
> correct?

Yes.

>
> If yes, then what I am trying to do is slightly different. I do expect to
> have some of the 'bag-of-items' facts failing the validation. What I want is
> to act upon those who pass (and also, incidentally, on those who do not
> pass).

Ernest's rule fires on the "pass" set.

>
> Is there a way to keep track of which, among all the 'bag-of-items' facts,
> are validated by the 'forall' CE?

The negation of the "forall" is the negated existential quantifier, thus:

(defrule check-bag-NOT-valid
  (bag-of-items (names $?   ?name   $?))
  (not (item (name ?name)))
=>
  (printout t "The bag contains invalid " ?name crlf))

The rule fires for each of the bad items in a bag. Sometimes this is
desired. If not, the bad bag might be retracted or marked as "bad" in
an additional slot.

-W

>
> Best,
> Aurélien
>
> ps: 'dynamic' may be a poor choice of words. I meant that the LHS had to
> dynamically adapt to the content of a fact's multislot, different from one
> fact to another
>
> On Jul 30, 2013, at 8:21 AM, "Friedman-Hill, Ernest [via Jess]"
>  wrote:
>
>> Not sure what "dynamic" means in this context. But you can use the
>> "forall" conditional element to implement this rule. You could read the
>> LHS here as "For all values of ?name in bag-of-items, there's a
>> corresponding item fact."
>>
>> (defrule check-bag-valid
>> (forall
>> (bag-of-items (names $??name   $?))
>> (item (name ?name)))
>> =>
>> (printout t "The bag is valid" crlf))
>>
>> NOTE: Like many complex Jess rules, this one won't fire unless before
>> adding your facts you've executed the "(reset)" command to asset
>> (initial-fact).
>
>
>
>
>
> --
> View this message in context:
> http://jess.2305737.n4.nabble.com/Dynamic-rule-matching-in-the-LHS-tp4654176p4654180.html
> Sent from the Jess mailing list archive at Nabble.com.



To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




RE: JESS: [EXTERNAL] Dynamic rule matching in the LHS

2013-07-31 Thread Friedman-Hill, Ernest
You can slightly augment my "forall" version to fire once for each good set, 
given that bag-of-items has some kind of identifier; I'll assume a slot named 
"id". It doesn't matter what the contents are:

(defrule check-bag-valid
(bag-of-items (id ?id) ))
(forall
(bag-of-items (id ?id) (names $??name   $?))
(item (name ?name)))
=>
(printout t "The bag is valid" crlf))

This rule could be read as "For some bag with some id, every value in the names 
slot has a matching item fact." It will fire once for every bag for which this 
condition holds.

-Original Message-
From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Aurelien Mazurie
Sent: Wednesday, July 31, 2013 1:13 AM
To: jess-users
Subject: Re: JESS: [EXTERNAL] Dynamic rule matching in the LHS

Thank you for this tip. It is not what I am trying to achieve, however. I must 
apologize if my original email was misunderstood.

My goal is to write a rule that would fire for any 'bag-of-items' fact whose 
item names, as listed in a multislot, are all represented by 'item' facts. The 
rule should not fire if one or more of these items are absent from the fact 
list:

(item (name A))
(item (name B))
(bag-of-items (item-names A))
(bag-of-items (item-names A B))
(bag-of-items (item-names A B C))

In this example the two first 'bag-of-items' facts would fire my hypothetical 
rule, while the third would not, because there is no 'item' fact with name C.

The 'forall' approach suggested by M. Friedman-Hill is quite close to this, 
however it seems that the rule will fire only if _all_ the 'bag-of-items' facts 
have all of their items represented by facts. I.e., in my example above it 
would not fire until I remove the third bag-of-items fact. Once again, it is 
close but no cigar.

Best,
Aurélien

On Jul 30, 2013, at 10:54 AM, "Jason Morris"  wrote:

> Another "old skool" way of doing it using predicate constraints is...
> 
> (clear)
> (deftemplate item (slot name))
> (deftemplate bag-of-items (multislot item-names))
> 
> (defrule fire-for-all-members-in-bag
>  ; If you have a bag of item names ...
>  (bag-of-items (item-names $?item-names))  ; and there is an item 
> whose name is member of this bag ...
>  ?item <-(item (name ?name&:(member$ ?name $?item-names))) =>  ; 
> ...then do something interesting  (printout t ?name " is in the bag!" 
> crlf))
> 
> ;; Program
> (reset)
> (assert (item (name A)))
> (assert (item (name B)))
> (assert (item (name C)))
> (assert (bag-of-items (item-names A B C)))
> (run)
> 
> *Jason C. Morris*
> President, Principal Consultant
> Morris Technical Solutions LLC
> President, Rules Fest Association
> Chairman, IntelliFest 2013: International Conference on Reasoning 
> Technologies




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own 
address!) List problems? Notify owner-jess-us...@sandia.gov.




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




RE: JESS: [EXTERNAL] Issue with static methods (or generics?)

2013-08-07 Thread Friedman-Hill, Ernest
Java syntax like "DefaultEdge.class" is (more or less) just syntactic sugar for 
'java.lang.Class.forName("org.jgrapht.graph.DefaultEdge");' which in Jess will 
come out like "(Class.forName org.jgrapht.graph.DefaultEdge)"  (taking 
advantage of the default static imports from the java.lang package.) So you 
want to do something like

(bind ?edge-class (Class.forName org.jgrapht.graph.DefaultEdge))
(bind ?graph (new org.jgrapht.graph.DefaultDirectedGraph ?edge-class))

From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Aurélien Mazurie
Sent: Wednesday, August 07, 2013 7:11 PM
To: jess-users
Subject: JESS: [EXTERNAL] Issue with static methods (or generics?)

Dear Jess users,
I am having trouble instantiating a Java class from within a rule's RHS, and 
cannot figure out how to solve this problem.

The code in my RHS creates an instance of a class from the JGraphT library. As 
seen in  
https://github.com/jgrapht/jgrapht/blob/master/jgrapht-demo/src/main/java/org/jgrapht/demo/HelloJGraphT.java
 (lines 91-92), the creation of a DefaultDirectedGraph instance require another 
class as argument; here, DefaultEdge.

I couldn't find an example in the Jess documentation about how to do that. For 
example, I tried the following:

(bind ?edge-class org.jgrapht.graph.DefaultEdge)
(bind ?graph (new org.jgrapht.graph.DefaultDirectedGraph 
?edge-class))

I also tried variations such as

(bind ?edge-class org.jgrapht.graph.DefaultEdge)
(bind ?graph (new org.jgrapht.graph.DefaultDirectedGraph 
(?edge-class getClass))

or

(bind ?edge-class (new org.jgrapht.graph.DefaultEdge))
(bind ?graph (new org.jgrapht.graph.DefaultDirectedGraph 
?edge-class))

Any idea about what the syntax should be to properly instantiate the 
DefaultDirectedGraph class? For information (but not certain how relevant it is 
here), I succeeded in the past in using java.util.regex.Pattern and its static 
method 'compile' by typing

(bind ?pattern-class java.util.regex.Pattern)
(bind ?matches ((?pattern-class compile "...") matcher ?string))

Best,
Aurélien


JESS: [EXTERNAL] Re: Limit on number of rules tried?

2013-12-20 Thread northparkjamie
My apologies for the lousy formatting of my original message. Please see
properly formatted version below.


northparkjamie wrote
> Hi, can you please help me?
> 
> I'm relatively new to Jess (and using it with 
> CTAT   
> , so my question may need to be redirected to them).
> 
> I am trying to build a sudoku tutor (just to improve my skills) and I'm
> having a problem with my very first rule (below). This rule fires if one
> cell is empty and another in the same row is not. On the RHS, the predict
> function (from CTAT) checks whether the number entered by the user into
> the first cell is the same as the number in the second cell. If it is the
> same, the construct-message function displays the given message. If it is
> different, anything that has happened on the RHS is or remains undone. For
> example, if the row is {nil nil 6 nil nil nil 2 3 nil} and the user enters
> 6 in any of the nil cells, the rule should fire and the predict should
> match and the message should be shown. But, if the user enters 8, the rule
> should still fire, but the predict function should fail, so nothing should
> happen.
> 
> If I test this rule on the first row of the 9x9 grid, it behaves as
> expected. But if I test it on any other row, the engine only tries it 20
> times and never finds the cell in which the input was placed.
> 
> Is there something in Jess that is limiting the number of trials or should
> I be talking to the CTAT people? If it is Jess, is there a way I can
> modify this limitation?
> 
> Thanks in advance for your time and wisdom,
> Jamie
> 
> (defrule bug-num-is-in-row 
> ?prob <- (problem 
> (interface-elements $?
> ?grid $?))
> ?grid <- (grid (rows $? ?row $?))
> ?row <- (row (cells $? ?cell $?))
> ?cell <- (cell 
> (name ?name)
> (value nil)
> (row-number ?row-num))
> ?cell2 <- (cell 
> (value ?number&~nil)
> (row-number ?row-num2))
> (test (= ?row-num ?row-num2))
> =>
> (predict ?name UpdateTextField ?number)
> (construct-message 
> "[The row already has a
> "?number".]")
> )





--
View this message in context: 
http://jess.2305737.n4.nabble.com/Limit-on-number-of-rules-tried-tp4654204p4654205.html
Sent from the Jess mailing list archive at Nabble.com.

JESS: [EXTERNAL] Difficulty with the Jess 8.01 eclipse editor

2014-03-14 Thread Craig Cunningham
Hi All,

I am having difficulty with the new version of the eclipse editor.  The editor 
works fine, unless I try to save a .clp file that has warnings or errors in the 
file.  It hangs up and I have to force quit eclipse.

I am running mac os 10.8.5 and 
eclipse version: Kepler Service Release 2

Has anyone else seen this problem?

Thanks,
Craig

RE: JESS: [EXTERNAL] Access public enum inside of a class

2011-12-07 Thread Friedman-Hill, Ernest
Nested enums, like nested classes, actually secretly have a name like 
"UnitType$UnitTypes". I haven't tried this specifically for enums, but I 
suspect this would work:

engine.executeCommand("(import eisbot.proxy.types.UnitType$UnitTypes)");


From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Hunter McMillen
Sent: Wednesday, December 07, 2011 4:27 PM
To: jess-users
Subject: JESS: [EXTERNAL] Access public enum inside of a class

Hi everyone,

I am trying to use an enum from one of my Java classes inside of Jess. I read a 
forum post that said I could use the (import ) feature to import 
enums into Jess, but that only seems to work when the enum is itself in a 
separate file.

I have a class called UnitType, inside of it there is a public enum called 
UnitTypes where all of the UnitTypes in my game are listed. In Java to access 
this I would use UnitType.UnitTypes. to get to the enum

Re: JESS: [EXTERNAL] Access public enum inside of a class

2011-12-08 Thread Hunter McMillen
Thanks very much that worked perfectly.

Hunter McMillen

On Wed, Dec 7, 2011 at 5:10 PM, Friedman-Hill, Ernest wrote:

> Nested enums, like nested classes, actually secretly have a name like
> "UnitType$UnitTypes". I haven't tried this specifically for enums, but I
> suspect this would work:
>
> engine.executeCommand("(import eisbot.proxy.types.UnitType$UnitTypes)");
>
> 
> From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On
> Behalf Of Hunter McMillen
> Sent: Wednesday, December 07, 2011 4:27 PM
> To: jess-users
> Subject: JESS: [EXTERNAL] Access public enum inside of a class
>
> Hi everyone,
>
> I am trying to use an enum from one of my Java classes inside of Jess. I
> read a forum post that said I could use the (import ) feature to
> import enums into Jess, but that only seems to work when the enum is itself
> in a separate file.
>
> I have a class called UnitType, inside of it there is a public enum called
> UnitTypes where all of the UnitTypes in my game are listed. In Java to
> access this I would use UnitType.UnitTypes. to get to the
> enum
>


RE: JESS: [EXTERNAL] Iterate over a Java List in Jess

2011-12-13 Thread Friedman-Hill, Ernest
That "create$" call is creating a list with one element, the ArrayList. 
Iterating over the Jess list returns just the ArrayList - not what you want.

In recent versions of Jess, the "foreach" function actually knows about 
Iterators and the like, so you can iterate over the ArrayList directly:

(foreach ?u (?bwapi getMyUnits) (printout t (?u toString) crlf))


From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Hunter McMillen
Sent: Tuesday, December 13, 2011 8:56 PM
To: jess-users
Subject: JESS: [EXTERNAL] Iterate over a Java List in Jess

Is there anyway to iterate over a Java List object from Jess?

I have a Java object that I store in a Jess variable:

engine.getGlobalContext().setVariable("bwapi", new Value(bwapi));

one of the methods that can be called on bwapi returns a Java ArrayList, and I 
would like to be able to iterate over this list to check certain properties of 
its elements.

Right now I am doing this:

engine.executeCommand("(bind ?units (create$ =(?bwapi getMyUnits)))");
engine.executeCommand("foreach ?u ?units (printout t ?u crlf))");

but when the units are supposed to be printed all I get is:

=


Any ideas?

Thanks,
Hunter M


Re: JESS: [EXTERNAL] Jess asserts fact that is not true

2012-06-27 Thread Wolfgang Laun
On 26/06/2012, Dwight Hare  wrote:
> I am trying to reason about the passage of time in my rules. I would like to
> write the following rule:
>
> (defrule Test
> ?r <- (logical (CurrentTime))
> (logical (Condition (time ?time&:(> (+ ?time 5)
> ?r.t
> =>
> (assert (Condition-met))
> )
>
> Where "CurrentTime" is a fact that holds the current time, and I change the
> slot value "t" as time progresses. The rule fires if the "time" slot in the
> Condition plus 5 is greater than the current time (that is, is true within
> the last 5 time increments). But this syntax is not allowed because you
> cannot access a dotted variable (the "?r.t") here.

Why not simply

(defrule Test
(logical (CurrentTime ?ct))
(logical (Condition (time ?time&:(> (+ ?time 5) ?ct
=>
(assert (Condition-met))
)

which avoids all that global rigmarole?

More below.

>
> My first alternative was to declare a defglobal called "*time*" and have
> that change value as time progresses. But there is no way to make the global
> a "logical" dependency of the asserted condition-met so it doesn't get
> retracted when the global changes in value sufficient to make the rule no
> longer be true.
>
> I came up with a workaround where in addition to the defglobal "*time*" I
> assert a Fact called CurrentTime that holds the same value in the "t" slot.
> Now my rule is:
>
> (defrule Test
> ?r <- (logical (CurrentTime (t ?t&:(= ?t ?*time*
> (logical (Condition (time ?time&:(> (+ ?time 5)  
> ?*time*  ; Note I use the global here instead of the dotted var but the
> value is the same
> =>
> (assert (Condition-met (globtime ?*time*)(facttime
> ?r.t)))
> )

The fallacy is buried in the second pattern which compares the
(unchanged) Condition with the value in the global *time*. You know
that this has changed, but the Jess Engine doesn't. It works in the
first pattern because you change the CurrentTime fact, and so this
pattern is re-evaluated.

Don't use globals in LHS patterns unless they are immutable.

-W

>
> This says that if there is a CurrentTime fact whose slot "t" has the same
> value as the global "*time*" and there is a Condition whose "time" slot plus
> 5 is greater than that time, then assert the Condition-met. My java code
> sets the global to "4", asserts the fact "(CurrentTime (t 4))", and then
> asserts the fact "(Condition (time 0))". Since all the conditions are met
> the rules engine asserts the fact "(MAIN::Condition-met (globtime 4)
> (facttime 4))". All is well though a bit clumsy. Now I want to move time
> forward where the "Condition-met" should no longer be true. I change the
> global to 10 and modify the CurrentTime fact and set the "t" slot to 10
> too.
>
> Then I run the rules engine and it retracts the "(MAIN::Condition-met
> (globtime 4) (facttime 4))" but then mysteriously asserts
> "(MAIN::Condition-met (globtime 10) (facttime 10))". Since the Condition
> time of 0 plus 5 is not greater than 10, it should not have asserted this.
> Here is a dump of the facts in the rules engine at the end:
>
> 0: (MAIN::CurrentTime (t 10))
> 1: (MAIN::Condition (time 0))
> 3: (MAIN::Condition-met (globtime 10) (facttime 10))
>
> I see no justification for the 3rd fact given the only rule I have.
>
> Is there a better way of accomplishing this?
>
> Dwight
>


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




RE: JESS: [EXTERNAL] Jess asserts fact that is not true

2012-06-27 Thread Dwight Hare
Duh. I had early on gotten into the habit of assigning the LHS clause to a 
variable (as I did below in "?r <- ...") and then accessing the slots using 
dotted vars that I had completely forgotten this alternative way of assigning a 
slot value to a var in a rule. It works correctly now without the global and it 
retracts the fact when I change the value representing the current time.

Apologies for wasting everyone's time with this stupid question.

Dwight

-Original Message-
From: owner-jess-us...@sandia.gov [mailto:owner-jess-us...@sandia.gov] On 
Behalf Of Wolfgang Laun
Sent: Tuesday, June 26, 2012 9:59 PM
To: jess-users@sandia.gov
Subject: Re: JESS: [EXTERNAL] Jess asserts fact that is not true

On 26/06/2012, Dwight Hare  wrote:
> I am trying to reason about the passage of time in my rules. I would 
> like to write the following rule:
>
> (defrule Test
> ?r <- (logical (CurrentTime))
> (logical (Condition (time ?time&:(> (+ ?time 5)
> ?r.t
> =>
> (assert (Condition-met))
> )
>
> Where "CurrentTime" is a fact that holds the current time, and I 
> change the slot value "t" as time progresses. The rule fires if the 
> "time" slot in the Condition plus 5 is greater than the current time 
> (that is, is true within the last 5 time increments). But this syntax 
> is not allowed because you cannot access a dotted variable (the "?r.t") here.

Why not simply

(defrule Test
(logical (CurrentTime ?ct))
(logical (Condition (time ?time&:(> (+ ?time 5) ?ct
=>
(assert (Condition-met))
)

which avoids all that global rigmarole?

More below.

>
> My first alternative was to declare a defglobal called "*time*" and 
> have that change value as time progresses. But there is no way to make 
> the global a "logical" dependency of the asserted condition-met so it 
> doesn't get retracted when the global changes in value sufficient to 
> make the rule no longer be true.
>
> I came up with a workaround where in addition to the defglobal 
> "*time*" I assert a Fact called CurrentTime that holds the same value in the 
> "t" slot.
> Now my rule is:
>
> (defrule Test
> ?r <- (logical (CurrentTime (t ?t&:(= ?t ?*time*
> (logical (Condition (time ?time&:(> (+ ?time 5)  
> ?*time*  ; Note I use the global here instead of the dotted var but the 
> value is the same
> =>
> (assert (Condition-met (globtime ?*time*)(facttime
> ?r.t)))
> )

The fallacy is buried in the second pattern which compares the
(unchanged) Condition with the value in the global *time*. You know that this 
has changed, but the Jess Engine doesn't. It works in the first pattern because 
you change the CurrentTime fact, and so this pattern is re-evaluated.

Don't use globals in LHS patterns unless they are immutable.

-W

>
> This says that if there is a CurrentTime fact whose slot "t" has the 
> same value as the global "*time*" and there is a Condition whose 
> "time" slot plus
> 5 is greater than that time, then assert the Condition-met. My java 
> code sets the global to "4", asserts the fact "(CurrentTime (t 4))", 
> and then asserts the fact "(Condition (time 0))". Since all the 
> conditions are met the rules engine asserts the fact 
> "(MAIN::Condition-met (globtime 4) (facttime 4))". All is well though 
> a bit clumsy. Now I want to move time forward where the 
> "Condition-met" should no longer be true. I change the global to 10 
> and modify the CurrentTime fact and set the "t" slot to 10 too.
>
> Then I run the rules engine and it retracts the "(MAIN::Condition-met 
> (globtime 4) (facttime 4))" but then mysteriously asserts 
> "(MAIN::Condition-met (globtime 10) (facttime 10))". Since the 
> Condition time of 0 plus 5 is not greater than 10, it should not have 
> asserted this.
> Here is a dump of the facts in the rules engine at the end:
>
> 0: (MAIN::CurrentTime (t 10))
> 1: (MAIN::Condition (time 0))
> 3: (MAIN::Condition-met (globtime 10) (facttime 10))
>
> I see no justification for the 3rd fact given the only rule I have.
>
> Is there a better way of accomplishing this?
>
> Dwight
>


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list (use your own 
address!) List problems? Notify owner-jess-us...@sandia.gov.






To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] What does the .CLP extension stand for?

2012-11-16 Thread Wolfgang Laun
CLP <= CLIPS <= C Language Integrated Production System :-)
-W

On 15/11/2012, Grant Rettke  wrote:
> What does the .CLP extension stand for?
>
> --
> Grant Rettke | ACM, AMA, COG, IEEE
> gret...@acm.org | http://www.wisdomandwonder.com/
> Wisdom begins in wonder.
> ((λ (x) (x x)) (λ (x) (x x)))
>




To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




Re: JESS: [EXTERNAL] Anyone ran JESS on a realtime NIX?

2013-03-28 Thread Friedman-Hill, Ernest
Jess, like anything Java-based, can do "soft real time" at best, due to 
nondeterministic garbage collection.  I've done control algorithms for 
simulated hardware, but never anything on real machinery.

From: Grant Rettke mailto:gret...@acm.org>>
Reply-To: jess-users 
mailto:jess-us...@mailgate.sandia.gov>>
Date: Thursday, March 28, 2013 3:39 PM
To: jess-users 
mailto:jess-us...@mailgate.sandia.gov>>
Subject: JESS: [EXTERNAL] Anyone ran JESS on a realtime NIX?

Hi,

I'm curious about setting up a balancing robot just for the fun of it.

I'm wondering if any of you have any knowledge of people using JESS on a 
realtime UNIXes, or for that matter, doing anything hardware control wise?

Best wishes,

Grant


JESS: [EXTERNAL] How to configure Eclipse JessDE to recognize Userfunctions?

2013-04-02 Thread Samson Tu

Hi,

I am writing Jess rules for use in Protege's JessTab. I would like to 
use the Eclipse JessDE, but it doesn't recognize any of the JessTab 
functions, which were implemented as Jess user functions (accessible in 
jesstab.jar). What do I need to do to make JessDE recognize JessTab 
functions?


Thanks.

With best regards,
Samson

--
Samson Tu   email: s...@stanford.edu
Senior Research Scientist   web: www.stanford.edu/~swt/
Center for Biomedical Informatics Research  phone: 1-650-725-3391
Stanford University fax: 1-650-725-7944


To unsubscribe, send the words 'unsubscribe jess-users y...@address.com'
in the BODY of a message to majord...@sandia.gov, NOT to the list
(use your own address!) List problems? Notify owner-jess-us...@sandia.gov.




JESS: [EXTERNAL] nested foreach to return from the inner loop

2013-05-23 Thread Przemyslaw Woznowski
Hi Jess users,

I have the following function:

(deffunction similarity-score (?base ?other)
(bind ?score 0)
(bind ?totalDistance 0)
(bind ?counter 0)
(foreach ?x ?base
(bind ?counter (+ ?counter 1))
(printout t "counter is:" ?counter)
(bind ?partialDistance 0)
(printout t "partialDist is:" ?partialDistance)
(foreach ?y ?other
(bind ?partialDistance (+ ?partialDistance 1))
(printout t "foreach partialDist is:" ?partialDistance)
(if (eq ?x ?y) then
(bind ?score (+ ?score 1))
(printout t "score is:" ?score)
(return)
)
)
(bind ?totalDistance (/ ?counter ?partialDistance))
)
(return (- (/ ?score (length$ ?base)) (* (- 1 (/ (length$ ?base)
?totalDistance)) 0.1) ))
)

As you can see, the above function has a nested foreach loop, which upon
finding equal values in both list should skip to the next iteration of the
outer loop. In java, instead of (return) one would normally put a break
statement. As far as the documentation of the (foreach) construct reads, it
says: "The return function can be used to break the iteration". However,
what I am finding is that the (return) function terminates the outer loop
too - unless I seriously messed up the code - but this is the result of my
observation of the (printout t) function. Moreover, when I remove the
(return) function, the function iterates over the outer and inner loops
just fine.

Any advice on how can I break the inner's loop iteration? I know I can use
a variable to flag that the match has been found and add it to the if
statement, but I am hoping that there is an equivalent of break in Jess.


Cheers,
Pete


  1   2   >