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
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$
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
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
@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