JESS: Compare predicate function problem
I have the following rule: (defrule try_string_compare (subject (caseStatus ?caseStatus:(= (?caseStatus Suspect)) (OBJECT ?p)) = (printout t Object (subject) has a suspect case status: (?p getCaseStatus) crlf) ) giving me the following error (I do not understand why it is talking about a multislot - I have no $ variable in the rule I am merely trying to do a compare to a string on the LHS): Jess reported an error in routine Jesp.parsePattern while executing (batch kb_jess/phs3_signal/post_signal_change_in_function.clp). Message: caseStatus is not a multislot . Program text: ( defrule try_string_compare ( subject ( caseStatus ?caseStatus : ( = ( ?caseStatus Suspect ) ) ( at line 164. 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: Compare predicate function problem
I think Michael Knapik wrote: (subject (caseStatus ?caseStatus:(= (?caseStatus Suspect)) (OBJECT ?p)) = ... There are a whole bunch of things going on here. First, the error being reported that caseStatus is not a multislot. This is happening because the parenthesis that should be closing the caseStatus slot is missing; therefore the parenthesis after (OBJECT ?p) (the one that is intended to be the end of the subject fact) is seen as being the end of caseStatus, and therefore there are two separate test items inside the slot description (the second one is the (OBJECT ?p)). Since this is a single slot and not a multislot, Jess complains, rightly. Matching parentheses by eye is hard -- but matching brackets in Java is hard, too. Good tools can help a lot. I've always used Emacs to edit Jess code, which works great. The Charlemagne IDE will be even better at this. Anyway, there are three other things wrong in this little line of code. One is an extra set of parentheses around the arguments to =. A proper call to = would look like (= ?caseStatus Suspect). Second, the = function is for comparing numerics only, and you'll get a runtime error if you use it to compare Strings like this. You can use eq to compare arbitrary items -- (eq ?caseStatus Suspect). Finally (and it seems like I've been saying this on the list every day, lately:) when you can match directly, without using a function call, do so -- it's more efficient, less typing, and easier to understand. So I'd write this whole pattern, corrected, as (subject (caseStatus Suspect) (OBJECT ?p)) or if you really wanted the variable ?caseStatus bound to the constant Suspect you could write (subject (caseStatus ?caseStatusSuspect) (OBJECT ?p)) - Ernest Friedman-Hill Science and Engineering PSEsPhone: (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: Compare predicate function problem
Ernest: If you have even a pre-alpha version of the Eclipse plug-in for Jess and would put it out for the group, I would re-name my first-born from James C. Owen, II to Ernest Friedman-Hill-Owen. Maybe :-) SDG jco [EMAIL PROTECTED] wrote: I think Michael Knapik wrote: (subject (caseStatus ?caseStatus:(= (?caseStatus "Suspect")) (OBJECT ?p)) = ... There are a whole bunch of things going on here. First, the error being reported that caseStatus is not a multislot. This is happening because the parenthesis that should be closing the caseStatus slot is missing; therefore the parenthesis after (OBJECT ?p) (the one that is intended to be the end of the "subject" fact) is seen as being the end of caseStatus, and therefore there are two separate test items inside the slot description (the second one is the "(OBJECT ?p)"). Since this is a single slot and not a multislot, Jess complains, rightly. Matching parentheses by eye is hard -- but matching brackets in Java is hard, too. Good tools can help a lot. I've always used Emacs to edit Jess code, which works great. The Charlemagne IDE will be even better at this. Anyway, there are three other things wrong in this little line of code. One is an extra set of parentheses around the arguments to "=". A proper call to "=" would look like (= ?caseStatus "Suspect"). Second, the "=" function is for comparing numerics only, and you'll get a runtime error if you use it to compare Strings like this. You can use "eq" to compare arbitrary items -- (eq ?caseStatus "Suspect"). Finally (and it seems like I've been saying this on the list every day, lately:) when you can match directly, without using a function call, do so -- it's more efficient, less typing, and easier to understand. So I'd write this whole pattern, corrected, as (subject (caseStatus "Suspect") (OBJECT ?p)) or if you really wanted the variable ?caseStatus bound to the constant "Suspect" you could write (subject (caseStatus ?caseStatus"Suspect") (OBJECT ?p)) - Ernest Friedman-Hill Science and Engineering PSEsPhone: (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: Charlemagne Release Info
I am new to Jess and am wondering where is the definitive list of features coming in the next release (Charlemagne) of Jess including info on the IDE? I have searched through the past posting and found this reference. Is this it? http://www.mail-archive.com/[EMAIL PROTECTED]/msg06534.html I also found a posting referring to a web page that should probably be put up with the features but I can't seem to find if that was ever done. Thanks so much. 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: Charlemagne Release Info
I think [EMAIL PROTECTED] wrote: I am new to Jess and am wondering where is the definitive list of features coming in the next release (Charlemagne) of Jess including info on the IDE? There is still, actually, no such list. The list of all possible features can be inferred from the survey at http://herzberg.ca.sandia.gov/jess/jess.survey . It's looking more and more like almost everything in that list is going to be in the release. I have searched through the past posting and found this reference. Is this it? http://www.mail-archive.com/[EMAIL PROTECTED]/msg06534.html That's just a list of what was in the first preview release; there's going to be a lot more in complete package; most of all the IDE with an editor, debugger, and some rule management tools. I also found a posting referring to a web page that should probably be put up with the features but I can't seem to find if that was ever done. No, I never did. Thanks so much. - Ernest Friedman-Hill Science and Engineering PSEsPhone: (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]