Re: JESS: Fraction of RHS sometimes does not execute???

2008-02-13 Thread griesser
Thank you, it's working well now. It was easy to get rid of the double underscores, because all of my rules are generated by code. (I'm describing data transformations graphically in UML diagrams). The id slots were actually created to distinguish between otherwise identical facts when loadin

JESS: batch & require

2008-02-13 Thread Skeptic 2000
Hi,I'm having a problem when I batch two different .clp files that require the same third .clp file. File1.clp Some defclasses File2.clp require file1Some rules using file1 defclasses File3.clp require file 1 Some other rules using file1 defclasses rete.batch(file2); rete.batch(file3);

Re: JESS: Checking list equality

2008-02-13 Thread Henrique Lopes Cardoso
Yes, I had noticed that. Thank you all. By the way, is it heavy to have such a test in a rule's LHS? Let me be more specific. I am trying to make a kind of "refraction" across multiple rules. The point is to prevent two rules from firing on the same facts. For this I use a special ordered fact "r

Re: JESS: Checking list equality

2008-02-13 Thread Wolfgang Laun
Given the precondition (as Henrique wrote) that the lists are sets you don't have to consider the general case. -W Szymon Klarman wrote: Yes but this function won't do the job in general. Consider: list1 = (1 1 2), list2 = (2 2 3), (union$ list1 list2) = (1 2 3) Better to check whether inter

Re: JESS: Checking list equality

2008-02-13 Thread Szymon Klarman
Yes but this function won't do the job in general. Consider: list1 = (1 1 2), list2 = (2 2 3), (union$ list1 list2) = (1 2 3) Better to check whether intersection of the two lists have the same length as their union. all best, Szymon - Original Message - From: "Wolfgang Laun" <[EMAIL

Re: JESS: Checking list equality

2008-02-13 Thread Wolfgang Laun
You can apply (=) to more than 2 arguments. (= (length$ ?list1) (length$ ?list2) (length$ (union$ ?list1 ?list2))) kr Wolfgang Henrique Lopes Cardoso wrote: Hi, I was trying to test equality for lists seen as sets (elements with any order). Is there any direct function, or any solution simpl

JESS: Checking list equality

2008-02-13 Thread Henrique Lopes Cardoso
Hi, I was trying to test equality for lists seen as sets (elements with any order). Is there any direct function, or any solution simpler than this: (bind ?list1 (list 1 2 3)) (bind ?list2 (list 3 2 1)) (and (= (length$ ?list1) (length$ ?list2)) (= (length$ (union$ ?list1 ?list2)) (length$ ?lis