JESS: shadow facts and backward chaining
Hi, Does backward chaining works with shadow facts ? (generally) Is there some known limitations ? If anyone has some examples to share, I would appreciate it. Thanks. _
JESS: Jess and JessDE vs Shadow facts
Hi, I'm currently looking to add Scala objects in Jess.It's working with Jess when I do a run. (Scala add the getter methods in the .class file)However, it's not working in JessDE even if a BeanInfo class file is also generated (in the same directory) by Scala (trough annotations). I can join some sample files if needed, but I remember seeing a different behavior with shadow facts like this before using Scala. Thanks. _
JESS: jessDE performance
Hi, It seems to me that jessDE performances are not as good as they were (I'm using the latest version). Is it something under work ?Can I do something to reduce the lag when I'm writing rules ? (I suspect it comes from the high number of templates I have). Thanks. _
RE: JESS: using annotations
Yeah, I knew about BeanInfo classes, but after using them for a while, I'm not too satisfied (usability). Of course I could write some code that produce a Deftemplate, but what I'm interested in is a solution that include JessDE working accordingly. That's why I was thinking about replacing the default Bean introspection mechanism, but I'm not even sure it would work for JessDE. Thanks again. From: [EMAIL PROTECTED] To: jess-users@sandia.gov Subject: Re: JESS: using annotations Date: Wed, 16 Jul 2008 10:04:27 -0400 Jess 7.1 still supports JDK 1.4, so annotations aren't available. Future Jess versions will support Java 5+ . I like the fact that Jess supports the JavaBeans spec; it's nice to be able to refer people to that for details. It's one less invention that needs to be maintained by us. It's not true, of course, that you're restricted to following naming conventions, as JavaBeans includes the BeanInfo concept for describing variances from the conventions. In any case, the jess.Deftemplate class has a complete public API; you should be able write a Userfunction in Java which turned classes into Deftemplates following annotations using whatever scheme you like. If you do this, and describe it in our Wiki, then other people could use it too! On Jul 15, 2008, at 11:54 PM, Skeptic 2000 wrote:Hi, Have you considered using annotations instead of naming scheme to create deftemplates associated to shadow facts ? Do you think it would be difficult thing to hack ? Thanks. - Ernest Friedman-Hill Informatics Decision Sciences, Sandia National Laboratories PO Box 969, MS 9012, Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _
RE: JESS: introspection of shadow facts from 7.0 to 7.1
Hi, Another problem encountered during the 7.0-7.1 migration. I used to add empty user function defs in the .clp file and add those functions programmatically. Now Jess seems to ignore the re-definition and call the empty shell. It's a known issue ? Thanks for help. From: [EMAIL PROTECTED] To: jess-users@sandia.gov Subject: Re: JESS: introspection of shadow facts from 7.0 to 7.1 Date: Mon, 14 Jul 2008 18:04:27 -0400 On Jul 14, 2008, at 10:30 AM, Skeptic 2000 wrote: Hi,I updated from 7.0p1 to 7.1 recently and JessDE doesn't recognize the stuff specified in my BeanInfo classes anymore (it still works at runtime).Is there some official changes in the introspection mechanisms?Jess itself behaves the same way as always in this area, but the JessDE is being a better Eclipse citizen right now; unfortunately this means that some things don't work as well. This should improve in the next few point releases. There are some things the new JessDE does much better than the old; for example, working with projects located outside the workspace works now. - Ernest Friedman-Hill Informatics Decision Sciences, Sandia National Laboratories PO Box 969, MS 9012, Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _
RE: JESS: introspection of shadow facts from 7.0 to 7.1
I just noticed that much of them are still working.The ones that are giving me errors are the one used in a defquery. I'll try to build a simple example. Thanks. From: [EMAIL PROTECTED] To: jess-users@sandia.gov Subject: Re: JESS: introspection of shadow facts from 7.0 to 7.1 Date: Tue, 15 Jul 2008 11:24:45 -0400 Hmmm. You can certainly still redefine functions. Can you show me an example of what's going wrong? On Jul 15, 2008, at 10:32 AM, Skeptic 2000 wrote:Hi, Another problem encountered during the 7.0-7.1 migration. I used to add empty user function defs in the .clp file and add those functions programmatically. Now Jess seems to ignore the re-definition and call the empty shell. It's a known issue ? Thanks for help. From: [EMAIL PROTECTED] To: jess-users@sandia.gov Subject: Re: JESS: introspection of shadow facts from 7.0 to 7.1 Date: Mon, 14 Jul 2008 18:04:27 -0400 On Jul 14, 2008, at 10:30 AM, Skeptic 2000 wrote: Hi, I updated from 7.0p1 to 7.1 recently and JessDE doesn't recognize the stuff specified in my BeanInfo classes anymore (it still works at runtime). Is there some official changes in the introspection mechanisms? Jess itself behaves the same way as always in this area, but the JessDE is being a better Eclipse citizen right now; unfortunately this means that some things don't work as well. This should improve in the next few point releases. There are some things the new JessDE does much better than the old; for example, working with projects located outside the workspace works now. - Ernest Friedman-Hill Informatics Decision Sciences, Sandia National Laboratories PO Box 969, MS 9012, Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED] ' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] . - Ernest Friedman-Hill Informatics Decision Sciences, Sandia National Laboratories PO Box 969, MS 9012, Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _
JESS: using annotations
Hi, Have you considered using annotations instead of naming scheme to create deftemplates associated to shadow facts ? Do you think it would be difficult thing to hack ?Thanks. _
JESS: introspection of shadow facts from 7.0 to 7.1
Hi, I updated from 7.0p1 to 7.1 recently and JessDE doesn't recognize the stuff specified in my BeanInfo classes anymore (it still works at runtime). Is there some official changes in the introspection mechanisms? Thanks for help. _
JESS: observing partial activation of rules
Hi, I'm curious how this : http://ctat.pact.cs.cmu.edu/docs/ctat_2_1/cog_tutor_jess_tools.html#why_not can be achieved.It is something that require a modification of Jess ? I don't see how to find that information using the public API. Thanks for help. _ Envoie un sourire, fais rire, amuse-toi! Employez-le maintenant! http://www.emoticonesgratuites.ca/?icid=EMFRCA120
JESS: batch require
Hi,I'm having a problem when I batch two different .clp files that require the same third .clp file. File1.clp Some defclasses File2.clp require file1Some rules using file1 defclasses File3.clp require file 1 Some other rules using file1 defclasses rete.batch(file2); rete.batch(file3); = Problems when creating templates from defclass. If it doesn't ring a bell, I'll give more details.Thanks. _
JESS: shadow fact + multislot
Hi, Would it be possible to have a shadow fact with a multislot ? (I know a shadow fact can have an array-based property, but that wouldn't work with multislot pattern matching, what I'm looking for)Thanks _ Envoie un sourire, fais rire, amuse-toi! Employez-le maintenant! http://www.emoticonesgratuites.ca/?icid=EMFRCA120
JESS: adding shadow facts in Jess
Hi, I'm trying to figure why the ruel2 doesn't fire : (defclass SFA ca.usherbrooke.astus.prototype.pedagogue.SFA) (deftemplate x (slot y) ) (defrule rule1 (x) = (printout t rule1 fired) (add new SFA) ) (defrule rule2 (SFA) = (printout t rule2 fired) ) (reset) (assert (x (y 1))) (run) Here is the SFA class, but it's probably irrelevant. public class SFA { private int a; private int b; public SFA() { a = 3; b = 4; } public int getA() { return a; } public int getB() { return b; } } _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
RE: JESS: adding shadow facts in Jess
Oops, I simply forgot the ( ) around the new and the Jess editor didn't see an error there. JFL From: [EMAIL PROTECTED]: [EMAIL PROTECTED]: JESS: adding shadow facts in JessDate: Thu, 9 Aug 2007 15:30:58 -0400 Hi, I'm trying to figure why the ruel2 doesn't fire : (defclass SFA ca.usherbrooke.astus.prototype.pedagogue.SFA) (deftemplate x (slot y) ) (defrule rule1 (x) = (printout t rule1 fired) (add new SFA) ) (defrule rule2 (SFA) = (printout t rule2 fired) ) (reset) (assert (x (y 1))) (run) Here is the SFA class, but it's probably irrelevant. public class SFA { private int a; private int b; public SFA() { a = 3; b = 4; } public int getA() { return a; } public int getB() { return b; } } Soyez parmi les premiers à essayer Windows Live Mail. _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
RE: JESS: dealing with shadow facts having null properties
Hi and thanks a lot for helping, the details are here : That's the ShadowFact : public class Test { private Integer a = null; private Integer b = 4; public Test() { } public int getA() { return a; } public int getB() { return b; } } That's the .CLP file : (defclass Test xxx.yyy.zzz.Test) (defrule testrule (Test (a ?a) (b ?b)) = (printout t testrule ok) ) That's the java code : void functionX() { ... jessEngine.add(new Test()); ... } That's the exception : Jess reported an error in routine DefinstanceList.updateMultipleSlots. Message: Called method threw an exception. at jess.DefinstanceList.getSlotValueFromObject(DefinstanceList.java:371) at jess.DefinstanceList.setAllSlotValuesFromObject(DefinstanceList.java:353) at jess.DefinstanceList.createNewShadowFact(DefinstanceList.java:332) at jess.DefinstanceList.definstance(DefinstanceList.java:111) at jess.Rete.definstance(Rete.java:1903) at jess.Rete.definstance(Rete.java:1883) at jess.Rete.add(Rete.java:2023) ... JFL From: [EMAIL PROTECTED] Subject: Re: JESS: dealing with shadow facts having null properties Date: Fri, 3 Aug 2007 10:48:15 -0400 To: jess-users@sandia.gov I can't reproduce anything like this; can you show me a stack trace (run jess.Main with -stacktrace to see a full error trace). On Aug 2, 2007, at 6:12 PM, Skeptic 2000 wrote:When I add a shadow fact with a property having a null value, I get an exception (in updateMultiSlot IRRC). JFLFrom: [EMAIL PROTECTED] Subject: Re: JESS: dealing with shadow facts having null properties Date: Thu, 2 Aug 2007 15:57:55 -0400 To: jess-users@sandia.gov Jess has been able to handle null properties for a long time; 6.1p8 can handle them, as can the current versions. What problem are you having, exactly? On Aug 2, 2007, at 2:19 PM, Skeptic 2000 wrote: Hi, I need to add in the working memory some shadow facts withproperties whose values are null. Currently, my workaround is touse a NullObject to prevent Jess from crashing upon finding a null value. Is it the recommended way to do it ? JFL Soyez parmi les premiers à essayer Windows Live Mail. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify owner-jess- [EMAIL PROTECTED] Soyez parmi les premiers à essayer Windows Live Mail. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
RE: JESS: dealing with shadow facts having null properties
Well, I'm really sorry...JFL From: [EMAIL PROTECTED] Subject: Re: JESS: dealing with shadow facts having null properties Date: Fri, 3 Aug 2007 15:23:03 -0400 To: jess-users@sandia.gov Look closely at your stack trace: it says Message: Called method threw an exception. If you called getCause() on the JessException, it would return a NullPointerException, and if you looked at that NPE's stack trace, you'd see it was thrown by the getA() method of your Test class. Here are the relevant lines from your code: private Integer a = null; ... public int getA() { return a; } Note that the type of variable a is Integer, but getA() is returning an int. That means that, due to auto-unboxing, the Java compiler is going to emit code as if you had written something like public int getA() { return a.intValue(); } and since a is null, this line throws a NullPointerException. It's not Jess's fault if your getter methods throw NPEs when called! On Aug 3, 2007, at 2:51 PM, Skeptic 2000 wrote:Hi and thanks a lot for helping, the details are here : That's the ShadowFact : public class Test { private Integer a = null; private Integer b = 4; public Test() { } public int getA() { return a; } public int getB() { return b; }} That's the .CLP file : (defclass Test xxx.yyy.zzz.Test)(defrule testrule (Test (a ?a) (b ?b)) = (printout t testrule ok) ) That's the java code : void functionX() { ... jessEngine.add(new Test()); ... } That's the exception : Jess reported an error in routine DefinstanceList.updateMultipleSlots. Message: Called method threw an exception. at jess.DefinstanceList.getSlotValueFromObject(DefinstanceList.java: 371) at jess.DefinstanceList.setAllSlotValuesFromObject (DefinstanceList.java:353) at jess.DefinstanceList.createNewShadowFact(DefinstanceList.java:332) at jess.DefinstanceList.definstance(DefinstanceList.java:111) at jess.Rete.definstance(Rete.java:1903) at jess.Rete.definstance(Rete.java:1883) at jess.Rete.add(Rete.java:2023) ...JFLFrom: [EMAIL PROTECTED] Subject: Re: JESS: dealing with shadow facts having null properties Date: Fri, 3 Aug 2007 10:48:15 -0400 To: jess-users@sandia.gov I can't reproduce anything like this; can you show me a stack trace (run jess.Main with -stacktrace to see a full error trace). On Aug 2, 2007, at 6:12 PM, Skeptic 2000 wrote: When I add a shadow fact with a property having a null value, I getan exception (in updateMultiSlot IRRC). JFLFrom: [EMAIL PROTECTED] Subject: Re: JESS: dealing with shadow facts having null properties Date: Thu, 2 Aug 2007 15:57:55 -0400 To: jess-users@sandia.gov Jess has been able to handle null properties for a long time; 6.1p8 can handle them, as can the current versions. What problem are you having, exactly? On Aug 2, 2007, at 2:19 PM, Skeptic 2000 wrote: Hi, I need to add in the working memory some shadow facts with properties whose values are null. Currently, my workaround is to use a NullObject to prevent Jess from crashing upon finding a null value. Is it the recommended way to do it ? JFL Soyez parmi les premiers à essayer Windows Live Mail. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users[EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify owner-jess-[EMAIL PROTECTED] Soyez parmi les premiers à essayer Windows Live Mail. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify owner-jess- [EMAIL PROTECTED] Soyez parmi les premiers à essayer Windows Live Mail. - Ernest Friedman
JESS: dealing with shadow facts having null properties
Hi, I need to add in the working memory some shadow facts with properties whose values are null. Currently, my workaround is to use a NullObject to prevent Jess from crashing upon finding a null value.Is it the recommended way to do it ?JFL _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
RE: JESS: dealing with shadow facts having null properties
When I add a shadow fact with a property having a null value, I get an exception (in updateMultiSlot IRRC). JFL From: [EMAIL PROTECTED] Subject: Re: JESS: dealing with shadow facts having null properties Date: Thu, 2 Aug 2007 15:57:55 -0400 To: jess-users@sandia.gov Jess has been able to handle null properties for a long time; 6.1p8 can handle them, as can the current versions. What problem are you having, exactly? On Aug 2, 2007, at 2:19 PM, Skeptic 2000 wrote:Hi, I need to add in the working memory some shadow facts with properties whose values are null. Currently, my workaround is to use a NullObject to prevent Jess from crashing upon finding a null value. Is it the recommended way to do it ? JFL Soyez parmi les premiers à essayer Windows Live Mail. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: Java 1.5 enums
Hi, As shown on JessWiki, I use the import functions to get my enum class in Jess :(import xx.yy.zz.MyEnum) then I try to match a slot of a shadow fact to one of the enum field : (defrule rule1(MyShadowFact (OBJECT ?o) (property1 MyEnum.xyz)) = ...) What I'm doing wrong ?Thanks. JFL _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
RE: JESS: exchanging values between ess and Java via UserFunction
Hi, doesn't know the exact type... so I use the javaObjectValue method to Value has a type() method which tells you what kind of Value you've got. javaObjectValue() won't create an object -- it will only return an exusting object, if there is one (for resolved values, only for types RU.STRING, RU.SYMBOL, RU.JAVA_OBJECT.) Then I can switch on the type returned to do the Jess-Java transfer correctly. Second Problem : A second UserFunction return a integer value by doing : int x = ... ; return new Value(x); My first reaction was that the Value constructor that takes only an int isn't public -- have you modified the source? You should be using the two-argument one that lets you specify a type. But now, on re-reading, I see what's probably happening: *autoboxing* in Java 5 and up. You're passing only an int to the Value constructor, and there *is* no constructor that takes only an int. There is one that takes only an Object, though, so Java is helpfully converting your int to an Integer, and then Jess is creating a Value of type JAVA_OBJECT. Grrr. Although Java 5 blurred the distinction between int and Integer, Jess still treats them as distinct types. You should be using return new Value(x, RU.INTEGER); and then everything should work fine. Oops, I should have said that I had already figured that Java 5 features were probably linked to the problem. Any plan to fix the disparities between int and Integer in Jess ? (Probably not for backward compatibilty?) Again, thanks for all those quick and complete answers, many commercial products(!) doesn't have such a good customer service. _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: exchanging values between ess and Java via UserFunction
Hi, I'm having some trouble with value exchange between Jess and Java via UserFunctions that are implemented in Java.First problem : A first UserFunction receives 1 argument from Jess and doesn't know the exact type, so I use the javaObjectValue method to extract in a Object variable. Problem occurs when the value sent from Jess is a simple integer, for example the result of (+ 3 5). Second Problem : A second UserFunction return a integer value by doing : int x = ... ; return new Value(x); But my rule that compares this result with a simple integer doesn't work : (test (eq 0 calltotheuserfunction)) My current solutions are : 1) (new Integer (+ 3 5)) 2) (test (eq 0 (calltotheuserfunction intValue))) But I don't like to add this Java syntax in my rules, is there a better way to fix those problems ?Thanks again ! _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: How to correctly fire the same rule for the same facts
Hi, this simple example show a problem I still have when designing Jess rules.What I should do to avoid this situation in which two instances of Y will be created. If what I try to do is not clear, please say so. Thanks. CLP file : (deftemplate X (slot a)) (deftemplate Y (slot s)) (defrule sum-X?x1 - (X (a ?a1))?x2 - (X (a ?a2))(not (test (eq ?x1 ?x2)))=(assert (Y (s (+ ?a1 ?a2(printout t y asserted ?a1 ?a2 crlf)) (reset) (assert (X (a 3)))(assert (X (a 5))) (run) Result : Jess, the Rule Engine for the Java Platform Copyright (C) 2006 Sandia Corporation Jess Version 7.0p1 12/21/2006 y asserted 5 3 y asserted 3 5 _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: user functions and warning messages in plugin
Hi, If I add my user-functions trough Java instead of directly in the .clp files, how I can get rid of the warning messages in the plug-in ?Thanks for help. JFL _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: mark vs modify
Hi, Does a resetToMark after a mark is done undo the modify applied to the facts or only remove newly added facts ?If yes, how this apply to shadow facts ?Thanks _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
RE: JESS: strange behavior
Hi, I have a rule looking something like : (defrule wcooo ; exemple pour un while (MyShadowfact (OBJECT ?o)) (test ( (str-length (?o methodreturningastring param)) 3)) = (printout t rulefired (str-length (?o methodreturningastring param)) crlf)) And I strangly get the rulefired message with values like 4, 5, 6, ... Remember that pattern-matching is driven by facts being asserted, retracted, or modified. In particular, the test above will be evaluated only when the object is first put into working memory, or when a change event or modify call causes it to be reevaluated. My guess is that your method methodreturningastring returns a value which changes over time without Jess being notified in any way about the change. You will need to tell Jess when this value changes -- for example, by using the Rete.updateObject() method If I do an updateObject but : 1) none of the properties of the bean have changed 2) the methodreturningastring now returns a different value Does the pattern matching occurs ? (the answer seems to be no) JF _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: how to get the rule text from a defrule
Hi, With Jesp I can easily get the defrule of each of my rules in my .clp files and display their names in a Swing application. What I would like to do next is to display the actual text of the rule in this same application, can it be easily done ?Thanks. From: [EMAIL PROTECTED] Subject: Re: JESS: is jess a declaritive language? Date: Tue, 30 Jan 2007 22:03:15 -0500 To: jess-users@sandia.gov Well, rules themselves are definitely a declarative programming concept. But Jess also offers an imperative language, and in fact the right-hand-sides of rules consist of imperative code. So in fact, Jess, and systems like it, are hybrid declarative/ imperative. On Jan 30, 2007, at 5:03 PM, Matthew J Hutchinson wrote: Hi everyone, I'm trying to categorize Jess in terms of the different programming language paradigms. Is Jess declaritive? Thanks, Matt - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: strange behavior
Hi, I have a rule looking something like : (defrule wcooo ; exemple pour un while (MyShadowfact (OBJECT ?o)) (test ( (str-length (?o methodreturningastring param)) 3)) = (printout t rulefired (str-length (?o methodreturningastring param)) crlf)) And I strangly get the rulefired message with values like 4, 5, 6, ... Can someone help ?Thanks From: [EMAIL PROTECTED] Subject: Re: JESS: Decorators Date: Thu, 18 Jan 2007 10:43:47 -0500 To: jess-users@sandia.gov Do the decorators actually enlarge the API of the defclassed class? In that case, you'll only be able to match those additional properties using Java method calls. Otherwise, things would work out fine; you could even just defclass the interface, if that's how things are structured. Otherwise, can you give us a concrete example to discuss? On Jan 18, 2007, at 9:17 AM, Krasnigor, Scott L (N-AST) wrote: I am curious what the implications are of defclassing a class with many decorators associated with it? I need to be able to match various attributes of the class that are part of the decorators. Is there a correct/best way to handle this case? Any advice would be appreciated. Thanks. Scott - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: using mathematicals functions on a shadow fact
Hi, in a LHS i'm getting a value from a shadowfact method and I want to compare that value using to a fixed number, something like : (test ( (?x domethod param) 3) I get the error that 3 is not a java object, so I tried to replace 3 with : new Integer 3, but I get the same message. How can I achieve this ?Thanks ! _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
RE: JESS: calling a method on a matched shadow fact
Hi, In the LHS of a rule, could I bind to a variable a object that is returned from a method called on a matched fact ? (rule x (theShadowfact ?o) (... ?o getXYZ ... ) The purpose of doing this is to have a variable on which to do some tests without having to call getXYZ for each one of them. Thanks From: [EMAIL PROTECTED] Subject: Re: JESS: calling a method on a matched shadow fact Date: Fri, 3 Nov 2006 00:46:42 -0500 To: jess-users@sandia.gov On Nov 2, 2006, at 1:29 PM, Skeptic 2000 wrote: Let's say I have something like : (defclass xyz x.y.com.XYZ) (defrule x ?x-(xyz) = (...) In the RHS, I would like to call a method that is not a bean get/ set on the matched 'xyz', what would be the proper way? (If possible, this method would take a string as argument) ?x is a jess.Fact object; it has a slot named OBJECT containing the actual XYZ object. So you could say ((?x getSlotValue OBJECT) theMethodName the argument) Alternatively, you could bind the OBJECT slot on the LHS, and then you'd have a variable on which you could call the method directly. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 PO Box 969, MS 9012 [EMAIL PROTECTED] Livermore, CA 94550 http://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: run vs rununtilhalt
Hi, I have some java code that create ShadowFact and some rules that modify them at creation and when they are modified on the Java side. I'm trying to compare two way of doing this : First, doing a engine.runUntilHalt() and doing my java code that handle the shadowfact after. Second, after each manipulation on the Java side, doing a engine.run(). On performance side, what is the difference between the two ? You can probably guess that I want to do this because I need to be sure that Jess has runned out before doing some extra Java code. I don't want to go in details here of why I need this behavior, but I'm pretty sure that it don't go agains't the Jess spirit. Thanks _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: A problem with accumulate
Hi,I have a serious problem with accumulate, I wanted to use it on some shadow facts, but I noticed that I can't have more than one contained CE.I would need to use a Time-varying method (OBJECT) and a test-CE in the matching part of the Accumulate... Something like (modifed from the manual): ?c - (accumulate (bind ?list (new java.util.ArrayList)) (?list add ?o) ?list (employee (OBJECT ?o))(test (?o xyzMethod arg1)) ; - that can't work if I understand correctly :( = (printout t (?c toString) crlf)) This causes me some serious trouble, so I'll hope there is a way to deal with it. Thanks again ! _ Soyez parmi les premiers à essayer Windows Live Mail. http://ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
JESS: Removing a shadow fact
Let's say I have somthing like this in Java: ShadowFactClass x1 = new ShadowFactClass(); ShadowFactClass x2 = new ShadowFactClass(); ShadowFactClass x3 = new ShadowFactClass(); rete.add(x1); rete.add(x2); rete.add(x3) . Somewhere else in the code I woule like to remove from the working memory of one those three shadow facts, what would be the proper way ? (in this place, I have access both to the rete engine and the x1,x2,x3 variables) Thanks again _ Ne perdez pas de temps dans les files dÂattente magasinez en ligne. http://magasiner.sympatico.msn.ca 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: First try with backward-chaining
Hi, I tried for the first time to use backward-chaining and I can't figure out why this simple example don't work : (deftemplate x (declare (backchain-reactive TRUE)) (slot a) (slot b) ) (defrule printX (x (b 12)) = (printout t yeah!) ) (defrule createX (need-x (b ?y)) = (assert (x (a 3) (b ?y))) ) (run) Thanks ! _ Ne perdez pas de temps dans les files dÂattente magasinez en ligne. http://magasiner.sympatico.msn.ca 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: calling a method on a matched shadow fact
Hi, Let's say I have something like : (defclass xyz x.y.com.XYZ) (defrule x ?x-(xyz) = (...) In the RHS, I would like to call a method that is not a bean get/set on the matched 'xyz', what would be the proper way? (If possible, this method would take a string as argument) Thanks, JFL From: Ernest Friedman-Hill [EMAIL PROTECTED] Reply-To: jess-users@sandia.gov To: jess-users@sandia.gov Subject: Re: JESS: Symplified syntax jess 7 Date: Thu, 2 Nov 2006 13:03:08 -0500 Only simple expressions as described in the manual are handled in this release. Parenthesized expressions are not implemented -- yet. On Nov 2, 2006, at 5:36 AM, Negoita, Cristian wrote: The simplified rule should look like below: (defrule Rule-KDF-BDF-Promo-1 (Input {bestandFirma 5 ((promotionalCode == 'M' || promotionalCode == 'X') kontoFirma == 5)} ) =... But his expression cannot be parsed by Jess. - 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://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Voyez vos amis en faisant un appel vidèo dans Windows Live Messenger http://imagine-msn.com/messenger/launch80/default.aspx?locale=fr-ca 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: adding (not creating) rules from Java
Hi, I want to have a Java program that can add rules to a Rete object at runtime. The rules would be entered as a String and once added, I would need a way to refer to them on the Java side. What would be the proper way to do it ? Thanks, JFL _ Achetez ce que vous voulez, quand vous voulez sur Sympatico / MSN Magasiner http://magasiner.sympatico.msn.ca/content/shp/?ctId=101,ptnrid=176,ptnrdata=081805 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: Test on a list from a JavaBean
Hi, In my rules, I need to tests some shadows fact which have as one of their properties a List. For example, let's say it's a List of String and I my test is to check that the string xyz is part of the list. What would be the most proper way to do this ? Thanks, JFL _ Essayez la nouvelle génération de recherche avec Live Search. http://www.live.com/?mkt=fr-ca 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: Test on a list from a JavaBean
Thanks, I missed the contains, it's not in the Jess functions list, where it comes from ? JFL From: Ernest Friedman-Hill [EMAIL PROTECTED] Reply-To: jess-users@sandia.gov To: jess-users@sandia.gov Subject: Re: JESS: Test on a list from a JavaBean Date: Tue, 24 Oct 2006 15:13:30 -0400 Something like this? (defrule theRule (theFact (theProperty ?theList:(?theList contains xyz))) = ... On Oct 24, 2006, at 2:15 PM, Skeptic 2000 wrote: Hi, In my rules, I need to tests some shadows fact which have as one of their properties a List. For example, let's say it's a List of String and I my test is to check that the string xyz is part of the list. What would be the most proper way to do this ? - 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://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Découvrez Live Search de votre PC ou de votre appareil mobile dès aujourdÃÂhui. http://www.live.com/?mkt=fr-ca 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: Test on a list from a JavaBean
Oops, I was about to reply saying forget it, it's from the Java's API. In fact, now that I understand that I can call any java method from the matching facts, all my problems should be solved. Thanks again, JFL From: Ernest Friedman-Hill [EMAIL PROTECTED] Reply-To: jess-users@sandia.gov To: jess-users@sandia.gov Subject: Re: JESS: Test on a list from a JavaBean Date: Tue, 24 Oct 2006 22:09:34 -0400 On Oct 24, 2006, at 8:14 PM, Skeptic 2000 wrote: Thanks, I missed the contains, it's not in the Jess functions list, where it comes from ? It's a method in the java.util.Collections interface, yes? We're calling it on ?theList, which is a java.util.List. From: Ernest Friedman-Hill [EMAIL PROTECTED] Something like this? (defrule theRule (theFact (theProperty ?theList:(?theList contains xyz))) = ... On Oct 24, 2006, at 2:15 PM, Skeptic 2000 wrote: Hi, In my rules, I need to tests some shadows fact which have as one of their properties a List. For example, let's say it's a List of String and I my test is to check that the string xyz is part of the list. What would be the most proper way to do this ? - 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://www.jessrules.com To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]' in the BODY of a message to [EMAIL PROTECTED], NOT to the list (use your own address!) List problems? Notify [EMAIL PROTECTED] _ Voyez vos amis en faisant un appel vidèo dans Windows Live Messenger http://imagine-msn.com/messenger/launch80/default.aspx?locale=fr-ca 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: Detecting rules inconsistencies
Hi, I'm currently using Jess as a kind of classifier, and I'm asking myself if some mechanisms exist to detect inconsequent or impossible rules. A simple example would be a rule testing a slot value being 10 and 10. Thanks. JF 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: asserting a fact from another
Yeah, that's better than slot-values, but I was hoping for something specific to extended template, thanks anyway :) Two others questions, 1) Since there is no multiple inheritance (extends can be done only on one fact), what would be the best way to create this : A has two slots, X, Y B has one slot Z C would have X, Y, Z. (Of course, the simple answer is to create C with those 3 slot). 2) One of the first thing I tried to do was to put a fact-id in a slot. (To act as a kind of pointer from a fact to another one without using an integer ID like in a relational database). However, I never saw a exemple in the documention doing it, or nothing saying that's good or that's bad. So, I would like to know if there is some problems with it ? Thanks again. Jean-François From: friedman_hill ernest j [EMAIL PROTECTED] Reply-To: jess-users@sandia.gov To: jess-users@sandia.gov Subject: Re: JESS: asserting a fact from another Date: Sat, 26 Aug 2006 18:08:15 -0700 (PDT) You can just bind the values to variables on the rule's LHS, right? (defrule example (A (x ?x) (y ?y)) = (assert (B (x ?x) (y ?y) (z someValue If A and B weren't different templates, you could use the underappreciated duplicate function, but you can't. I think Skeptic 2000 wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, Let's say I have a deftemplate A with two slot : x, and y. I have another deftemplate B whom extends A, adding slot z. Then I have a rule that checks for any A-fact with special values for x and or y. If the rule fire, I want to create a B fact with the same values as in the A fact (and a value for z of course). I know that I can use fact-slot-value to get the A-fact values, but is there a cleaner way ? Thanks. Jean-Francois 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] - 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] 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: asserting a fact from another
Hi, Let's say I have a deftemplate A with two slot : x, and y. I have another deftemplate B whom extends A, adding slot z. Then I have a rule that checks for any A-fact with special values for x and or y. If the rule fire, I want to create a B fact with the same values as in the A fact (and a value for z of course). I know that I can use fact-slot-value to get the A-fact values, but is there a cleaner way ? Thanks. Jean-Francois 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: Using Jess in madkit
Hi, With the lack of support from the Madkit group, I hope there is someone here who already tried to use a Jess Agent in Madkit. I have a very small technical problem, when I create my JessAgent with Java code, Madkit try to load a .clp file but with a wrong path : Error opening file null\plugins/jesslib/scripts/madkitlib.clp That null should be the Madkit directory in fact, but no where in their doc they talk about seting up a path for using a JessAgent. If someone can help, thanks a lot. JF 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]