Re: JESS: Checking list equality

2008-02-14 Thread Ernest Friedman-Hill
On Feb 13, 2008, at 1:01 PM, Henrique Lopes Cardoso wrote: (defrule r1 ?b1 - (some-fact) ?b2 - (some-other-fact) (not (rule-fired-on $?b-list:(equal-lists? ?b-list (list ?b1 ? b2 = (assert (rule-fired-on ?b1 ?b2)) (printout t r1 fired on ?b1 ?b2 crlf) ) Is this

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$

Re: JESS: Checking list equality

2008-02-13 Thread Szymon Klarman
PROTECTED] To: jess-users@sandia.gov Sent: Wednesday, February 13, 2008 3:16 PM Subject: Re: JESS: Checking list equality You can apply (=) to more than 2 arguments. (= (length$ ?list1) (length$ ?list2) (length$ (union$ ?list1 ?list2))) kr Wolfgang Henrique Lopes Cardoso wrote: Hi, I

Re: JESS: Checking list equality

2008-02-13 Thread Wolfgang Laun
intersection of the two lists have the same length as their union. all best, Szymon - Original Message - From: Wolfgang Laun [EMAIL PROTECTED] To: jess-users@sandia.gov Sent: Wednesday, February 13, 2008 3:16 PM Subject: Re: JESS: Checking list equality You can apply (=) to more than 2

Re: JESS: Checking list equality

2008-02-13 Thread Henrique Lopes Cardoso
@sandia.gov Sent: Wednesday, February 13, 2008 3:16 PM Subject: Re: JESS: Checking list equality 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