[no subject]
1 for jess-users@sandia.gov; Mon, 11 Feb 2008 04:27:48 -0700 Received: from [132.175.109.14] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.1)); Mon, 11 Feb 2008 04:27:38 -0700 X-Server-Uuid: AA8306FD-23D1-4E5B-B133-B2D9F10C3631 X-WSS-ID: 0JW2NU3-07-3FL-01 X-TMWD-Spam-Summary: TS=3D2008022739; ID=3D1; SEV=3D2.3.2; DFV=3DB2008021107; IFV=3D2.0.4,4.0-9; AIF=3DB2008021107; RPD=3D5.03.0010; ENG=3DNA; RPDID=3D7374723D303030312E30413031303230362E34374230333132412E303041422C73= 733D312C6667733D30; CAT=3DNONE; CON=3DNONE; SIG=3DwYgcHgAABA=3D=3D X-TMWD-IP-Reputation: SIP=3D193.136.28.30; IPRID=3D303030312E30413039303330312E34374230333132382E30303630; CTCLS=3DT1= ; CAT=3DUnknown Received: from smtp1.fe.up.pt (smtp.fe.up.pt [193.136.28.30]) by sentry-two.sandia.gov (Tumbleweed MailGate 3.5.1) with ESMTP id 280E68EAABA for jess-users@sandia.gov; Mon, 11 Feb 2008 04:27:38 -0700 (MST) Received: from localhost (localhost [127.0.0.1]) by smtp1.fe.up.pt ( Postfix) with ESMTP id DF590EF98A for jess-users@sandia.gov; Mon, 11 Feb 2008 11:26:55 + (WET) Received: from smtp1.fe.up.pt ([127.0.0.1]) by localhost (smtp1.fe.up.pt [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3dwzksKdYwbH for jess-users@sandia.gov; Mon, 11 Feb 2008 11:26:55 + (WET) Received: from [127.0.0.1] (unknown [192.168.56.20]) by smtp1.fe.up.pt ( Postfix) with ESMTP id C7B48EF989 for jess-users@sandia.gov; Mon, 11 Feb 2008 11:26:55 + (WET) Message-ID: [EMAIL PROTECTED] Date: Mon, 11 Feb 2008 11:27:29 + From: Henrique Lopes Cardoso [EMAIL PROTECTED] User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: jess-users@sandia.gov Subject: Setting defaults X-WSS-ID: 6BAEEEA047S602199-01-01 Content-Type: text/plain; charset=3Diso-8859-1; format=3Dflowed Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.0.320885, Antispam-Engine: 2.5.2.313940, Antispam-Data: = 2008.2.11.31534 X-PerlMx-Spam: Gauge=3DIII, Probability=3D7%, Report=3D'BODY_SIZE_300_3= 99 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0= , __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' Hi, I was wondering if there is a way of setting a default value for a slot to be equal to another slot. Something like: (deftemplate foo (slot bar) (slot qwe (default-dynamic this.bar (assert (foo (bar 1))) Slot qwe would get the value of slot bar, that is, 1. Thanks. Henrique 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]
[no subject]
3 for jess-users@sandia.gov; Sun, 10 Feb 2008 22:02:08 -0700 Received: from [132.175.109.14] by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.1)); Sun, 10 Feb 2008 22:02:00 -0700 X-Server-Uuid: AA8306FD-23D1-4E5B-B133-B2D9F10C3631 X-WSS-ID: 0JW25ZI-07-UJR-01 X-TMWD-Spam-Summary: TS=3D20080211050206; ID=3D1; SEV=3D2.3.2; DFV=3DB2008021103; IFV=3D2.0.4,4.0-9; AIF=3DB2008021103; RPD=3D5.03.0010; ENG=3DNA; RPDID=3D7374723D303030312E30413031303230362E34374146443643382E303031432C73= 733D312C6667733D30; CAT=3DNONE; CON=3DNONE; SIG=3D2IvsngAABA=3D=3D X-TMWD-IP-Reputation: SIP=3D216.139.236.158; IPRID=3D303030312E30413039303330342E34374146443643372E30303038; CTCLS=3DT1= ; CAT=3DUnknown Received: from kuber.nabble.com (kuber.nabble.com [216.139.236.158]) ( using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by sentry-two.sandia.gov (Tumbleweed MailGate 3.5.1) with ESMTP id 2D2432AD645 for jess-users@sandia.gov; Sun, 10 Feb 2008 22:02:05 -0700 (MST) Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from [EMAIL PROTECTED]) id 1JOQnm-tC-GH for jess-users@sandia.gov; Sun, 10 Feb 2008 21:01:58 -0800 Message-ID: [EMAIL PROTECTED] Date: Sun, 10 Feb 2008 21:01:58 -0800 (PST) From: JimYates [EMAIL PROTECTED] To: jess-users@sandia.gov Subject: Re: JESS: Announcing Jess 7.1b1 In-Reply-To: [EMAIL PROTECTED] MIME-Version: 1.0 X-Nabble-From: [EMAIL PROTECTED] References: [EMAIL PROTECTED] X-WSS-ID: 6BB1094247S595653-01-01 Content-Type: text/plain; charset=3Dus-ascii Content-Transfer-Encoding: 7bit X-PMX-Version: 5.4.0.320885, Antispam-Engine: 2.5.2.313940, Antispam-Data: = 2008.2.10.204848 X-PerlMx-Spam: Gauge=3DIII, Probability=3D7%, Report=3D'BODY_SIZE_400_4= 99 0, __CP_URI_IN_BODY 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0= , __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0' Any ball park ideas on when 7.1 will be production? 3 Months, 6 Months? Ernest Friedman-Hill wrote: We're pleased to announce the availability of release 7.1b1 of Jess, the programmer's rule engine, from the usual location: -- View this message in context: http://www.nabble.com/JESS%3A-Announcing-Jess= -7.1b1-tp13796328p15405648.html Sent from the Jess mailing list archive at Nabble.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]
[no subject]
--_=_NextPart_001_01C7E342.3B902E80 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Received: from sentry.sandia.gov (mm04snlnto.sandia.gov = [132.175.109.21]) by mailgate2.sandia.gov (8.14.0/8.14.0) with ESMTP id l7KFr05e031859 for jess-users@sandia.gov; Mon, 20 Aug 2007 09:53:15 -0600 Received: from [132.175.109.14] (sentry-two.sandia.gov) by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.1)); Mon, 20 Aug 2007 09:53:06 -0600 X-Server-Uuid: 6CEB1540-FE13-491B-9872-FD67060ED864 X-WSS-ID: 0JN2XHY-08-6AA-01 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by sentry-two.sandia.gov (Tumbleweed MailGate) with ESMTP id 065E16105BC for jess-users@sandia.gov; Mon, 20 Aug 2007 09:53:57 -0600 (MDT) Received: by nz-out-0506.google.com with SMTP id m22so436238nzf for jess-users@sandia.gov; Mon, 20 Aug 2007 08:53:04 -0700 (PDT) DKIM-Signature: a=3Drsa-sha1; c=3Drelaxed/relaxed; d=3Dgooglemail.com; = s=3Dbeta; = h=3Ddomainkey-signature:received:received:message-id:date:from:to:subject= :in-reply-to:mime-version:content-type:references; = b=3DE8vMWdkw92sogq2GLE5Ed2tROjVwqMBTmHUSKRxgBGSdNULrUDNh35YHrq0Osw2leP/v5= iLdAINQObE3iN3/qrSIE81So/9zs+kNqJjzNSAL5ojVT6NsZ5PL+Ia3pk9teTgQLXGL7WF9ow= WKJU3DZ96Pz0rspXNsYQfSYuifcZM=3D DomainKey-Signature: a=3Drsa-sha1; c=3Dnofws; d=3Dgooglemail.com; = s=3Dbeta; = h=3Dreceived:message-id:date:from:to:subject:in-reply-to:mime-version:con= tent-type:references; = b=3DU0qWiGh7IRMdsOKadJRsyEFydOOm/SJUZ0IhWGXZtdq4EE9sKUgwJimAPeBymkJ1MDuJi= bOWlglM+hglDcpJy8SaME32jiTd9pGm6m9ttsQmgMprPIguI3nkCwvy3JPSNYt1lIwDPuHmhk= /Pdb6cJyDfpI5Eo2qrbWkUr93u+jM=3D Received: by 10.115.76.1 with SMTP id d1mr2758881wal.1187625183345; Mon, 20 Aug 2007 08:53:03 -0700 (PDT) Received: by 10.65.54.5 with HTTP; Mon, 20 Aug 2007 08:53:03 -0700 (PDT) Message-ID: = [EMAIL PROTECTED] Date: Mon, 20 Aug 2007 17:53:03 +0200 From: =3D?ISO-8859-1?Q?No=3DEBl_Huebers?=3D = [EMAIL PROTECTED] To: jess-users@sandia.gov Subject: Re: JESS: Java objects In-Reply-To: [EMAIL PROTECTED] MIME-Version: 1.0 References: = [EMAIL PROTECTED] [EMAIL PROTECTED] X-TMWD-Spam-Summary: TS=3D20070820155307; SEV=3D2.2.2; = DFV=3DB2007082012; IFV=3D2.0.4,4.0-9; AIF=3DB2007082012; RPD=3D5.02.0125; ENG=3DIBF; = RPDID=3D7374723D303030312E30413031303230372E34364339423845332E303033322C7= 3733D312C6667733D30; CAT=3DNONE; CON=3DNONE X-MMS-Spam-Filter-ID: B2007082012_5.02.0125_4.0-9 X-WSS-ID: 6AD767551V84411817-05-01 Content-Type: multipart/alternative; boundary=3D=3D_Part_50291_18026087.1187625183166 X-PMX-Version: 5.3.3.310218, Antispam-Engine: 2.5.2.311128, = Antispam-Data: 2007.8.20.82822 X-PerlMx-Spam: Gauge=3DIII, Probability=3D7%, Report=3D'HTML_NO_HTTP = 0.1, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, = __CTYPE_MULTIPART_ALT 0, __HAS_MSGID 0, __MIME_HTML 0, __MIME_VERSION 0, = __SANE_MSGID 0' --=3D_Part_50291_18026087.1187625183166 Content-Type: text/plain; charset=3Diso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks for your answers! I wanted to use the counter template and rule = to count facts of the same kind, e.g. an event in my system. First of all, I added a slot with a unique value in order to facts of = the same kind. I solved the counting with a query and a function: (defquery searchcontext (declare (variables ?name ?task ?val)) (context (username ?name) (action Bewertet) (task ?task) (value ?val))) (deffunction checkformerattempts(?n ?t ?v) (bind ?results (count-query-results searchcontext ?n ?t ?v)) (return ?results) (close ?results)) Now I want to delete the some facts. How do I get a fact from the queryresult '?result' ? ;(deffunction delformerattempts(?n ?t ?v) ;(bind ?results (run-query* searchcontext ?n ?t ?v)) ;(while (?results next)) ;(retract ?results get)) Best regards, Noel H=3DFCbers 2007/8/20, Wolfgang Laun [EMAIL PROTECTED]: No=3DEBl Huebers wrote: Hi, I'm new to the Jess language and have some questions. 1. I work with Java object. I stored them in Jess with store and assert/fetch commands. But I could not call there member in the lhs of my rule. No function calls allowed, right? So, for every object I made a rule to insert a Jess template. This works fine, but is this way of mapping Java objects to Jess facts and then discarding the object the best way to work with java objects? store and fetch are just a way of storing and retrieving arbitrary = data. If you want to use Java objects in rules, look into the topic of = shadow facts, see section 5.3. Shadow facts: reasoning about Java objects. 2. I am trying to implement a counter-logic for specific slot combinations. First, everytime a fact is inserted I check if there is already a procounter fact. If not I create one. This works fine. The next rule should recognize when a fact
[no subject]
--_=_NextPart_001_01C7E342.3B902E80 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=iso-8859-1 Received: from sentry.sandia.gov (mm04snlnto.sandia.gov = [132.175.109.21]) by mailgate2.sandia.gov (8.14.0/8.14.0) with ESMTP id l7KFr05e031859 for jess-users@sandia.gov; Mon, 20 Aug 2007 09:53:15 -0600 Received: from [132.175.109.14] (sentry-two.sandia.gov) by sentry.sandia.gov with ESMTP (SMTP Relay 01 (Email Firewall v6.3.1)); Mon, 20 Aug 2007 09:53:06 -0600 X-Server-Uuid: 6CEB1540-FE13-491B-9872-FD67060ED864 X-WSS-ID: 0JN2XHY-08-6AA-01 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.229]) by sentry-two.sandia.gov (Tumbleweed MailGate) with ESMTP id 065E16105BC for jess-users@sandia.gov; Mon, 20 Aug 2007 09:53:57 -0600 (MDT) Received: by nz-out-0506.google.com with SMTP id m22so436238nzf for jess-users@sandia.gov; Mon, 20 Aug 2007 08:53:04 -0700 (PDT) DKIM-Signature: a=3Drsa-sha1; c=3Drelaxed/relaxed; d=3Dgooglemail.com; = s=3Dbeta; = h=3Ddomainkey-signature:received:received:message-id:date:from:to:subject= :in-reply-to:mime-version:content-type:references; = b=3DE8vMWdkw92sogq2GLE5Ed2tROjVwqMBTmHUSKRxgBGSdNULrUDNh35YHrq0Osw2leP/v5= iLdAINQObE3iN3/qrSIE81So/9zs+kNqJjzNSAL5ojVT6NsZ5PL+Ia3pk9teTgQLXGL7WF9ow= WKJU3DZ96Pz0rspXNsYQfSYuifcZM=3D DomainKey-Signature: a=3Drsa-sha1; c=3Dnofws; d=3Dgooglemail.com; = s=3Dbeta; = h=3Dreceived:message-id:date:from:to:subject:in-reply-to:mime-version:con= tent-type:references; = b=3DU0qWiGh7IRMdsOKadJRsyEFydOOm/SJUZ0IhWGXZtdq4EE9sKUgwJimAPeBymkJ1MDuJi= bOWlglM+hglDcpJy8SaME32jiTd9pGm6m9ttsQmgMprPIguI3nkCwvy3JPSNYt1lIwDPuHmhk= /Pdb6cJyDfpI5Eo2qrbWkUr93u+jM=3D Received: by 10.115.76.1 with SMTP id d1mr2758881wal.1187625183345; Mon, 20 Aug 2007 08:53:03 -0700 (PDT) Received: by 10.65.54.5 with HTTP; Mon, 20 Aug 2007 08:53:03 -0700 (PDT) Message-ID: = [EMAIL PROTECTED] Date: Mon, 20 Aug 2007 17:53:03 +0200 From: =3D?ISO-8859-1?Q?No=3DEBl_Huebers?=3D = [EMAIL PROTECTED] To: jess-users@sandia.gov Subject: Re: JESS: Java objects In-Reply-To: [EMAIL PROTECTED] MIME-Version: 1.0 References: = [EMAIL PROTECTED] [EMAIL PROTECTED] X-TMWD-Spam-Summary: TS=3D20070820155307; SEV=3D2.2.2; = DFV=3DB2007082012; IFV=3D2.0.4,4.0-9; AIF=3DB2007082012; RPD=3D5.02.0125; ENG=3DIBF; = RPDID=3D7374723D303030312E30413031303230372E34364339423845332E303033322C7= 3733D312C6667733D30; CAT=3DNONE; CON=3DNONE X-MMS-Spam-Filter-ID: B2007082012_5.02.0125_4.0-9 X-WSS-ID: 6AD767551V84411817-05-01 Content-Type: multipart/alternative; boundary=3D=3D_Part_50291_18026087.1187625183166 X-PMX-Version: 5.3.3.310218, Antispam-Engine: 2.5.2.311128, = Antispam-Data: 2007.8.20.82822 X-PerlMx-Spam: Gauge=3DIII, Probability=3D7%, Report=3D'HTML_NO_HTTP = 0.1, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, = __CTYPE_MULTIPART_ALT 0, __HAS_MSGID 0, __MIME_HTML 0, __MIME_VERSION 0, = __SANE_MSGID 0' --=3D_Part_50291_18026087.1187625183166 Content-Type: text/plain; charset=3Diso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Thanks for your answers! I wanted to use the counter template and rule = to count facts of the same kind, e.g. an event in my system. First of all, I added a slot with a unique value in order to facts of = the same kind. I solved the counting with a query and a function: (defquery searchcontext (declare (variables ?name ?task ?val)) (context (username ?name) (action Bewertet) (task ?task) (value ?val))) (deffunction checkformerattempts(?n ?t ?v) (bind ?results (count-query-results searchcontext ?n ?t ?v)) (return ?results) (close ?results)) Now I want to delete the some facts. How do I get a fact from the queryresult '?result' ? ;(deffunction delformerattempts(?n ?t ?v) ;(bind ?results (run-query* searchcontext ?n ?t ?v)) ;(while (?results next)) ;(retract ?results get)) Best regards, Noel H=3DFCbers 2007/8/20, Wolfgang Laun [EMAIL PROTECTED]: No=3DEBl Huebers wrote: Hi, I'm new to the Jess language and have some questions. 1. I work with Java object. I stored them in Jess with store and assert/fetch commands. But I could not call there member in the lhs of my rule. No function calls allowed, right? So, for every object I made a rule to insert a Jess template. This works fine, but is this way of mapping Java objects to Jess facts and then discarding the object the best way to work with java objects? store and fetch are just a way of storing and retrieving arbitrary = data. If you want to use Java objects in rules, look into the topic of = shadow facts, see section 5.3. Shadow facts: reasoning about Java objects. 2. I am trying to implement a counter-logic for specific slot combinations. First, everytime a fact is inserted I check if there is already a procounter fact. If not I create one. This works fine. The next rule should recognize when a fact
Re: JESS: explanation capability
I'm still not seeing the difficulty. When each fact is asserted, modified, or retracted, log the fact and the rule that made the change. Now you have a history of exactly how each fact came to be in the state it's in. Then when a rule fires, log the facts that activated it; now you can trace cause and effect back as far as you'd like. I think qfhe wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Sorry, I used the wrong terminology. I meant facts trigger rules, not rules trigger rules. Let me rephrase my question a little bit. Suppose there are three rules: a) (defrule rule1 ?fact - (Test (a 0)) = (modify ?fact (a 1))) b) (defrule rule2 ?fact - (Test (b 0)) = (modify ?fact (b 1))) c) (defrule rule3 ?fact - (Test (a 1) (b 1)) = (modify ?fact (c 1))) The syntax of the above rules may have some problems, but let's forget about the syntax and just use the example to illustrate the problem. At the beginning we have one fact in which the three fields a, b, and c are equal to 0. The execution order of the above rules will be either a) b) c) or b) a) c). Rule c) will be placed in the agenda only when both field a and b are set to 1. But an eventing mechanism will only capture the last rule that cause rule c) to be activated. In this example, if we start from c) to trace back, we will only capture either b) or a), not both. This is a bit confusing but I hope the example helps me explain the question. p.s. If the above explanation makes it even more confusing, could you comment on Jess's explanation capability in general? thanks. --- [EMAIL PROTECTED] wrote: Rules don't trigger rules; facts do. You can keep track of what rule asserted (or last modified) every fact, and this gives you the set of rules that contributed to activating each other rule. I really couldn't follow the whole rest of your discussion because it was based on some invalid assumptions. When the rule that we're interested in is violated, it is hard to backward-trace its causes at that time. If you keep track of what rule asserted what fact, then at any time, working backwards, you can generate an execution trace for any rule that fires. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.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 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: Using multiple instances of Jess in one JVM
I think Jim Goodwin wrote: Is it possible and practical to have multiple unrelated instances of Jess in the same JVM by simply consing up separate RETE objects? ... If I read Chapter 18 of JIA correctly, this is a legitimate and intended usage Yes, absolutely. You can create as many independent rule engines as you like. - 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: add facts from java objects
I think qfhe wrote: Now my question is how I'm going to use those objects in rule specification. Suppose I added two instance of the same type Customer to the working memory. I want to define a rule to check whether the two customers have the same name. name is a private field in class Customer and I provide setter and getter methods in the class to access this field. Could you please give me some sample code to do this. Thanks very much. You wouldn't say this as if the two customers have different names, but rather if there's a customer with name ?n and a different customer whose name is also ?n. This way the same rule works no matter how many customers there are. One way to write this: (defrule two-customers-same-name ;; Read this as There's a Customer object ?o1 with name ?n (Customer (OBJECT ?o1) (name ?n)) ;; Read this as There's another Customer ?o2 which is not ?o1, ;; and whose name is also ?n (Customer (OBJECT ?o2~?o1) (name ?n)) = ;; Here the variables ?o1 and ?o2 refer to the two Customer ;; objects, and ?n1 is their shared name; you can take ;; whatever action you like. p.s. The following example on the same page of the documentation seems require some other things to work. Is the source for this example available? (defrule 10%-volume-discount Give a 10% discount to everybody who spends more than $100. (Order {total 100}) = (add (new Offer 10% volume discount (/ ?total 10 It would require a class named Order with a bean property total, and class Offer with a constructor that took a String and a number as constructor arguments. The example should be complete in the final release; note that Jess 7 is still in beta. - 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: firing rules
You're not using language very carefully, and as a result I really can't be sure of what you're asking. Rules don't fire each other, nor can activating rules cause other rules to be activated. Both fire and activate have very specific meanings in Jess. Now, your previous example had to do with backward chaining, I think, so perhaps you're talking about backward-chaining activations, which makes what you're saying make a little more sense. But if you could come up with a *short* example that demonstrates your issue, and then tell me what happens when you run it and what you expected to happen instead, that would make it easier to help you. I think ben said salma wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] hello, theoretically, if one rule can be fired by one of three other rules, normally if one rule of these is activated the main rule is activated; i do it with an example, that i sent to you yesterday, but the main rule is activated just by the last one declared not by the other. if i change the order of declaration, the last one declared activate the main rule(everytime the last one declared) thank you - Yahoo! Mail r_invente le mail ! D_couvrez le nouveau Yahoo! Mail et son interface r_volutionnaire. - 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: Printable Jess manuals
Our friend David Scuse has converted the Jess 7 manual into Word and PDF formats and has graciously allowed me to make these documents available on the Jess web site. You can download them from the Documentation page: http://www.jessrules.com/jess/docs/index.shtml - 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: conflict with rules
I'm afraid that I have no idea what you're asking. Note that in Jess, identical facts are combined -- i.e., if you assert (foo) when (foo) already exists, no change is made to working memory. There are not two identical (foo) facts, only one. Perhaps this is related to your question in some way. I think ben said salma wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] hello, thank you for answer, i understand the bakward chaining but i still have a problem with firing rules: i have 3 rules R1, R2, R3, that activate the same rule R4 R1- R4 R2- R4 R3 - R4 but the rule R4 is activated only by R3 (the last one declared) even if i assert the facts that fire R1 or R2 how can i remedy to 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://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: problem with slot-specific TRUE reactivations
If you can't delete the row facts, then either add a processed slot to them so you can modify them to mark them done, then match not done on the left hand side of the rule, and remove the no-loop declaration; or otherwise use an auxilliary, temporary fact to indicate that a given row fact has been processed, and again, match these (or more properly, match the absence of these) on the left hand side of the rule. I think yuping he wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi Ernest: Thank you for your answers. I tried (no-loop TRUE) before and I got f-1 (MAIN::row (y 0) (data b)) as result. The result I want to get is f-1 (MAIN::row (y 0) (data a b)) Do you know how should I change the rule for this to happen without retracting ?word fact. (i.e., other rules might reuse the word facts in the LHS) Thanks. Yuping On 5/22/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: slot-specific means that modifications to slots that are not matched in the conditions of a rule won't cause the rule to be activated. But this rule matches the data slot, and modifies that same slot, so it's an infinite loop -- and it's supposed to be. If you want to break this infinite loop specifically, then that's what the no-loop declaration in defrules is for. Perhaps that's what you were thinking of in the first place. I think yuping he wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] ** *Hi, I have the following piece of code* It just adds two words to the row template Both are slot-specific TRUE, however, myrule gets reactivated after row templates being modified (infinite loop) *(clear) (reset) (watch all) (deftemplate row (declare (slot-specific TRUE)) (slot y) (multislot data)) (deftemplate word (declare (slot-specific TRUE)) (slot y) (slot text)) (assert (row (y 0))) (assert (word (y 0) (text a))) (assert (word (y 0) (text b))) (defrule myrule ?row - (row (y ?y) (data $?data)) ?word - (word (y ?y) (text ?text)) = (bind $?data (insert$ $?data (+ (length$ $?data) 1) ?text)) (printout t $?data crlf) (modify ?row (data $?data)) ) (run)* ** *Thanks. Yuping* - 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] - 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: selective rule firing
I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Great thanks! And yes, these rules are just simple audits so they don't do any asserting. Quick follow up, how does this work with back-chaining. We don't have any at the moment in this set of rules but may soon. Would i be able to do the same thing for a backward reactive rule ? You'd be able to see the goal-satisfying rules (the ones with need-X patterns) activated, if that's what you're asking, yes. On Tue, 23 May 2006 10:21:04 -0700 (PDT), ejfried wrote I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, I have an interesting situation. I've a set of business rules we developed that were currently using 'normally'. Defrules, toss in facts/definstances and run. These rules update some domain objects when they fire. We now have a situation where we need to use a subset of the same rules in a different context. 1) the caller only needs to know if a rule fired, so different RHS behavior 2) the caller needs to be able to specify which rules should be evaluated. So currently the .clp has say rule1 - rule20. In this scenario the caller needs to add some facts, and only have say rule2 and rule7 evaluated against the facts, and the caller only needs to know if their LHS' matched at all, not have the RHS action take place. Any ideas? Since this seems to of course fly in the face of the standard usage pattern, I am having some difficulty. Since you don't want the rules to fire, one thing you can do is just call Rete.listActivations() and iterate over all the Activation objects, looking at each one to find out if the rules of interest are active. If you're using multiple modules, then you'll need to check each module separately. Now, this assumes there are no multi-step operations -- i.e., it's not the case that a rule fires, and asserts a fact, which activates another rule, and you're interested in that second rule. If that's the case, then the premise about the rules not firing is flawed. - 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] - 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: testing backward chaining
None of the rules here match the need-X trigger facts that the backward-chaining mechanism uses. You should study the example at http://www.jessrules.com/jess/docs/61/language.html#chaining . Two additional notes on this code: first, indenting your code helps tremendously in making it readable; this is very hard for us to read. Second, you can write this: (call (new java.lang.String (fetch reponse) ) startsWith m) like this: ((fetch reponse) startsWith m) I think ben said salma wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hello, i'm writing a simple example to show how Jess do the backward chaining.here my example: ;; ;;* DEFFUNCTIONS * ;; (deffunction ask-question (?question $?allowed-values) (printout t ?question ) (bind ?answer (read)) (if (lexemep ?answer) then (bind ?answer (lowcase ?answer)) (store answer ?answer) ) (while (eq FALSE (member$ ?answer ?allowed-values)) do (printout t ?question crlf) (bind ?answer (read)) (if (lexemep ?answer) then (bind ?answer (lowcase ?answer (store reponse ?answer)) (deffunction yes-or-no-p (?question) (bind ?response (ask-question ?question oui non o n)) (bind ?reponse (fetch reponse)) (import java.lang.String ) (new java.lang.String reponse ) (if (call (new java.lang.String (fetch reponse) ) startsWith o) then TRUE else FALSE)) ;;;*** ;;;*DEFINITIONS DES DEFTEMPLATE * ;;;*** (deftemplate assassin (slot noma) (slot nomv) (slot jour)) (deftemplate p-desire-t (slot nomdt) (slot nomdv)) (deftemplate a-interet-t (slot nomit) (slot nomiv)) ;;;** ;;;* REGLES D'INFERENCE * ;;;** (defrule assassinat R1 (declare (salience 30)) (poss_de-arme ?x) (cong_ ?x dimanche) (p-desire-t(nomdt ?x) (nomdv ali)) (suspect ?x) = (assert (assassin(noma ?x)(nomv ali) (jour dimanche))) (printout t ?x a tu_ Ali dimanche crlf) (retract 1)) (do-backward-chaining a-interet-t) (do-backward-chaining p-desire-t) ;(set-strategy breadth) (defrule nom-suspect R2 (declare (salience 10)) = (ask-question Ali a _t_ assassin_ dimanche. Qui suspectez vous pouvoir le tuer (karim/sami/mohamed/jamel)? karim sami mohamed jamel) (if (call (new java.lang.String (fetch reponse) ) startsWith k) then (assert(suspect karim)) (if(yes-or-no-p Est ce que votre suspect poss_de une arme (oui/non)?) then (assert(poss_de-arme karim)) else (retract 1)(printout t votre suspect ne peut pas _tre le tueur crlf crlf))); (if (call (new java.lang.String (fetch reponse) ) startsWith s) then (assert(suspect sami)) (if(yes-or-no-p Est ce que votre suspect poss_de une arme (oui/non)?) then (assert(poss_de-arme sami)) else (retract 1)(printout t votre suspect ne peut pas _tre le tueur crlf crlf))) (if (call (new java.lang.String (fetch reponse) ) startsWith m) then (assert(suspect mohamed)) (if(yes-or-no-p Est ce que votre suspect poss_de une arme (oui/non)?) then (assert(poss_de-arme mohamed)) else (retract 1)(printout t votre suspect ne peut pas _tre le tueur crlf crlf))) (if (call (new java.lang.String (fetch reponse) ) startsWith j) then (assert(suspect jamel)) (if(yes-or-no-p Est ce que votre suspect poss_de une arme (oui/non)?) then (assert(poss_de-arme jamel)) else (retract 1)(printout t votre suspect ne peut pas _tre le tueur crlf crlf (defrule cong_R3 (declare (salience 10)) (poss_de-arme ?x) (suspect ?x) = (if(yes-or-no-p Est ce que votre suspect est en cong_ dimanche le jour du crime (oui/non)?) then (assert(cong_ ?x dimanche)) else (retract 1)(printout t votre suspect ne peut pas _tre le tueur crlf crlf))) (defrule peut-desire-tuer R4 (declare (salience 10)) (desire-vonger ?x ali) (suspect ?x) = (assert(p-desire-t (nomdt ?x) (nomdv ali (defrule peut-desire-tuer R5 (declare (salience 10)) (a-interet-t (nomit ?x) (nomiv ali)) (suspect ?x) = (assert(p-desire-t (nomdt ?x) (nomdv ali (defrule des-vonger R6 (declare (salience 10)) (suspect ?x) = (if(yes-or-no-p Est ce que votre suspect d_sirait se vonger de Ali (oui/non)?) then (assert(desire-vonger ?x ali (defrule a-interet-tuer R7 (declare (salience 10)) (h_rite ?x ali) (suspect ?x) = (assert(a-interet-t (nomit ?x) (nomiv ali (defrule h_rite R8 (declare (salience 10)) (suspect ?x) = (if(yes-or-no-p Est ce que votre suspect h_rite de Ali (oui/non)?) then (assert(h_rite ?x ali (defrule a-interet-tuer R9 (declare (salience 10)) (doit-argent ?x ali) (suspect ?x) = (assert(a-interet-t (nomit ?x) (nomiv ali (defrule doit-argent R10 (declare (salience 10)) (suspect ?x) =
Re: JESS: selective rule firing
I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, I have an interesting situation. I've a set of business rules we developed that were currently using 'normally'. Defrules, toss in facts/definstances and run. These rules update some domain objects when they fire. We now have a situation where we need to use a subset of the same rules in a different context. 1) the caller only needs to know if a rule fired, so different RHS behavior 2) the caller needs to be able to specify which rules should be evaluated. So currently the .clp has say rule1 - rule20. In this scenario the caller needs to add some facts, and only have say rule2 and rule7 evaluated against the facts, and the caller only needs to know if their LHS' matched at all, not have the RHS action take place. Any ideas? Since this seems to of course fly in the face of the standard usage pattern, I am having some difficulty. Since you don't want the rules to fire, one thing you can do is just call Rete.listActivations() and iterate over all the Activation objects, looking at each one to find out if the rules of interest are active. If you're using multiple modules, then you'll need to check each module separately. Now, this assumes there are no multi-step operations -- i.e., it's not the case that a rule fires, and asserts a fact, which activates another rule, and you're interested in that second rule. If that's the case, then the premise about the rules not firing is flawed. - 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: problem with slot-specific TRUE reactivations
slot-specific means that modifications to slots that are not matched in the conditions of a rule won't cause the rule to be activated. But this rule matches the data slot, and modifies that same slot, so it's an infinite loop -- and it's supposed to be. If you want to break this infinite loop specifically, then that's what the no-loop declaration in defrules is for. Perhaps that's what you were thinking of in the first place. I think yuping he wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] ** *Hi, I have the following piece of code* It just adds two words to the row template Both are slot-specific TRUE, however, myrule gets reactivated after row templates being modified (infinite loop) *(clear) (reset) (watch all) (deftemplate row (declare (slot-specific TRUE)) (slot y) (multislot data)) (deftemplate word (declare (slot-specific TRUE)) (slot y) (slot text)) (assert (row (y 0))) (assert (word (y 0) (text a))) (assert (word (y 0) (text b))) (defrule myrule ?row - (row (y ?y) (data $?data)) ?word - (word (y ?y) (text ?text)) = (bind $?data (insert$ $?data (+ (length$ $?data) 1) ?text)) (printout t $?data crlf) (modify ?row (data $?data)) ) (run)* ** *Thanks. Yuping* - 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: Dealing with 1x10^5 Fact assertions/destructions per minute
You could indeed pool Fact objects; once a jess.Fact object is retracted, you can re-populate its slots and assert it again. I would be surprised to find that this improved performance for you, though. If there's any kind of clustering in the JMS data, then it could make sense to use backward chaining to pull database info in only as needed; the clustering would mean that over time the most frequently used data from the database would already be in working memory. I think Mike L. VanGeertruy wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] We're putting together a prototype in which the following set of actions will occur up to 100,000 times a minute in a load-balanced JESS rules engine: recieve a JMS message with data, assert the JMS data as facts Query a large database for specific facts relevant to the JMS data assert the database derived fact, run the rule engine write some into the database persist some facts in the rule engine temporarily destroy facts The design we've come up with relies on multiple rules engines to performing processing in parallel, with specific rules engines optimized for specific JMS data sets. The issues are many: 1) Is there a better way to handle such large amounts of Fact assertions/desctructions? 2) Is it possible for the Facts to live in the database to save the time it takes to construct them? 3) Is it possible to create a pool of blank Facts that have been constructed, but not initialized, fill them with primitive data-types from the database, assert them, after the rules engine runs, remove all the data and return them to the constructed pool? 4) Any ideas would be welcome. 5) RTFM'd, was a great book. v/r, Mike Van - 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: warning message
I think m u wrote: But I've got the following warning message for all RHS of the rules at the (assert (productx-ok))) creating implied deftemplate at token 'productx-ok' What is the wrong with my code? Nothing is really wrong, which is why this is a warning rather than an error. In Jess versions before Jess 7, there was no way to declare ordered templates (the kind without slots). Asserting a fact would just create the appropriate template. In Jess 7, you can still do that, but you can also declare ordered templates explicitly. Jess warns you when you don't declare them, as in this situation, because it's good software engineering practice to declare them explicitly. The declaration would just look like (deftemplate productx-ok (declare (ordered TRUE))) Finally, note that many, if not most, of the warnings and errors issued by the JessDE editor have Quick Fixes associated with them. Press Control-1 when point is within the squiggly line, and you'll get a list of fixes to choose from. For this warning, you'll see Declare as ordered template as one of the choices. If you pick it, JessDE will insert the above declaration in an appropriate place in your file, automatically. - 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: Processing data streams with Jess
I think Mike Stacey wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I would like to run rules on the data from a data stream. Each data point is assessed by my rules and a context dependent category (temporal abstraction) is created depending on the data point's value and time stamp. Each point has a time stamp and a value. I'd like to know the best way to do this. Do I read the stream using Java (in a loop) and call the rete engine to run its rules for each successive point? Or do I read say 100 values into an array, then call rete. Or do I do it straight from Jess, without Java? Any suggestions would be greatly appreciated. You can do the first thing, or you can use two threads: one that calls Rete.runUntilHalt(), which fires all active rules, then sleeps until new activations are available, and a second thread that asserts the input data points as facts as they become available. Using two threads would be slightly more complicated, but somewhat more efficient. - 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: JESS book
I think Daniela CLARO wrote: Hi Ernest, Do you think that the book JESS in action could help me about creating planning algorithms using JESS? Is there a section covering this subject? JIA would likely help you in *implementing* your planning algorithms, but you'd first need to learn about planning as a topic by itself. I'm afraid I'm not in a position to recommend any current books on that subject, but perhaps someone else on the list is. Once you've chosen a specific algorithm to implement, the next step would be to specify precisely what the form of the input and output will be, especially whether your program should *carry out* the plan, or simply report it in some way (that way being one of the things you'd need to plan out.) Only once you've decided these things can you then start to implement something. - 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: Anyone in Florence, Italy?
Hi Folks, I will be in Florence, Italy, from June 10th through 16th. It's more or less vacation for me; my wife will be at a conference and I am coming along. I'd be available during the week to meet with people or perhaps give an informal seminar if there's any interest. Drop me a line if you're in Firenze and would like to chat. - 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: bsave reorders agenda
I think Jonathan Sewall wrote: My purpose would be far better served if there were simply a String or a numeric member field of Activation and appropriate accessors by which I could label the instance uniquely and identify it again later, after deserialization. If I could effectively subclass Activation, I'd add this myself. In the absence of multifields, you could uniquely identify an Activation as a tuple containing the list of fact ids and the name of the rule. But as multifields can be matched multiple ways, this isn't necessarily unique. As far as the reordering goes: I agree that this isn't optimal. I'll look at the code and see if there isn't a better way of doing things that doesn't have this side-effect. - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia National LabsFAX: (925) 294-2234 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: Re: executeCommand and line numbers.
I think Florian Fischer wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hello, a quick question: It seems that rete.executeCommand(String), when reporting errors, returns an error line number corresponding to the total number of lines it has interpreted in this call and before. Is there a way to reset the line counter so that it reports a line number within the string? No, but if you need that level of control, you can create your own parser object and use that directly. All that executeCommand() does is feed Strings to an instance of jess.Jesp. It uses jess.awt.TextReader so that it can avoid the overhead of creating a new instance of Jesp and StringReader with every command, but that would really not be huge. So all you'd need to do is write your own executeCommand() that looks like Rete engine = ... String theCommand = ... Jesp jesp = new Jesp(engine, new StringReader(theCommand)); jesp.parse(false, engine.getGlobalContext()); - 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: Using logical 'or' pipes (|) with global variables
I think Greenblatt, Howard wrote: I found that using a logical 'or' pipe (|) with global variables will give a NullPointerException in the JessDE editor. Thanks for the report. The bug is now fixed for 7.0RC1. - 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: Deploying a .clp file in a jar
I think Steve Solomon wrote: Hi, I'm deploying a Jess source file in a jar file. The Rete.batch method takes a String filename argument. However, in this case I don't have access to the file system. I am reading the data from within the jar using the ClassLoader.getResourceAsStream function, which returns an InputStream. Do you have a suggestion how I can read the program rules contained in the .clp resource using an InputStream as input? It actually already does that. From the Jess 7.0b7 manual, section 16.23: ... In any program, if the file is not found [by the batch function], the name is then passed to ClassLoader.getSystemResourceAsStream(). This allows files along the class path, including files in JARs, to be batched. You could also, if this doesn't work because you're doing something especally tricky with ClassLoaders, just use the jess.Jesp parser class directly; batch is just a fairly thin wrapper around this class's parse() method. - 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: Using logical 'or' pipes (|) with global variables
I think yuping he wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, I have several questions. Indeed, you do! 1. the number of parenthesis of command exit doesn't matter (exit) ((exit)) (((exit))), etc... all works. This happens because ((function)) is interpreted as (call (function)). The call function then evaluates its first argument, expecting a Java object to be returned. When it doesn't get a Java object, there will be an error -- except, of course, if the nested function is exit, so that the JVM has stopped before the error happens. But try ((reset)), for example, to see the error message. I suppose you're right that it would make sense for this to be fixed so that the side-effects don't occur. 2. (ppdeffunctin) is not working Spelled correctly, it works as it always has for me -- ppdeffunction. If there's a particular case whee it's broken, please let me know. 3. (deftemplate factorial (declare (ordered TRUE) (backchain-reactive TRUE))) (backchain-reactive is not working) You are right. Thanks. Jess is not awaring of this change. I have to exit jess and re-enter jess to make it work. Jess itself doesn't use a custom classloader of any kind. The JessDE environment will, in fact, track changes in classes as you work, but the Jess library itself, just like any other Java program, doesn't magically pick up changes to class files at runtime. I realize that jess engine just echoes the second then so no exception is thrown. but still seems strange to me. The same sort of thing can be done in other dialects of Lisp as well. - 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: Backwards chaining facility
I think Emmanuel Shyllon wrote: Hi, I shall like to have a very simple example (backchain.clp) of the new backwards chaining facility. Backwards chaining isn't actually new; it's been in since Jess 5.0. There's a simple example in the Rules chapter of the Jess manual; in Jess 7, it's documented here: http://www.jessrules.com/jess/docs/70/rules.html#chaining Emmanuel. ___ Emmanuel A. Shyllon Research Fellow, Department of Spatial Sciences, Curtin University of Technology, GPO Box U1987 Perth WA 6845, Australia Ph: +61 8 9266 3194 Fx: +61 8 9266 2703 Mobile: +61 (0) 401320777 Email: [EMAIL PROTECTED] Web: www.spatial.curtin.edu.au 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]
Re: JESS: bsave reorders agenda
The order is determined entirely by the conflict resolution strategy in use. I recall that you were writing custom strategies. If your strategy returns 0 for a comparison between two Activations, then the relative order of their firing is indeterminate, so indeed, they might be affected by various things that happen in Jess. The best answer to your question is that you should not write systems that depend on a particular indeterminate order; subtle factors may change the observed order. Conversely, a Strategy shouldn't return 0 for two Activations unless the firing order really doesn't matter. I think Jonathan Sewall wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I'd previously noticed, and coded for, the fact that inactive Activations were excised from the agenda by Rete.bsave(). Yesterday, however, a colleague showed me a case in v7.0b6 where the remaining entries on the agenda were also reordered after calling bsave(). That is, I was surprised to get different sequences of active Activations returned by the 2 Iterators below: Iterator it1 = rete.listActivations(); rete.bsave(byteArrayOutputStream); Iterator it2 = rete.listActivations(); It appears that the push() calls in HeapPriorityQueue.writeObject(ObjectOutputStream) can reorder the reconstituted agenda. Could you provide a public method that performs the algorithm in HeapPriorityQueue.writeObject(ObjectOutputStream) yet skips the actual object serialization call? In other words, could I get a look at what the agenda will look like after bsave() without the performance cost of object serialization (of the entire Rete)? Thanks very much, Jonathan Sewall 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]
Re: JESS: Rules in one text file
Hi, What part of this do you need help with? Everything necessary is documented in the manual. I think m u wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi.. I would like to embed JESS in my java program (i mean not to program in .clp script file). But i would like to store all the rules in one text file. The flow of the program is as below: 1. get user name, address, phone no. by using JTextField in my java program 2. JESS or my java program will open the rule text file. one example of the rules would be like this: (defrule John-data (name John) (address john'sAddress) (phone john'sPhone) - (assert (user John))) 3. JESS will use the input data and do the matching with the rules to get the user's total payment. 4. My java program will use the user variable asserted by JESS and produce the result in GUI to the user. 5. And possibly user could add a new rule (for a new user) into the rule text file. Is this possible to do? It is highy appreciated if somebody could give a guide for my idea or any better suggestions. regards, irejai - 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: Rules in one text file
I think m u wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I have problem in using one file for all the rules and to have the user to be able to write a new rule. I'll try to check the manual again. maybe i missed that part. When you read in a file of Jess code, later changes to that file don't automatically change anything in the rule engine; you'd have to read the file in again. So basically this is just an ordinary text file containing Jess code, and you can simply let the user edit it, or you can append to it or make any other changes, and then read it back into Jess. My point is that this part of the problem isn't Jess-specific at all -- it's just managing an editable text file. thanks On 5/15/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, What part of this do you need help with? Everything necessary is documented in the manual. I think m u wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi.. I would like to embed JESS in my java program (i mean not to program in .clp script file). But i would like to store all the rules in one text file. The flow of the program is as below: 1. get user name, address, phone no. by using JTextField in my java program 2. JESS or my java program will open the rule text file. one example of the rules would be like this: (defrule John-data (name John) (address john'sAddress) (phone john'sPhone) - (assert (user John))) 3. JESS will use the input data and do the matching with the rules to get the user's total payment. 4. My java program will use the user variable asserted by JESS and produce the result in GUI to the user. 5. And possibly user could add a new rule (for a new user) into the rule text file. Is this possible to do? It is highy appreciated if somebody could give a guide for my idea or any better suggestions. regards, irejai - 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] - 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: Is this the current manual?
I think Matt Friedman wrote: I could really use a printable manual. I guess this question has come up a number of times, but my searches of the archives revealed only this link: http://herzberg.ca.sandia.gov/jess/docs/manual.pdf Looks like a pretty old version. Are there pdfs of the manual somewhere? We've experimented with various tools for creating PDF versions of the manual, and they've all been 90% solutions, requiring significant hand work to produce a result that's any better than just printing the HTML. It's mostly the code examples that cause problems; just the classic problems with margins, page breaks, etc. Perhaps it would be worth doing that work when Jess 7's manual is finalized. - 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: Resolving symbols and variables in functions
In dynamic-chain-search-2, you're not giving the rule a chance to fire before reading the defglobal... I think Matthew J Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] G'day everyone, I am frustratingly close to getting some Jess code completed that has already taken me waayyy too long. Originally in the code snippet below, I was using hard-coded global variables and things worked well. But then I switched to using the gensym* so that the functions would be safe from a concurrency perspective. I noticed that each time the RHS is activated (I know the rules activate too) the appropriate methods are not called. It seems that maybe the variables are no longer existing? However, the I made the rule refer to a global variable. --- CODE (deffunction dynamic-chain-search-1 (?p1 ?p2 ?p3 ?p4 ?p5 ?p6 ?p7) (bind ?g (sym-cat ?*(gensym*)*) ) (bind ?v (str-cat (defglobal ?g = (new ArrayCombine (build ?v) (bind ?d1 (str-cat (defrule (gensym*) (?p1 (?p2 \?p3\) (?p4 ?q)) = (call ?g addArray (dynamic-chain-search-2 ?p5 ?p6 ?q ?p7)) ))) (printout t ?d1 crlf) (build ?d1) (run) (return (call (eval ?g) getCombinedArray) ) ) (deffunction dynamic-chain-search-2 (?p1 ?p2 ?p3 ?p4) (bind ?gs (sym-cat ?*(gensym*)*) ) (bind ?v1 (str-cat (defglobal ?gs = (new ArrayList 0 (build ?v1) (printout t using dyanmic-chain-search-2 crlf) (bind ?s1 (str-cat (defrule (gensym*) (?p1 (?p2 \?p3\) (?p4 ?qwerty)) = (call ?gs add ?qwerty) ))) ;(bind ?s1 (str-cat (defrule (gensym*) (?p1 (?p2 \?p3\) (?p4 ?qwerty)) = (printout t \fired!\ ?qwerty crlf) ))) (build ?s1) (return (eval ?gs)) ) -- (The ArrayCombine class is my own creation, but I know it works. ) NOTICE though, that the rule that is built is: (defrule gen2 (post_codes (post_code 6014) (locality ?q)) = (call ?*gen1* addArray (dynamic-chain-search-2 street_name_alias locality ?q actual_name)) ) And we can plainly see it refers to a global variable - which makes me wonder why it's not working... Thanks so much! Matt -- Matthew Hutchinson Ph.D. Candidate Department of Spatial Sciences Curtin University of Technology GPO Box U1987 Perth, Western Australia 6845 Visiting Scholar Department of Geography and Planning University of Akron Akron, Ohio USA - 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: Accumulate problem
I can't reproduce the problem with a simple program, so it's more complex than just what we can see here. There have been a few patches to accumulate over the last few releases, but none of them dealing with anything like this. What this looks like to me is working memory corruption due to out-of-band data changes -- for example, setting slots value in a Fact directly rather than using modify, or using instances of a class with a mutable hashCode as slot data without using set-nonvalue-class. In the next release, by the way, the value class default is going to be reversed, so that the slow, safe mode is the default, and the fast but breakable mode is an option you must turn on explicitly. I think Felix Bachmann wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I have a little problem with the accumulate CE. I try to collect a slot value of a set of facts in a list with the following accumulate statement (produced with (ppdefrule). The interesting slot is the owner slot. I provided a list of facts (Fact-246 - Fact-259) that match the CE of the accumulate. As a result of this rule a fact is inserted (MAIN::AskQuestion), which should contain the collected list in slot (affectedFacts ?rr). The resulting fact Fact-466 contains duplicates and values that are not even in the matching facts. Is this a bug, or what am I doing wrong here? Kind regards Felix Bachmann - rule --- (defrule ImpactAnalysis::__AskcostOfChangeQuestion__ (declare (salience 500)) (MAIN::initial-fact) ?rr - (accumulate (bind ?res (create$)) (bind ?res (insert$ ?res 1 ?_20_own)) ?res (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner ?_20_own) (source ArchE))) (test ( (length$ ?rr) 0)) (not (MAIN::AskQuestion (questionId costOfChange) (answerAvailable nil))) = (bind ?def (create$)) (foreach ?r ?rr (bind ?def (insert$ ?def 1 \0.0\))) (assert (MAIN::AskQuestion (questionId costOfChange) (questionGroup nil) (parent nil) (affectedFacts ?rr) (parameters ) (options ?rr) (default ?def) (answer ) (answerAvailable nil) (log nil -- rule fires - Jess FIRE 1 ImpactAnalysis::__AskcostOfChangeQuestion__ f-0, f--2,, -- facts immediately after this rule - f-246 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-106) (source ArchE) (status nil)) f-247 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-105) (source ArchE) (status nil)) f-249 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-103) (source ArchE) (status nil)) f-251 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-101) (source ArchE) (status nil)) f-252 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-100) (source ArchE) (status nil)) f-253 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-99) (source ArchE) (status nil)) f-254 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-98) (source ArchE) (status nil)) f-255 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-97) (source ArchE) (status nil)) f-256 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-96) (source ArchE) (status nil)) f-257 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-95) (source ArchE) (status nil)) f-259 (ModifiabilityReasoningFrameworks::P_CostOfChange (value 0.0) (owner Fact-93) (source ArchE) (status nil)) f-466 (MAIN::AskQuestion (questionId costOfChange) (questionGroup nil) (parent nil) (affectedFacts Fact-93 Fact-106 Fact-94 Fact-94 Fact-95 Fact-96 Fact-97 Fact-98 Fact-99 Fact-100 Fact-101 Fact-102 Fact-102 Fact-103 Fact-104 Fact-91 Fact-91 Fact-104 Fact-92 Fact-92 Fact-105) (parameters ) (options Fact-93 Fact-106 Fact-94 Fact-94 Fact-95 Fact-96 Fact-97 Fact-98 Fact-99 Fact-100 Fact-101 Fact-102 Fact-102 Fact-103 Fact-104 Fact-91 Fact-91 Fact-104 Fact-92 Fact-92 Fact-105) (default 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0) (answer ) (answerAvailable nil) (log nil)) [Attachment, skipping...] - 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: MAIN module and rule firing order
Let's start from a concrete example. The program below runs and produces what I expect as output. Do you agree? Can you modify it to produce surprising output?? (defmodule UPDATE) (defrule UPDATE::foo (MAIN::a) = (printout t foo crlf)) (defrule MAIN::bar (MAIN::b) = (assert (MAIN::a)) (printout t bar crlf)) (defmodule CLEAN-UP) (defrule CLEAN-UP::baz (MAIN::c) = (assert (MAIN::b)) (printout t baz crlf)) (reset) (assert (MAIN::c)) (focus UPDATE) (focus MAIN) (focus CLEAN-UP) (run) I think Scott Moss wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I called, in this order, engine.setFocus(UPDATE); engine.setFocus(MAIN); engine.setFocus(CLEAN-UP); engine.run(); from a Java program. I had understood from JIA (p.127) that I could push the MAIN module onto the focus stack in this way (though it would always be on the bottom of the stack as well). In my Jess program, rules firing in the MAIN module activate rules in the UPDATE module but, at least in some cases, the latter do not fire unless I move them to the MAIN module. It appears that the MAIN module ONLY gets focus last. This seems at odds with the JIA description -- unless, of course, I am doing something wrong. -- Scott Moss Professor of Social Simulation Centre for Policy Modelling Manchester Metropolitan University Aytoun Building Manchester M1 3GH http://cfpm.org/~scott (t) +44 (0)161 247 3886 (f) +44 (0)161 247 6802 (m) +44 (0)7740 942564 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]
Re: JESS: More Jess concurrency questions
You could use the gensym function to give you a unique symbol to use for a variable name, and then use build to create your defglobal the same way you've done here for the defrule; or use gensym to create a symbol, but use it as a key to store your ArrayList with store and fetch. I think Matthew Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi everyone, The following function is typical of the sort of code I'm writing in Jess: -- (defglobal ?*similar_result_array* = (new ArrayList 0) ) (deffunction dynamic-similar-search (?p1 ?p2 ?p3 ?p4) (bind ?s1 (str-cat (defrule similar_rule (?p1 (?p2 \?p3\) (?p4 ?qwerty)) = (call ?*similar_result_array* add ?qwerty) ))) (build ?s1) (return ?*similar_result_array*) ) -- It basically just asserts a rule dynamically using some paraemters I supply it. It also stores results in an ArrayList and then returns this object. My question is about concurrency, in particular: - the use of the global variable - the name of the rule - the variable ?s1 - and the arrya it returns I potentially need to run this function, and other function like it, in a single Rete engine many times concurrently. Is the solution to somehow use a counter or other unique mechanism to create variable and object names? How would I do this, and any other ideas? Is this a problem other people have encountered? Thanks, Matt -- Matthew Hutchinson Ph.D. Candidate Department of Spatial Sciences Curtin University of Technology GPO Box U1987 Perth, Western Australia 6845 Visiting Scholar Department of Geography and Planning University of Akron Akron, Ohio USA - 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: More Jess concurrency questions
I think MJ Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Thanks, great idea for the defglobal. When it comes to the rule name ( similar_rule ), what happens if this user function was called multiple times simultaneously? Couldn't there be problems with the rule over-writing itself? Yes, each time this is called, the old rule will be replaced, so you need to give it a unique name each time, too. Again, you can use gensym. And wouldn't there be siilar problems for the ?s1 variable? No, that's a local variable in the function; no worries there. Cheers, Matt On 5/2/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: You could use the gensym function to give you a unique symbol to use for a variable name, and then use build to create your defglobal the same way you've done here for the defrule; or use gensym to create a symbol, but use it as a key to store your ArrayList with store and fetch. I think Matthew Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi everyone, The following function is typical of the sort of code I'm writing in Jess: -- (defglobal ?*similar_result_array* = (new ArrayList 0) ) (deffunction dynamic-similar-search (?p1 ?p2 ?p3 ?p4) (bind ?s1 (str-cat (defrule similar_rule (?p1 (?p2 \?p3\) (?p4 ?qwerty)) = (call ?*similar_result_array* add ?qwerty) ))) (build ?s1) (return ?*similar_result_array*) ) -- It basically just asserts a rule dynamically using some paraemters I supply it. It also stores results in an ArrayList and then returns this object - 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: Set up questions
I think Lawrence Weathers wrote: Jess (batch examples/jess/sticks.clp) This assumes that your current directory is the Jess distribution directory, with all its original contents intact. You should be able to say Jess (exit) C:\Jess70b6 type examples\jess\sticks.clp and see the code for that example (Jess and C:\Jess70b6 are prompts -- you don't type those.) If you get an error message, then that file is missing -- perhaps you deleted it by mistake? - 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: JessDE: classpath for load-function targets
I think Jonathan Sewall wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I'm trying to get (load-function my.package.MyUserfunction) to work in the JessDE in Eclipse. The MyUserfunction implementation is in a .jar file. Does anyone know where to specify this jar file so that Eclipse and the jesside or jessdebug jars find it? It just needs to be on the project's Java Build Path (right-click on project, choose Properties). - 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: why run-query and run-query* has different result?
The initial-fact pattern is inserted into the query just as it would be inserted into any rule that starts with a backward-chaining-reactive pattern. If you use run-query*, it knows that, and does the right thing. To use the old run-query, you'd have to understand that yourself and allow for it -- here, by using 2 for the fact index instead of 1. It's terrible to expect people to think about this kind of thing, which is why run-query* was invented. The old-style run-query will be supported for Jess 7, but may be removed by Jess 7.1. Finally, to get at the fact objects in a query using run-query*, you just bind them to variables as you would in a normal rule: (defquery foo ?x - (foo)) Then you can ask the QueryResult for ?x and retract it. I think jade fang wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I was playing with backward chaining, and use fib as examples: The following scripts use run-query*, and use resultset to get the value without any problem: (watch all) (deftemplate fib (slot sequence) (slot value)) (do-backward-chaining fib) (defrule recurse ?need - (need-fib (sequence ?n)) = (assert (fib (sequence ?n) (value (call (get-fib-value (- ?n 1)) add (get-fib-value (- ?n 2)) (retract ?need) ) (defquery fetch-fibs (declare (max-background-rules 10) (variables ?s)) (fib (sequence ?s) (value ?v)) ) (deffacts initial-fibs (fib (sequence 1) (value (get-member java.math.BigInteger ONE))) (fib (sequence 2) (value (get-member java.math.BigInteger ONE (deffunction get-fib-value(?sequence) (if ( ?sequence 0) then (bind ?list (run-query* fetch-fibs ?sequence)) (while (?list next) (return (?list getObject v)) ) ) (return 0) ) While I change get-fib-value use run-query function: (deffunction get-fib-value(?sequence) (if ( ?sequence 0) then (bind ?list (run-query fetch-fibs ?sequence)) (foreach ?token ?list (return (fact-slot-value (call ?token fact 1) value)) ) ) (return 0) ) Everything else remains the same, but I got the error message: Jess reported an error in routine Fact.findSlot while executing (fact-slot-value (call ?token fact 1) value) . Message: No slot value in deftemplate MAIN::initial-fact. I can't find any error in my clp files. I will need some help to explain why I get different result using run-query and run-query*. Also, no matter how I wrote the clp file, the initial-fact should not returned as query result, right? I'm using jess 7.0b6, and noticed that online doc talks about the run-query has been depreciated. Does that mean the run-query won't be supported as expected? Also I have another question: run-query*'s resultset seems very easy for data manipulation. But it's no longer a fact object anymore. How can I get hold of the fact from its resultset so that I can use retract function? Thanks for the help. Regards, Jade Fang - 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: why run-query and run-query* has different result?
I think jade fang wrote: Referring to the example from JIA section 7.7: affordable.clp that run-query use fact 1 without that initial-facts inserted. Is that because the query is neither backward chaining nor not/test match, so Jess don't need to insert the initial-facts? Yes. Backward chaining doesn't support function calls inside. Are will going to see the support in the near future? Not the near future, no, but it's possible for some future release. - 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: MIME-Version: 1.0
I think wrote: I tried the following JESS code from JIA on page 101, The book is wrong; this didn't work in Jess 6, either. The statement that ordered facts are implemented as unordered facts with a single multislot named __data is a true statement; but the Jess parser knows the difference and won't let you use the explicit __data slot. You must use ordered fact syntax to refer to ordered facts. Hopefully you were just experimenting out of curiosity; there's no useful reason to actually do things this way. - 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: Jess XML questions
I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] 1) Is there a schema or DTD for the JessXML format ? Not yet, because it's still changing a lot. For example... 2) The Jess native - JessXML conversion seems to ignore comments. Will this be included in a future revision ? I am using the XML format to generate some documentation for my rule bases. Of course, the comments would be nice :) Doc-comments? Yes, that would be nice, wouldn't it? An oversight; I'll be sure that they are added. Thanks. - 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: lisp to jess conversion
I think Jason Morris wrote: Hi Ernest, When you said by design did you originally have in mind that doing so was redundant because one could more easily create nested data structures with readily available Java objects -- an ArrayList of ArrayLists for example -- or was there another reason? Did it make the pattern matching too difficult? Just curious! ;-) Short answer: because that's how it works in CLIPS. Longer answer: Jess's data structures couldn't have efficiently accomodated pattern matching of nested lists, so supporting them would have slowed everything down. Remember that creating lots of little objects used to be very expensive in Java. - 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: bug?
I think Brian Zhou wrote: There must be a bug, either in sudoku.clp or jess 7.0b6. Shouldn't FIRE 315 MAIN::cleancol on line 1166 prevent FIRE 316 MAIN::single_answer_col? It was indeed a recently-introduced Jess bug; I'm glad you reported this, as it's tickling a very obscure corner case. The one-line change will be in the next release, Any Day Now. - 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: lisp to jess conversion
I think Daniel Bond wrote: Hi everyone. I'm a Jess newbie and am trying to convert some Lisp code to Jess. The program is actually a logical reasoning solver and applies Wang's Algorithm. There is a good bit of recursive pattern matching. Since I know very little about Jess, I thought I would ask here. Can you get to the underlying Lisp functions (for instance, cond) from Jess? Is this an insurmountable task? If your interested, I have attached a copy of the Lisp code. There are no underlying Lisp functions save those described in the manual; Jess is not built on top of a full Lisp implementation. Now, it's actually easy to add functions written in Java to Jess, so to some extent, you may be able to add what you need. But the biggest limitation, probably a show-stopper for you, is that Jess, by design, doesn't support nested lists. Any attempt to build a list with another list as an element will result in just one big flat list. - 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: bug?
I think Brian Zhou wrote: So the question remains, jess bug or my bug? I can't explain the behavior; I'm looking into it right now, trying to reproduce it in a simpler program. - 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: forall
The forall CE (forall (A) (B)) says that for every A, B matches. For example ;; Everyone owns a dog (forall (person (name ?n)) (dog (owner ?n))) You're saying something different: given a goal X in state nil, if every goal Y is in state success, then modify goal X. You could write something like ; Given goal X ?g- (goal (name X) (state nil)) ;; There's at least one goal Y (exists (goal (name Y))) ;; All goals Y are in state success (not (goal (name Y) (state ~success))) If there's always a goal Y, you can omit the middle pattern. I think Skeptic 2000 wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, I tried to use the forall in this way and it doesn't work, it's a bug or I misunderstand how it is supposed to work ? I have a deftemplate name goal with two slot, name and state. My rule is : (defrule example ?g- (goal (name X) (state nil)) (forall (goal (name Y) (state sucess)) = (modify ?g (state sucess) In a few words, I put the goal X is in state sucess if every goal Y are in state sucess. Problem is that the 'sucess' criteria seems to not considered by the forall CE. Thanks for help. 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]
Re: JESS: JessML, java API
I think Skeptic 2000 wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, Why a DTD is used for JessML instead of a Schema? Legacy issue? Neither a DTD nor a schema actually exists at this time. Are efforts to improve the tools available to create defrules from Java planned for a near-future? What sort of tools? In fact, I need the tools to enable me to inspect the .clp/jessML content from a higher level stand point and take decisions based on the content of the different constructs (deftemplates/defrules). Well, that's one of the reasons why JessML exists, because you can use any parser you like and whatever XML tools you have at your disposal to work with the results. As far as APIs for building rules: there was a recent humorous bit about rule engine APIs for creating actual rules at The Daily WTF just the other day; it's here: http://www.thedailywtf.com/forums/68489/ShowPost.aspx Jess won't be getting an API like this; it's just silly. If you want one, build XML with the DOM. - 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: depth vs breadth
I think Skeptic 2000 wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Oh, now I feel bad, but I was in the Java mindset, can it be done with the SetStrategy method? Yes, you could use the Rete.setStrategy() method, if you had an instance of the class you wanted Jess to use; but the ones that implement depth and breadth aren't actually public, so in practice you can only do this with your own implementations. Just say (Jess 7) Rete engine = ... engine.eval((set-strategy breadth)); In Jess 6, you have to use executeCommand() instead of eval(). A new question : the descripton of the two defaults strategy talk about choosing the rule according to the order in which they have been activated. But when we implement Strategy, we must compare two Activation object and I don't see a method that give us a way to know which one is the more recent. The needed methods in the Token class are not public. There's actually a comment in the Jess 7 source wondering whether they should be made so; perhaps they should. The Fact class has a public getTime() method, which see; it returns a number related to the recency of the fact's last modification. - 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: resolving variables when using build
I think Matthew Hutchinson wrote: 1. Why can't defrule be used directly within a user function? Basically because it's executed by the parser, not by the runtime engine. It's executed immediately when it's encountered in the source. If you look in the back of the (Jess 7) manual, you'll find an appendix listing all the constructs, separate from the list of functions; all the constructs are the same way. In standard Lisp-ese, these are known as special forms. 2. What is the scope of a variabled bound (binded?) within a user function? Limited to that user function. 3. If build comes across a variable ( ?someVar ) in a string it is evaluating, does it treat it like a variable? That depends on what the variable means in the code being parsed by build. If you're build-ing a function call, then that function call will be evalulated right away, using the deffunction's execution context to find the values for variables. So, for example, (bind ?x 1) (build (printout t ?x crlf)) prints 1. But if you're build-ing a defrule, then the parser knows that variables are supposed to be inserted literally into the defrule itself. It's exactly as if the rule were included at the top level of your Jess program. Your variable ?matches is eventually interpreted in the context of the firing defrule; the deffunction context is long gone by then. Since you basically want ?matches to be a global variable shared by multiple rule firings, you need to make it a global variable. Use a defglobal for this. (clear) (reset) (import java.util.ArrayList) (deftemplate street_name_alias (slot actual_name) (slot actual_type) (slot dli_id) (slot soundex) (multislot alias) (slot lga) (slot locality) ) (load-facts road_facts.fct) (deffunction street-names-soundex (?input) (bind ?matches (new ArrayList 0) ) (bind ?code (str-cat \?input\) ) (printout t ?code crlf) (bind ?rule (str-cat (defrule name-from-soundex (street_name_alias (soundex ?code ) (actual_name ?name)) = (call ?matches add ?name) )) ) (build ?rule) (return true) ) (street-names-soundex M640) (run) --- When I refer to ?matches in my RHS, shouldn't it see the variable I have already established, which points to the ArrayList? As always thanks. I posted this I have been stuck for ages. Cheers, Matt -- Matthew Hutchinson Ph.D. Candidate Department of Spatial Sciences Curtin University of Technology GPO Box U1987 Perth, Western Australia 6845 Visiting Scholar Department of Geography and Planning University of Akron Akron, Ohio USA - 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: engine.run()
I think Roger Studner wrote: Why do I have to do engine.run() *again* to get my rules to fire? Rules fire only during a call to run(). WHen there are no rules to fire, run() returns. Jess doesn't create any Threads of its own; things happen synchronously, during calls to Jess methods. I mean, does this mean I have to have a loop 'constantly' calling engine.run() over and over? Nope, that's what runUntilHalt() does -- it never returns until you explicitly stop it by calling halt(). It doesn't just call run() in a loop, though -- it uses wait() and notify() so that it uses 0 CPU cycles until there are actually rules to fire. Note that if you want the engine to run forever, then that will tie up a Java thread -- the thread that calls runUntilHalt() won't be available to run any more of your code, since runUntilHalt() won't return. So generally, you create a dedicated thread to call this method, or you call it as the last method of a script, having arranged for something to happen asynchronously in some other threads. - 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: engine.run()
I think Roger Studner wrote: Then frmo an outside class, I did Thread t = new Thread(RuleClass); t.run(); That's very close. Instead of calling run(), you call start(). That method contains the extralinguistic voodoo to start an actually parallel lightweight process; that process then turns around and calls run() for you. start() returns right away, but that other process calls run(), which doesn't return (in your case.) - 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: Databases and Jess
I think Matthew Hutchinson wrote: Thanks for all the help so far, the more I use Jess the more I am impressed - with the product and the support. Anyway, my question: Thanks! I have a whole bunch of data relating to street addresses (suburb names, street names etc.) which sits quite happily in a database. However, I want to start using these database records as facts (or rules, not sure which yet) in Jess and match some incoming information. Tu cut a long story short, is it bad programming and design to simply put my whole database into Jess? I want to use Jess for its intended purpose - it just seems like a massive overhead to have what be a massive database in Jess. Is there a way to use both - keep most of the data in the database but somehow still utilize jess? what do people do in this situation? It's not bad style, but you do have to be smart about it. If it's small enough for the whole thing to fit in working memory, then go ahead and load it up, but try to load it on the bottom -- i.e., load it first, and since it's unchanging data, mention those facts first in all the rules that use it. If it's too big for that, or if it might become too big, then you can look at bringing the data in on demand. Many people have used backward chaining for this. There's a tool called the Fact Storage Provider Framework that does this automatically for JDBC databases. Look on the User Contributions page at the Jess web site. It's a nice piece of work. Remember that backward chaining lets a rule fire when some other rule is trying to match a fact, but that fact is missing. The FSPF supplies some rules that are triggered by backward chanining and go off and pull the required facts out of the database, as needed. Then ddata that's never used is never loaded, and data that *is* needed is loaded just once. - 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: defquery problem
I think Scott Moss wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I asked a few days ago about defquery and enums. On further investigation, I am less inclined to believe that the problem is due to the enums. Is there any general reason why, or common mistake causing a run-query* to return just one fact when there are many facts in working memory satisfying the defquery clause? The alternative (which happened with enums) is that all but one such fact is returned. Maybe show us the code that calls run-query* and works with the result? Note that the QueryResult object behaves like a JDBC ResultSet or an Iterator, in that you have to call next() on it to advance it to the first record before use. - 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: use of sleep() of java.lang.Thread in rules
Rules are executed in a single thread in a well-defined order. If a rule sleeps, all pending activations are delayed. I think Henrik Rentz-Reichert wrote: Hi, does the following rule (defrule test_wait (start) = (printout t starting crlf) (call java.lang.Thread sleep 1) (printout t done crlf) ) block the Jess engine (and thus keeps other rules from beeing processed) when executed? Or are there separate threads for each (activated) rule? - 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: Problem with binding fact in rule
I think Matthew Hutchinson wrote: I have tried all sorts of variations, and have done this before but I have just gone blank. (I also looked thru some previous postings) as you can see, i need to store the matched fact, then refer to it, and update the multislot with its previous contents and the new item. Just this? (defrule alias-rule1 ?R - (street_type_alias (actual WOODS) (alias ?previous_alias)) = (modify ?R (alias ?previous_alias WS))) - 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: enums
We don't have a lot of experience using Jess with enums, so it's possible that something odd is happening that hasn't been reported yet. If you could assemble the smallest possible self-contained example of the problem and send it to me personally, I'd be much obliged. I think Scott Moss wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Has anybody tried using enums as shadow facts? I've been getting some apparently bizarre results. Forgive me for showing actual code, but I don't understand the problem well enough to produce a simple example. Producers have activities that produce waste of various kinds. There is an enum WastePackagingMaterials defined as follows: public enum WastePackagingMaterial { paper_board(.49, 5), glass(.24, 7), steel(.05, 3), aluminium(.01, 9), plastic(.09, 10), wood(.12, 6); ... Each activity of each producer produces one unit of one of these types of waste. A rule has the following RHS (assert (packaging-waste-produced (wpm ?wpm) (quantity ?level) (activity ?activity) (timestep ?t) (clauseOwner ?producer) (tickStamp ?t))) A second rule fires once for each producer and has the following RHS (bind ?wpm-list (create$ (call WastePackagingMaterial values))) (foreach ?wpm ?wpm-list (printout t (?wpm toString) crlf) (bind ?quantity (total-packaging-waste ?producer ?wpm)) (assert (total-packaging-waste-produced (wpm ?wpm) (quantity ?quantity) (timestep ?t) (clauseOwner ?producer) (tickStamp ?t)) where total-packaging-waste is a function that calls the following defquery: (defquery waste-packaging-material-query (declare (max-background-rules 10)(variables ?producer ?wpm)) (packaging-waste-produced (wpm ?wpm) (quantity ?quantity) (activity ?activity) (timestep ?) (clauseOwner ?producer) (tickStamp ?))) This defquery calls the relevant instantiations from the first rule except -- and this is what seems bizarre -- it gets the facts for the first constant of the enum for the first rule instantiation only but it gets all of the facts for all of the other constants (i.e., all but paper_board) for all of the producers. If there is some stupid bug in my code, then I shall be as grateful as I will be ashamed if someone could point it out to me. If it isn't my bug, then there is a problem with using enums in the current (b6) version of Jess7. -- Professor Scott Moss Centre for Policy Modelling Manchester Metropolitan University Aytoun Building Manchester M1 3GH UNITED KINGDOM telephone: +44 (0)161 247 3886 mobile: +44 (0)7740 942564 fax: +44 (0)161 247 6802 http://cfpm.org/~scott 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]
Re: JESS: JESS : ILOG Rules translation into JESS
I think Yura wrote: I'd like to reformulate the question. What language constructs (like queries or backward chaining) presented in Eclipse, ILOG, etc. aren't implemented in JESS? I'm a little uncomfortable with the way you've phrased this question; my belief is that if anything, the Jess language has *more* language features than other major rule engines, not fewer. But in general, I think for any feature in the Jess rule language or in ILOG, Fair Isaac, or Haley's products, you'll find an equivalent in the others, although the formulation will often be different. For example, Jess has backward chaining and JRules has finders. On close examination, you'll discover these are really equivalent, just expressed differently. - 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: Loading JessXML rules into memory
I think Matthew Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Thanks for the quick reply, but unfortunately even when I take out the extra (reset) the facts are not loaded into memory. Also, for some reason I thought that a deffacts told Jess what facts to load into memory when a reset command was issued - my mistake. No, that's right; the mistake was mine, I wasn't thinking that you had deffacts in your XML file. Is my XML ok? Actually, no; this is only a fragment. The document element should be a rulebase element. Didn't you get a parse error from batch ? The beginning of a valid JessML file looks like ?xml version='1.0' encoding='US-ASCII'? ?JessML-version 1? rulebase ... XML snippet: - ?xml version=1.0 encoding=US-ASCII? facts name MAIN::deffact_st_type_alias /name fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeACCESS/value/slot slot name alias /name valuetypeSYMBOL/typeACCS/value /slot /fact fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeALLEY/value/slot slot name alias /name valuetypeSYMBOL/typeALLY/value /slot /fact fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeALLEYWAY/value/slot slot name alias /name valuetypeSYMBOL/typeALWY/value /slot /fact fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeAMBLE/value/slot slot name alias /name valuetypeSYMBOL/typeAMBL/value /slot /fact SNIP fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeYARD/value/slot slot name alias /name valuetypeSYMBOL/typeYARD/value /slot /fact /facts Am I missing a command? Is it right to have the facts contained in a deffacts? Thanks so much! Matt On 3/30/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think Matthew Hutchinson wrote: (batch stf.xml) (reset) reset clears working memory, retracting all the facts you just loaded. - 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] - 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: Jess bload format error
I think Steve Solomon wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, I'm trying to bload a file that I previously bsave'd using the Java API. I am getting the following error: ... Nested exception is: Not in GZIP format Are you sure the file hasn't been damaged somehow? - 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: Loading JessXML rules into memory
I think Matthew Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi Ernest, Thanks for clearing that up. And no, there was no error from batch - which made me wonder what was going on... That's weird. Certainly the current version will throw an error -- are you using an earlier beta? I will put those extra lines into any XML I write. Is the XMLWriter supposed ot put that in for me though? The way it's set up currently, if you use the command-line interface, it produces a whole document, but if you use new XMLPrinter(something).toString(), it just makes a fragment, part of a document. This needs to either be documented better, or changed, or made more flexible, or something. Cheers, Matt On 3/31/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think Matthew Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Thanks for the quick reply, but unfortunately even when I take out the extra (reset) the facts are not loaded into memory. Also, for some reason I thought that a deffacts told Jess what facts to load into memory when a reset command was issued - my mistake. No, that's right; the mistake was mine, I wasn't thinking that you had deffacts in your XML file. Is my XML ok? Actually, no; this is only a fragment. The document element should be a rulebase element. Didn't you get a parse error from batch ? The beginning of a valid JessML file looks like ?xml version='1.0' encoding='US-ASCII'? ?JessML-version 1? rulebase ... XML snippet: - ?xml version=1.0 encoding=US-ASCII? facts name MAIN::deffact_st_type_alias /name fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeACCESS/value/slot slot name alias /name valuetypeSYMBOL/typeACCS/value /slot /fact fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeALLEY/value/slot slot name alias /name valuetypeSYMBOL/typeALLY/value /slot /fact fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeALLEYWAY/value/slot slot name alias /name valuetypeSYMBOL/typeALWY/value /slot /fact fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeAMBLE/value/slot slot name alias /name valuetypeSYMBOL/typeAMBL/value /slot /fact SNIP fact name MAIN::street_type_alias /name slot name actual /name valuetypeSYMBOL/typeYARD/value/slot slot name alias /name valuetypeSYMBOL/typeYARD/value /slot /fact /facts Am I missing a command? Is it right to have the facts contained in a deffacts? Thanks so much! Matt On 3/30/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I think Matthew Hutchinson wrote: (batch stf.xml) (reset) reset clears working memory, retracting all the facts you just loaded. - 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] - 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] - Ernest Friedman-Hill Advanced Software Research Phone: (925) 294-2154 Sandia
Re: JESS: Loading JessXML rules into memory
I think Matthew Hutchinson wrote: (batch stf.xml) (reset) reset clears working memory, retracting all the facts you just loaded. - 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: JESS : ILOG Rules translation into JESS
I think Marc Clin wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi all Jess-Users I'm a newbie in the Jess World. I would like to translate ILOG Rules rules into Jess rules. To begin, I would like to express two basic rules with Jess but it seems that I can't do it as easily I would like. Here are my two rules : 1) If user=X then support=CD 2) If product=Y then convert format into Z or convert format into W Are those rules possible in Jess. If so, can someone help me to write them ? As with any kind of programming, the first step is to define your data structures. You can't write rules until you know what the rules are operating on. In Jess, data structures are either deftemplates or Java classes. YOu have to decide exactly what representation you're using for user and X and support and CD before I can sensibly say how to write the rules. But given appropriate data structures, as David has already stated, these are very simple rules and easy to write. - 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: Can multislots be properties in Java bean shadow classes?
I think Steve Solomon wrote: for a list of type String. What if the multislot in Jess is of mixed type (strings, symbols, numbers, and object references)? What is the appropriate type of array to use? Object[] seems to work the best but the property setter converts the symbols to strings. Generally, a Java String object is always going to be a Jess RU.STRING. Related question: The function definstance imports Java bean instances into Jess. Is there a way (a function, perhaps) to export a fact (fact id) to Java? If you've got the id number in Java, you can use the Rete.findFactById() function to get the jess.Fact object. If you'd got a Fact bound to a variable in Jess, then you can pass it to a Java function or store it using (store) and Java code can get it from there. There are plenty of ways for Java code to get ahold of a Fact -- if you have a particular scenario in mind that you can't see how to handle, just describe it. - 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: Retracting and asserting big sets of facts
I think [EMAIL PROTECTED] wrote: Hello, Perhaps the new (or upcoming?) memory marking rollback mechanism would be appropriate here? Has this feature been documented yet? It's in there (in Jess 7), and documented, but it doesn't have any special performance advantage. - 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: creating a deffacts with already asserted facts
The jess.Deffacts class has a public constructor, and the addFact() method is also public. There shouldn't be any problem with constructing a jess.Deffacts and adding all the facts to it. I think Matthew Hutchinson wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi everyone, If I already have a bunch of facts in working memory, is it possible to create a deffacts using these? I'm interested in selecting a portion of the rules in working memory, then creating a deffacts of these so I can pass this to the XMLPrinter class and write the deffacts to XML. As always, thanks Matt -- Matthew Hutchinson Ph.D. Candidate Department of Spatial Sciences Curtin University of Technology GPO Box U1987 Perth, Western Australia 6845 Visiting Scholar Department of Geography and Planning University of Akron Akron, Ohio USA - 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: Can multislots be properties in Java bean shadow classes?
I think Steve Solomon wrote: I'd like to define the following bean class: ... public class Phrase implements Serializable { ... public ValueVector getFullForm() { return full_form; } public void setFullForm(ValueVector full_form) { this.full_form = full_form; } } Jess doesn't like to work with classes that expose properties of type Value or ValueVector -- the reflection mechanism gets confused. Instead of a ValueVector property, just use an array of whatever type is appropriate. It will appear as a list in Jess, and you set it using a list from Jess. Also, is it possible for a shadow bean class to have a constructor that I can call from Jess? Instead of (new Phrase) something like (new Phrase 57 TRUE (list 1 2 3 foo)) ? Yes, of course -- you probably ran into the same problem here, trying to call a method that wants a ValueVector as an argument. Again, just use an array. - 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: Why Jess is better ?
I think Jeewoong Byeon wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi! I have a very newbie question. For me, Jess is the way to show better UI at first glance. But I am wrong. No idea what you're saying here. Then I found that so many people using Jess with Repast like simulation toolkit. Why people use Jess in agent simulation model? All Jess rule can represent in punch of if-then-else statement in Java. Then what is the Jess's advantage to use it? All computation is a bunch of if-then-else statements, in Java or in any other language. Anything computable can be computed that way. A rule engine like Jess lets you write interrelated logical statements separately, leading to clearer code, and it evaluates them efficiently for large quantities of data. Programming with rules works very well when you're coding a problem that doesn't have an algorithmic solution. - 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: Announcing Jess 7.0b6
I think Steve Solomon wrote: Is there any update on when the LEX conflict resolution strategy might be implemented? It won't be in 7.0. It's on the official list for 7.1, so look for it in the alpha 7.1 releases after 7.0 comes out late this spring. Thanks, Steve Solomon USC Institute for Creative Technologies [EMAIL PROTECTED] -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Sunday, March 12, 2006 6:39 PM To: Jess Mailing List Subject: JESS: Announcing Jess 7.0b6 Hi Folks, Version 7.0b6 of Jess, the Java Programmer's Rule Engine, is available for download at the usual place: http://www.jessrules.com/download.shtml This version includes substantial documentation updates and some very nice usability enhancements, including Java Patterns -- a new syntax for writing simple slot tests that is more readable and natural for Java programmers to use. From the change log: Fix bug in (logical) when modifying working memory from nested scopes (thanks Yuri Gribov). Added add function. Added Java patterns. Deprecated executeCommand() in favor of eval(). Massive manual rewrites. Another logical/slot-specific bug fixed (thanks Shan Ming Woo.) Rete member in ClassSource transient (thanks Jonathan Sewall.) Overloaded updateObject() accepting property name (for Lakshmi Vempati). Fix synchronization of undefinstance * (thanks Abdul Quddoos Khan). Slight change to accumulate semantics (thanks Shan Ming Woo.) Overloaded add() methods in ValueVector. The final release of Jess 7 is getting very close. As usual, comments and questions are welcome on the mailing list at jess-users@sandia.gov or directly to me at [EMAIL PROTECTED] Your feedback now is more important than ever. - 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] - 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: Greetings A Curious Problem
I think Dave Tapley wrote: Is this a known issue or am I over looking something here? I just don't see how the (test) can return TRUE and the rule not fire. Pattern-matching is driven by working memory modifications (assert, retract, modify) and proceeds from the top down in any one rule. A test CE is evaluated only when the preceding pattern is matched. Therefore the test in your oneSmall rule will be evaluated only when a Cell fact is or asserted/modified. Presumably the Small facts are all asserted after all the Cell facts, so at the time the test is evaluated, there *are* no Small facts in working memory. Using test to run a query is a sort of end run around the normal pattern-matching process; there are better ways to write this so that you get the answer you want. One would be like this: (defrule oneSmall-good ;; There is a cell (Cell (r ?r) (c ?c)) ;; With a small value (Small (r ?r) (c ?c) (v ?v)) ;; And no other different small value (not (Small (r ?r) (c ?c) (v ~?v))) = (printout t ?rx?c has 1 small number: ?v crlf) You could also use accumulate to count the Small facts and match the count; that would be convenient if you wanted to have exactly 27 matches, for example. But using a query on a rule LHS should be an absolute last resort. - 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: Adding facts from java
I think ahmad Sayed wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, I don't think that it's a string or symbols problem. Actually, that's one of the *two* problems I see. It's not even taking my .clp file into account! It is, and that's the other problem... Fact f = new Fact(fact1, r); In the line of code above, you're creating a fact of type fact1. There was no such template in your Jess code; you've just got a template named triple. Because you've defined this fact, Jess automatically creates an ordered template with this name -- a template with a single multislot named __data. f.setSlotValue(predicate, new Value(http://www.w3.org/1999/02/22-rdf-syntax-ns#type;, RU.SYMBOL)); On that line, you're setting the slot predicate in a fact of type fact1. The fact1 template has no such slot, so Jess says: Jess reported an error in routine Fact.findSlot. Message: No slot predicate in deftemplate MAIN::fact1. This error message seems very clear to me, but that's because I wrote it, I suppose. If you have suggestions for improving it please let me know. Now, when that problem is cleared up, there's another. Let's look at this same line again: f.setSlotValue(predicate, new Value(http://www.w3.org/1999/02/22-rdf-syntax-ns#type;, RU.SYMBOL)); You're putting a SYMBOL into the predicate slot. But looking at your rule: (defrule rule-1 (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) The predicate slot pattern matches a double-quoted STRING. This is exactly tre string/symbol problem we're talking about in another thread; this *won't* match, and this causes maybe people new to Jess a lot of grief. I think Jess should be changed so this *does* match. I find this very strange !! I'm still stuck here .. As I said, I'd be happy to hear your suggestions for what that error message could have said to explain the problem more clearly. - 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: Strings vs. Symbols
I think Jason Morris wrote: (somefact (s foo)) would give the same match as: (somefact (s foo)) is logically inconsistent, I think. There is an assumption that the literal meaning of the symbol foo equals foo, which cannot be known without some other information. I wish I had a concrete example, but prima facie it seems like bad karma. In many Lisps, an unadorned symbol is a variable; in that case, there's a *big* difference between the two. In Jess, variables are decorated with a ?, so this is less of an issue. And Jess is tightly integrated with Java, and therefore people are generally using it with a Java mindset. Part of that is the idea of strong typing. Although you could define a template foo with a slot bar and assert a dozen foo facts with a different type of value in every bar slot -- i.e., an RU.SYMBOL in one, an RU.INTEGER in another, an RU.FLOAT in another -- people generally don't do that. They think about facts like Objects, and slots like Bean properties, and they expect them to hold one type only. Therefore, during pattern matching, I think it's a very sensible assumption that whatever data type Jess finds in a pattern was intended by the programmer to be the same data type as whatever Jess finds in the Facts, and therefore slightly more lenient matching is just allowing some convenient shorthand and avoiding some hard-to-find bugs. I'm thinking that one could (and perhaps should!) make the same argument about numeric types: 1 in a pattern should match 1.0 in a fact, for example. - 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: Adding facts from java
I think ahmad Sayed wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Ok do u know how to get things work from java? I'm asking just the very simple things to start things over. I mean I just need to add facts from java and nothing is working out, neither with the r.executecommand(factstr) or with r.assertfact(f). U can check my previous mails to see exactly what kind of errors it's giving me. I'm sorry -- do you not think I'm being helpful? You've tried the same thing at least three different ways, and each time I've pointed out the errors, and you've gone on to try things another different way rather than fixing the small errors. It seems as though you haven't even been reading what I've written. In my last mail, I told you to use triple instead of fact1, and RU.STRING instead of RU.SYMBOL for the slots that contain URLs, and then your simple program should work fine. I also asked you for feedback to help improve the error messages you've seen, because in every case all I've been doing is explaining what the error messages were already trying to tell you. - 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: Dr. StrangeJess
Look carefully at his message -- he built up the rules as Strings in Jess code and used build to compile them. I think Roger Studner wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Question.. how are you loading the generated rules into the jess engine? do you create files on the filesystem and then batch them in? I can obviously create rules a ton of ways.. but didn't know if you did it via DefRule API.. or if you build text files and then used 'batch' to load them in? Any help would be great, Roger On 3/9/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How I learned to stop worrying and love the meta-rule. Long post warning, if you're not interested in my possibly rambling nature. I do have a couple questions regarding common patterns in Jess at the end, which I would appreciate a little feedback on if you have a few minutes. Regarding my recent post about performance, I was able to resolve it this morning solely by making changes to the rules. How? By making more rules and have them rely on constants where possible instead of variables. Like probably many people, I came to Jess rules systems after many years (15 - egad!) of object-oriented programming over relational databases. That way of thinking for so long can sure program the mind to work a certain way, and it can take some time to deprogram. Anyway, in the slow version of my system, I had 3 core rules causing bottlenecks and they took this general form (a simplification, and they also seek min/max values of some values, but it gets the idea across): (defrule do-it (aaa (a ?a) (b ?b) (c ?c) (d ?d) (e ?e) (f ?f)) (bbb (a ?a) (b ?b) (c ?c) (d ?d) (g ?g) (h ?h) (i ?i)) (ccc (a ?a) (b ?b) (c ?c) (d ?d) (j ?j)) = ;do something meaningful ) The thing about this, is that the values for ?a ?b ?c ?d are taken from lookup tables in a database, and vary for each request into the system depending on user actions in a client application (each service request asserts a few facts, causing rules to fire which possibly update some shadow-facts, and then collects the updated state from the underlying java beans to return to the user). There are only a few possible values for each of these variables, but combined with the facts that contain them, I was getting an enormous number of partial matches. And I do mean a lot. Profiling showed that with only about 5000 facts in the system, a single service request was causing 10+ million value comparisons to be made. Ouch. I've had this problem in the back of my mind for several weeks, and investigated some other avenues such as the profiling I mentioned, without really getting anywhere. This morning I finally saw the light: static queries on dynamic data - of course! The lookup values are really static data, and shouldn't be treated like query parameters. What I had been doing was using these variables to qualify the LHS much the same way a sql query would work. But, that goes against sql: dynamic queries on static data, jess: static queries on dynamic data. Then I started thinking about turning those variables into constants and having a separate rule for every permutation and if that would reduce all those partial matches and millions of comparisons. Would it be hard to write a meta-rule to write these rules? Turns out it was ridiculously easy. I already had some backchaining going on, that was fetching in some other db data the first time a given combination of ?a ?b ?c ?d was encountered (to assert aaa bbb facts, among a few other things). I added another backchained fact to keep track of which permutations had yet to have their rules written, and ended up with something like this: (defrule get-do-it-rules (need-do-it-rules (id ?) (a ?a) (b ?b) (c ?c) (d ?d)) = (bind ?cmd (str-cat (defrule do-it- ?a - ?b - ?c - ?d (aaa (a ?a) (b ?b) (c ?c) (d ?d) (e ?e) (f ?f)) (bbb (a ?a) (b ?b) (c ?c) (d ?d) (g ?g) (h ?h) (i ?i)) (ccc (a ?a) (b ?b) (c ?c) (d ?d) (j ?j) ) = ;do something meaningful ))) (build ?cmd) (assert (do-it-rules (id gensym*) (a ?a) (b ?b) (c ?c) (d ?d)) ) resulting in rules that look like: (defrule do-it-400-600-1-300 (aaa (a 400) (b 600) (c 1) (d 300) (e ?e) (f ?f)) (bbb (a 400) (b 600) (c 1) (d 300) (g ?g) (h ?h) (i ?i)) (ccc (a 400) (b 600) (c 1) (d 300) (j ?j) ) = ;do something meaningful ) What happened was a big wow - I went from 3 core rules to over 200, and a run of the system went from 20+ seconds to 1 second. This is a huge win, considering this is a service that gets hit by our client application while the people that use it are on the phone with customers. While I could have done this outside of jess by writing java code to generate a batch file containing the rule permutations, it was more natural in this case to just do it within jess. Overall
JESS: Strings vs. Symbols
Hi Folks, As so many newbies learn, painfully, unquoted symbols and double-quoted Strings are two different data types in Jess. Pattern matching treats them as distinct, and this is particularaly difficult when you're dealing with Strings that come in as properties of Java objects. We've had to explain this many times on this list, and I've explained it many times in private email as well. So my question to you all is: does this make any sense? Jess behaves this way only because long ago, acting like CLIPS was a priority. I'm not sure that keeping this behavior makes any sense anymore. Let's say that Jess 7, for the purposes of pattern matching, considered Foo and Foo to be equal. Is there anyone reading this who has code that would break as a result? It would certainly help a lot of people if this change were made. Let's hear what you think. - 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: Benchmarks
An interesting blog entry including some Jess-related benchmarks: http://woolfel.blogspot.com/2006/03/jess6-vs-drools3-vs-clips-623.html Note that this is Jess 6 he's talking about. - 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: Adding facts from java
I think ahmad Sayed wrote: For a total of 1 facts in module MAIN. Jess reported an error in routine Funcall.execute while executing (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) etc... OK, sorry, I didn't look closely at your code the first time. Let's look at three lines of your Java code: This first one creates an ordered fact of type myfact1. Not sure what this is for, but it doesn't hurt anything. Fact f = new Fact(myfact1, r); This next one is where the error is occurring; the message while executing (triple... is a hint that your facts are being interpreted as function calls. That's because in the following line, you pass the text of an assert function call to assertString. assertString wants the text of a single fact; you've instead sent it the text of a function call that asserts two facts, and so it throws the exception. f=r.assertString(factstr); If the previous line *had* succeeded, there would be no need to assert f here, as the assertString call would have asserted it, so this line would have no effect. r.assertFact(f); Replace all three of these lines with r.executeCommand(factstr); and you should be in good shape. - 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: what is the best way to backup steps performed/inferenced?
I think Nan wrote: I deeply appreciate the information provided here. Dr. Ernest, you mentioned the marking mechanism in Jess 7 that seems what I need. Can I make multiple markings? (For example, user has gone through 10 Q/A, he wants to back to the second question - or any of the previous steps - I will have to mark each step) Yes. When you make a mark, you get back a Memento, which you give back to Jess to reset memory to that point. - 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: Adding facts from java
OK, let me say two things first: 1) People *always* want to embed Jess code into Java, rather than putting it into a separate file. I don't know why it's so important to people to do this, because it's *extremely* hard to embed code in any language into text strings in another language without making mistakes. This is why, for example, scriptlets in JSPs are a maintenance nightmare. People act as though this is very important, but I've never understood why. Put Jess code into its own files, folks! The JessDE makes this impossibly easy! 2) The Semantic Web and all its children may never succeed because of this obsession with using URLs to identify everything. I certainly understand the concept, but URLs are a) long and b) contain too many special characters. As a result, they're hard to work with in any language, and a String containing lots of URLs is a beast, no matter how you look at it. OK, now, given all the other problems that we've reported with your code, here's another one: your embedding of the assert function call into a String contains a bunch of stray semicolon (;) characters, which is a comment delimiter in Jess and other Lisp derivatives. I don't know why the semicolons are there. I went back and cut and pasted your Java code into a Java file and changed it to print the resulting String, and here's what I get (with non-ASCII characters removed). It's all one line: (assert (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;;) (subject Anomalie1) (object http://www.owl-ontologies.com/mammonto.owl#Anomalie;;))(triple (predicate http://www.owl-ontologies.com/mammonto.owl#contient_opacit;;) (subject Anomalie1) (object Opacit1))(triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;;)(subject Ronde1) (object http://www.owl-ontologies.com/mammonto.owl#Ronde;;) ) (triple (predicate http://www.owl-ontologies.com/mammonto.owl# Right after the first URL, just after the close quotes, is a semicolon. That makes the rest of the line into a comment. So really, this comes out to (assert (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type; and nothing more. No wonder it doesn't work! Now, is it *REALLY* so important to embed this Jess code into Java Strings? People have driven themselves mad over less! I think ahmad Sayed wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Well i've tried that before, it gaves me : run: f-0 (MAIN::initial-fact) For a total of 1 facts in module MAIN. f-0 (MAIN::initial-fact) For a total of 1 facts in module MAIN. BUILD SUCCESSFUL (total time: 1 second) So it doesn't realy take the rules present on ontologie-sein.clp into account. In that file, I have list of rules that looks like this: ;;; Declaring the triple template - (deftemplate triple Template representing a triple (slot predicate (default )) (slot subject (default )) (slot object(default )) ) (open testRel.txt test w) (defrule rule-1 (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) (subject?x1) (object http://www.owl-ontologies.com/mammonto.owl#Anomalie;) ) (triple (predicate http://www.owl-ontologies.com/mammonto.owl#contient_opacit_;) (subject?x1) (object ?x2) ) (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) (subject?x3) (object http://www.owl-ontologies.com/mammonto.owl#Ronde;) ) (triple (predicate http://www.owl-ontologies.com/mammonto.owl#__forme;) (subject?x2) (object ?x3) ) = (assert (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) (subject?x1) (object http://www.owl-ontologies.com/mammonto.owl#ACR2;) ) ) ) When I tried to to put the following fact directly in the .clp file like this : (deffacts fact1 (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) (subjectAnomalie1) (object http://www.owl-ontologies.com/mammonto.owl#Anomalie;) ) (triple (predicate http://www.owl-ontologies.com/mammonto.owl#contient_opacit_;) (subjectAnomalie1) (object Opacit_1) ) (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) (subjectOvale1) (object http://www.owl-ontologies.com/mammonto.owl#Ovale;) ) (triple (predicate http://www.owl-ontologies.com/mammonto.owl#__forme;) (subjectOpacit_1) (object Ovale1) ) so when I batch it and run it from java, it works properly, it gives me : compile: run: f-0 (MAIN::initial-fact) f-1 (MAIN::triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;)
Re: JESS: Using jess files
OAV triples. *Shudder.* Well, anyway, even at this level, there are various things you could do with these. But let's take the very simple view that John is just a symbol. After those rules are defined, the following code will deduce that Mary is John's daughter: ;; John has a child Mary (assert (triple (predicate http://a.com/ontology#hasChild;) (subject John) (object Mary))) ;; Mary is a Woman (assert (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) (subject Mary) (object http://a.com/ontology#Woman;))) ;; Run the rule engine; the rule will fire (run) You can then use the (facts) function in Jess to check that the hasDaughter fact has been asserted. I think ahmad Sayed wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hello, After transforming the SWRL from the ontologie to jess rules, I've obtained a rule list that looks like that : (defrule rule-6 (triple (predicate http://a.com/ontology#hasChild;) (subject?x) (object ?y) ) (triple (predicate http://www.w3.org/1999/02/22-rdf-syntax-ns#type;) (subject?y) (object http://a.com/ontology#Woman;) ) = (assert (triple (predicate http://a.com/ontology#hasDaughter;) (subject?x) (object ?y) ) Well, now how can I describe in java the following fact : John has a child , and the child is a woman ??? so that when I run the rete engine it can tells me that john has a daughter... If someone can write me a sample code, i'd be very gratefull. thank u [EMAIL PROTECTED] wrote: I think ahmad Sayed wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi there, After building my OWL ontology with its SWRL rules, I've transformed this knowledge base to jess in order to make some inferences over ontology individuals. So now i've got my 2 files ontology.jess and ontology.clp that I have to exploit them in a java application. However, I've hard time using them. Could someone bring me just a simple code on how to start over? (loading these files, parsing rules, and doing some simple inferences ) My Knowledge base looked like that (in SWRL, before converting it to jess) : SWRL rule-1: hasparent(?x, ?y) ^ hasbrother(?y,?z) --hasuncle(?x,?z) I need to make inferences like : hasparent(john,?y) ^ hasbrother (?y, michael) -- hasuncle (john, michael ) How can I do that? I don't know the SWRL syntax, specifically, but I'm assuming that this just says if someone has a parent, and the parent has a brother, that the brother is that someone's uncle. I don't know what you mean about your two files *.jess and *.clp; maybe one contains rules and the other contains facts? My answer to how you would make these inferences obviously depends strongly on what the rules and facts look like, but basically, you'd just assert facts that represented john, john's father, michael, and their known relationships, and run the engine. Presumably your rules would create new facts to represent their derived relationships, but again, that depends entirely on what you've got for rules. Then you might use a defquery to extract all the facts regarding john's relationships. - 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://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] - 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: using engine.undefinstance
I think Roger Studner wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] What is the 'advised' strategy for handling problems like this? A massive fact pool (like 400,000 facts) all at once, versus breaking it up. They are all javabeans. Same as it is in any computing environment, really: profile and improve. Before we decide what to do, we need to know where all the time is going. Are many, many rules firing? Is there a polynomial amount of pattern matching? Are you calling a slow (possibly external) function many times? Is something being recomputed that should be stored? You can make measurements with a regular Java profiler, and/or use Jess's watch command or JessListener facility to track what's happening in the Jess part of your program. - 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: Using jess files
I think ahmad Sayed wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi there, After building my OWL ontology with its SWRL rules, I've transformed this knowledge base to jess in order to make some inferences over ontology individuals. So now i've got my 2 files ontology.jess and ontology.clp that I have to exploit them in a java application. However, I've hard time using them. Could someone bring me just a simple code on how to start over? (loading these files, parsing rules, and doing some simple inferences ) My Knowledge base looked like that (in SWRL, before converting it to jess) : SWRL rule-1: hasparent(?x, ?y) ^ hasbrother(?y,?z) --hasuncle(?x,?z) I need to make inferences like : hasparent(john,?y) ^ hasbrother (?y, michael) -- hasuncle (john, michael ) How can I do that? I don't know the SWRL syntax, specifically, but I'm assuming that this just says if someone has a parent, and the parent has a brother, that the brother is that someone's uncle. I don't know what you mean about your two files *.jess and *.clp; maybe one contains rules and the other contains facts? My answer to how you would make these inferences obviously depends strongly on what the rules and facts look like, but basically, you'd just assert facts that represented john, john's father, michael, and their known relationships, and run the engine. Presumably your rules would create new facts to represent their derived relationships, but again, that depends entirely on what you've got for rules. Then you might use a defquery to extract all the facts regarding john's relationships. - 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: Help required in Jess
The Rete class is threadsafe but stateful. It is safe for multiple clients to share an instance, but in doing so, they will be sharing state. If you want multiple threads to share a single Rete object but keep their data separate, then their data has to be distinguishable. Every template used for client-specific data has to have a slot in which some kind of client-id is kept, and the rules need to be mindful of that client ID. Then the results for each client could be kept separate. In this scenario, it's best to use Rete.runUntilHalt() in a dedicated thread, so that the engine runs all the time. I think Dheeraj Kumar S wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, We are trying to build a small prototype using Jess which is webbased(Using servlet). We are having some 1000 Rules and scenario is multiple clients will be hitting this servlet to evaluate the rules and get the outcome from each rule based on the type of client. Now the problem is when multiple clients try to access this servlet , the 'rete' object is holding the state of the other client. basically it is not clearing the network to cater to other client request. We want to load the rule.clp file only once and still render to multiple client access. Plz let me know if we can do this without synchronizing the rete object. I mean we want multithreading. We are tryng to work on both Jess 6 and Jess 7 versions. Your help is very much appreciated. Kindly send me some code snippets if you any. Regards, dheeraj - 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: Cleanup problem
The listDefinstance() method iterates over a snapshot of working memory at the time it is called, so that changes from other threads (or from the same thread) don't break the iteration. Perhaps the object is still live and it's either running, or other threads are adding new definstances, while passivateObject is running? I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I am using a pool of Rete objects in my application, i've just discovered and issue where the my cleanup function seem to intermittently 'miss' a few definstances. Here's the Java code: -- public void passivateObject(Object object) throws Exception { // undef all the java stuff logger.debug(Passivating rete engine, removing all definstances and resetting); Rete engine = (Rete)object; Iterator i = engine.listDefinstances(); while (i.hasNext()) { Object instance = i.next(); logger.debug(Instance Type: + instance.getClass().getName()); engine.undefinstance(instance); } ((Rete)object).reset(); super.passivateObject(object); } -- With (watch all), I can see the instance facts being removed from working memory. However, for some reason sometimes the Iterator does not seem to get all of them. When the reset is called, I see the initial fact get asserted along with the 'missed' definstances. There doesn't seem to be much rhyme or reason with this issue, it happens from time to time but I can't seem to nail down why. Is Rete.listDefinstances() a reliable way to get all of my definstance facts ? 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]
Re: JESS: Eclipse 3.1.2
I think mdean77 wrote: Just updated from 3.1.1 to 3.1.2 and voila, the Jess plugins cease to load. No crash, just silence, but of course, cannot run apps that use Jess. Anyone else have this issue? I just tried the upgrade myself, and it worked OK, so I don't think there's a fundamental problem. The two things I would try would be first: start eclipse with the -clean command-line switch. If that doesn't work, then just re-install the Jess plugins. If that *still* doesn't work, then you could check out the startup error log and see if it says anything about the Jess plugins. - 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: Delete redundant / old facts
I think Bogdan Werth wrote: By the way is there in Jess anything to delete queries? undefrule doesn't work for queries as I've noticed. I also couldn't find anything in the book on this topic. It does in current versions of Jess (6.1p8, 7.0p5). It's possible that it may have not worked in some past version, but if so, that was a bug. - 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: saving facts
I think Donnelly wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Is there a way to save a list of facts using save-facts? It appears that the only selectivity is that you can save one type of fact. Ultimately, all that save-facts does is loop over all the facts and print the result of calling toString() on each one. You can do the same things yourself; something like (deffunction my-print-facts (?predicate) (foreach ?f ((engine) listFacts) (if (apply ?predicate ?f) then (printout t (?f toString) crlf The argument ?predicate is the name of a predicate function that returns TRUE if the fact should be printed. For example, you might use this to print all the odd-numbered facts: (deffunction odd-fact (?fact) (oddp (?fact getFactId))) Then you'd use this like (my-print-facts odd-fact) - 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: Question on defadvice
I think Lakshmi Vempati wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Ernest, I had assumed that the underlying functionality whether using Rete.reset or (reset) (likewise for Rete.clear() and (clear), Rete.run() and (run) ) was the same. It is. The implementation of the Jess language function for reset looks like (effectively) public Value call(ValueVector args, Context c) { c.getEngine().reset(); return Funcall.TRUE; } But advice is something that is applied by the Jess language interpreter to Jess language code; adding advice to a function means wrapping the Userfunction object that implements that function in another Userfunction that implements the advice. Then when a Jess language call to (reset) is made, the call goes through that outer Userfunction first, and then is passed along to the Userfunction shown above. By calling reset() from Java, you're doing an end run around all of that. Adding advice to a Userfunction has no effect whatsoever on the individual methods that are used in the implementation of that Userfunction, even is, as in this case, there is just one of them, and the names are the same. Are there any other subtle differences that would impact behavior in the jess environment? That is between using programmatic calls (methods defined in the Rete class) or equivalent command line syntax? This is a faulty question, really. You're assuming that there's a direct, one-to-one mapping between Jess functions and Java methods. In general, there isn't. - 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: Question on Modules+execution Control
I think Andreas Andreakis wrote: Maybe this could be an optimization in future Jess versions ? I mean why are you doing pattern matching to rules of Modules, which are not focused =? In most cases it would be a *deoptimization*, because the total amount of work done would go *up*. Remember that the Rete network is shared among all rules; if two rules in different modules have some conditions in common, in the current implementation, the matching will only be done once, and both rules will benefit. If we did as you proposed we'd have to do the work twice. Also note that if we deferred pattern matching until a module had focus, then changing focus could be a slow and expensive operation; it's fast now. Finally, there would have to be some potentially complicated exceptions for dealing with auto-focus rules, since their pattern-matching behavior would have to be different. All in all, I think things are better the way they are! - 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: persistent storage of facts and rules
I think Matthew Hutchinson wrote: g'day everyone, when it comes to sotrage of rules and facts, how are most people handling it? Are you using JessML? Also, has anyone been storing the JessML in a database? I don't think too many projects are using JessML yet, although I expect that many will after the final release. The specifics of the JessML language have still been changing a bit. Those installations that don't store rules in flat files often use Jess language rules stored in a VARCHAR column in a database. I know of many systems of this type. as far as facts are concerned, do y'all just store them in plain text files? i also noticed that the Rete object is serializable, is this feature used often? Most large applications use Java objects rather than native Jess facts, and those objects are stored in the usual ways, independent of Jess. But flat files (as are produced by save-facts) work well for plain facts. Rete's serializability is used by the bload/bsave commands, and it's also used by some mobile agent frameworks. In a few cases it's been used for web app clustering, although I think a Rete object is somewhat heavyweight to be put into a session. - 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: Question on defadvice
I think Lakshmi Vempati wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] I am trying to use defadvice (before reset and after clear) and I noticed the following problem: If reset (or clear) is invoked via a a programmatic call to the reset (or clear) method defined in the Rete class, it does not trigger the defadvice but if instead I execute either reset (or clear) on the command line or use the executeCommand method defined in the Rete class, it does trigger the defadvice. This is precisely how things should work. You're adding advice to the (reset) and (clear) functions in the Jess language; the functioning of the Rete.reset() and Rete.clear() Java methods is unaffected. If you want to execute some code every time Rete.reset() is called, you can register a JessListener with the Rete object. - 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: Logical dependency bug?
I'd call that a bug, yes. Thanks. I think Yura wrote: Don't know whether it's a bug but after (deffunction fun () (assert (b 2))) (defrule rule (logical (a))=(assert (b 1))) (defrule rule2 (logical (a))=(fun)) (assert (a)) (run) (retract 0) deletes only (a) and (b 1). (b 2) doesn't seem to have a logical dependency on (a). - 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: Finding fact the max/min slot value
I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hi, I am trying to figure out the best way to have a rule fire only for a fact whose slot value is the min or max of a group of facts. Match a negated pattern to the (nonexistent) fact in which some number is greater than the greatest value. (defrule biggest-number (number (value ?val)) (not (number (value ?val2:( ?val2 ?val = ) - 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: retract doesn't work like I want it to do
I think =?iso-8859-1?Q?H=FCbner?= wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Hello everybody, I need a hint from you. When I try to retract a fact, all other facts are reactivated. ... Can somebody tell me what's wrong with the code? You've got a bunch of rules with the pattern (not (repair ?)) When you assert a fact like (repair X), all these rules are deactivated. When you later retract the repair fact, all these rules are activated again. This is how things are supposed to work. If these rules are no longer relevant, then you have to make that explicit. You could use multiple modules, so that the rules that matter in each stage are in their own module, and the focus could be changed over time; or you can use a phase fact: a special fact that indicates which set of rules matter, and all the rules can match it as appropriate. - 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: Watch all - '1 ' inside defrule
I think Daniela CLARO wrote: MAIN::installer-barreaux-metallique: =1=1=1=1+t MAIN::installer-barreaux-metallique1: =1=1=1=1+t What actually this means for Jess? Internally, Jess breaks rules containing the or conditional element into multiple rules. In general, you shouldn't worry about it; it doesn't affect how you work with 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://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: ppdefrule doesn't make sense - is this a Jess 6.1 bug?
I think Hector Urroz wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Thanks for the response. It does seem a bit odd to automatically and silently modify code. Why not throw an exception? Is this done elsewhere in Jess? What is the rationale? Did I stumble onto a reserved rule name? Some rules get transformed in various ways as they are compiled -- for example, | connectives are actually transformed into or function calls, and ppdefrule will show them that way. And Jess inserts an initial-fact pattern in various situations; this is described in the manual. But I think this is only case where Jess inserts a pattern than matches a user template. As I recall, it was done for defensive reasons: because if Jess doesn't insert that pattern, then if people don't include it themselves (which is the right thing to do 99.99% of the time) there will be extra, spurious firings of the need-X rules, and I got tired of explaining why they were happening. - 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: JESS website
I think Vageesh Setty wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] Website seems to be down for a while.. is http://herzberg.ca.sandia.gov/jess/docs/70/programming.html right URL? It's OK now. Thanks. - 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: Checking for null/nil on the RHS
I think erich.oliphant wrote: [Charset iso-8859-1 unsupported, filtering to ASCII...] (if (eq ?effRate nil) then ;;(dts-log-error No effective rate found for (call com.ngc.dts.util.DateUtils formatDateTime ?pddate)) return ) That return is just the symbol return, not the function call (return). This symbol is the last expression in the if function call, so if is returning it, but otherwise, it's just being ignored. - 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: Problem with trial distribution
Several people have reported that there was a problem with the distribution file for the trial version (only) of Jess 7.0b5. The symptom is basically that the JessDE just doesn't work. The licensed download is unaffected. I've corrected the problem and posted a new binary. If you've been having trouble with the trial version (only), then downloading this new file should fix them. - 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: Help on the syntax of a rule.
I think ROSSEL, Olivier (CIMPA) wrote: I am using Jess with Protege. I want to write a rule that says: run when you get an oject FOO with a non-empty slot called 'name' and where there is no fact foo with property bar equal to the slot value. I would intuitively wirte that this way: (defrule doStuff ?o - (object (is-a FOO) (name ?name~nil)) (not (foo (bar ?name))) = ... ) Is it a correct syntax? There were some extra close-parentheses, which I've removed. I also added a not nil condition to meet the non-empty requirement, assuming that nil is the default value for that slot. Other than that's it's fine as far as I know -- whether it's actually correct or not depends on the object and foo templates. - 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: Which comes first, the chicken or the rule?
I think Matthew Hutchinson wrote: Just a conceptual question... since starting with Jess, it always seemed to me generally you have the rules established first, then load in facts which in turn trigger these rules. No problems there. But is it proper to consider having the facts already in memory and *then* adding rules which I know will trigger - basically a sort of query on the data mentality? Is this a bad concept? Jess will work either way; you can even add rules to a running program. But in general, Jess is designed with the rules, then facts paradigm in mind. For a given collection of facts and rules, defining the rules first, then populating working memory will be faster than doing thing the other way around -- but both ways are correct and will work fine. - 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]