Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Lars Braubach
Hi, thanks for your reply Martijn. The solution should work but is also rather inefficient because all facts would have be stored twice. Maybe some Rete expert could argue, if such a rule could be expressed direcly in a rete network (not considering the specification language). If this is

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Wolfgang Laun
I would not use this rule provided I understood the problem correctly as: Find all facts foo where the length of foo.my-list equals the value of slot foo.desired. The proposed solution does not compare a length with foo.desired, and binding of a multislot vaue should use a variable starting with

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Ernest Friedman-Hill
Lars, If you think about it, there are only two ways to write a rule to react to the absence of data: 1) Remember what the data was, so you can compare the present situation to the previous situation; 2) Use a time machine, travel back in time, find out what the data used to be, then

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Wolfgang Laun
While reading the original posting I didn't (and I still don't) see the reason for the rules you're looking for. Somewhere in the system, there must be some action that adds or removes an element from the multislot list (perhaps using (modify)). There you know what is going on, and the old

RE: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Martijn Tromm
Lars, With activations and retractions I was thinking about something like this: For every object in (c (m a b c)) assert a separate relation-fact (object ?x) and keep a object-status template-fact for reference. Once an object gets asserted it will be remembered by a object-status fact with

Re: Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Alexander Pokahr
Dear all, I like the proposal of reifying the remove action as a separate fact. I haven't thought about that. But I would rather go for option #2 if possible, given that Jess already implements the kind of time machine required for that. It is called Rete network and can be activated by the

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Henrique Lopes Cardoso
There is a small bug in the 'actually-remove-things-from-c' rule: (remove ?c ?b?) should be (remove ?c ?x) Anyway, is 'do-something-when-something-gets-removed-from-c' guaranteed to fire? If 'actually-remove-things-from-c' fires before, then 'do-something-when-something-gets-removed-from-c' will

JESS: DJESS

2008-02-20 Thread Mohd. Noor
Hi all, In the DJESS - how often the working memory/fact/repository has to be replicated? How about if my the information that I am going to fire is always change- so this is means that my distributed information are also need to change. Rgds mnoor

RE: Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Martijn Tromm
It depends on whether you know a priori what objects can be added to the list if you can use a rule with a not-condition without extra facts (to be exact you need one: a fact with a list of all possible objects). Otherwise you need shadow-facts like I did in the previous example. Every piece of

Re: JESS: DJESS

2008-02-20 Thread Peter Lin
that's one of the performance limitations with full fact replication approach for distributed pattern matching. In a situation where a significant percent of the facts always change, the most optimal method is to replicate just the indexes. Most modern RETE implementation like JESS already index

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Wolfgang Laun
Martijn Tromm wrote: Lars, With activations and retractions I was thinking about something like this: For every object in (c (m a b c)) assert a separate relation-fact (object ?x) and keep a object-status template-fact for reference. Once an object gets asserted it will be remembered by a

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Jason Morris
Hi Hal, Peter Wolfgang, The proposed solution does not compare a length with foo.desired, and binding of a multislot vaue should use a variable starting with $?. Hal, since you said you were satisfied with Peter's solution, I never posted my reply which anticipated Wolfgang's almost verbatim.

JESS: Performance issues relating to rule structure. Jess Newbie

2008-02-20 Thread Caleb Corliss
Hi All, I am having an issue writing rules for an application that has some interesting requirements. Consider that we are categorizing say news feeds into specific categories based on specific rule matches (news article contains the fact NBA ,or NFL, or NHL, etc... so categorize as a

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Hal Hildebrand
Yes, I think the missing $ was the issue that was preventing this working. Will reformulate and try (should work). Thx. On Feb 20, 2008, at 3:28 AM, Wolfgang Laun wrote: I would not use this rule provided I understood the problem correctly as: Find all facts foo where the length of

Re: JESS: DJESS

2008-02-20 Thread Mohd. Noor
Thanks Peter, do you still holding the patent? :) Cheers mnoor On Wed, Feb 20, 2008 at 2:43 PM, Peter Lin [EMAIL PROTECTED] wrote: that's one of the performance limitations with full fact replication approach for distributed pattern matching. In a situation where a significant percent of

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Hal Hildebrand
I only posted an abstraction to figure out my problem, leaving out the other details. What I'm doing is essentially modeling workflow which manages to some target number of instances, so the fact in question is further qualified by other attributes as you have indicated. On Feb 20, 2008, at

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Wolfgang Laun
Another way (assuming that indeed a pair of facts with equal-length multislots is to be found): (defrule find-eql ?b1 - (bar (list $?l1)) ?b2 - (bar (list $?l2 :(= (length$ $?l1)(length$ $?l2 (test ( ?b1 ?b2)) = (printout t lists $?l1 and $?l2 have equal length crlf) ) This doesn't

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Ernest Friedman-Hill
On Feb 20, 2008, at 9:15 AM, Henrique Lopes Cardoso wrote: There is a small bug in the 'actually-remove-things-from-c' rule: (remove ?c ?b?) should be (remove ?c ?x) Thanks, yes. Anyway, is 'do-something-when-something-gets-removed-from-c' guaranteed to fire? If

RE: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Martijn Tromm
Wolfgang wrote: It seems that the object facts are retracted all right if some slot c.m is reduced, but this does not trigger the second rule. Why not? This certainly is the case in Haley's eclipse-rule engine (Eclipse is a derivative of Nasa Clips), which may be different on some points

JESS: Jess 7.0 peering question

2008-02-20 Thread Adair, John
I am adding a defTemplate to a Rete engine using engine.addDeftemplate, and when I subsequently instantiate a peer engine using new Rete(engine), the peer engine does not contain the defTemplate. Is this expected? John S.

Re: JESS: DJESS

2008-02-20 Thread Peter Lin
I should state, the work was the result of several years of research by Said Tabet and myself. To answer your question, both said and I are listed as the inventors. peter On Feb 20, 2008 10:25 AM, Mohd. Noor [EMAIL PROTECTED] wrote: Thanks Peter, do you still holding the patent? :) Cheers

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Peter Lin
sounds like the rule is handling join/fork from a BPM graph? On Feb 20, 2008 10:24 AM, Hal Hildebrand [EMAIL PROTECTED] wrote: I only posted an abstraction to figure out my problem, leaving out the other details. What I'm doing is essentially modeling workflow which manages to some target

Re: JESS: Rules for detecting changes of a multislot

2008-02-20 Thread Wolfgang Laun
Martijn Tromm wrote: Wolfgang wrote: It seems that the object facts are retracted all right if some slot c.m is reduced, but this does not trigger the second rule. Why not? Because ?os - (object-status (obj ?x) (status p)) contains a typo. Omit (status p) and it works fine.

Re: JESS: Matching on multi-slot length

2008-02-20 Thread Hal Hildebrand
Nothing so fancy :). All I'm currently doing is simply allocating new process instances based on a target number of instances - either adding or subtracting - on various hosts. Kind of a quick and dirty allocation scheme for a demo. On Feb 20, 2008, at 8:02 AM, Peter Lin wrote: sounds like

Re: JESS: How Jess handles the time elapsed from a particular event

2008-02-20 Thread Henrique Lopes Cardoso
I think you must time-stamp your facts (in an additional slot), and base your rules in those time-stamps. Henrique Marco Zappatore wrote: Dear Jess Developers, is there a way to compare the exact time at which two or more facts have been added to the working memory? For instance: -asserts

Re: JESS: How Jess handles the time elapsed from a particular event

2008-02-20 Thread Ernest Friedman-Hill
You have to make time explicit. Look at the FAQ (http:// www.jessrules.com/FAQ.shtml) for a simple rule that manages a clock fact, so your rules can know what time it is; then you need to add a slot to your templates to hold a timestamp. You could use the default- dynamic slot property to

JESS: RE: Jess 7.0 peering question

2008-02-20 Thread Adair, John
I am adding a deftemplate to a Rete engine using engine.addDeftemplate, and when I subsequently instantiate a peer engine using new Rete(engine), the peer engine does not contain the deftemplate. Is this expected? I misstated the problem. In the engine from which I am creating the peer, the

JESS: RE: Jess 7.0 peering question

2008-02-20 Thread Adair, John
Oh, no. Peering was added in 7.1, wasn't it? I just looked at the online doc chapter for Embedding in 7.0 and the section on peering isn't there. I am adding a deftemplate to a Rete engine using engine.addDeftemplate, and when I subsequently instantiate a peer engine using new Rete(engine),

Re: JESS: RE: Jess 7.0 peering question

2008-02-20 Thread Ernest Friedman-Hill
On Feb 20, 2008, at 2:12 PM, Adair, John wrote: I am adding a deftemplate to a Rete engine using engine.addDeftemplate, and when I subsequently instantiate a peer engine using new Rete(engine), the peer engine does not contain the deftemplate. Is this expected? I misstated the problem. In

Re: JESS: load-function problem

2008-02-20 Thread Marco Zappatore
Now, you say something about a warning, and so maybe you're talking about the JessDE? In that case, you need to make sure the Userfunction class is on the Java build path of your project so that the editor can find it. Yes, I'm using the JessDE plugin for Eclipse and I have such a hierarchy