Lisp HUG Maillist Archive

RE: Multiple clauses in KW:FINDALL

Well, that's what I thought too. I initially used TEST and got the same
results (i.e. both instances, as in the example). Clearly I still don't
understand something...

dey

-----Original Message-----
From: Jason Trenouth [mailto:jason.trenouth@globalgraphics.com]
Sent: Wednesday, September 29, 2004 5:13 AM
To: Young, David
Cc: 'lisp-hug@xanalys.com'
Subject: Re: Multiple clauses in KW:FINDALL


Young, David wrote:

>Hi. I would like to query our kb using something similar to the following.
>Assume I have to kw instances of class FRODO, one with age = 30, the other
>with age = 60. I then evaluate:
>
>(kw:findall '?x '(and (frodo ?x age ?age) ((< ?age 50))))
>
>However, I clearly don't understand somthing about FINDALL, as the above
>query returns *both* instances rather than just one. What am I doing wrong?
>
>  
>
I think the (( ... )) syntax just means: run the Lisp code. The result 
is not used to control the Prolog backtracking. If you want the result 
to control the backtracking then I think you have to use (test ( ... )). ie
 

	(kw:findall '?x '(and (frodo ?x age ?age) (test (< ?age 50))))

__Jason


This email message is for the sole use of the intended recipients(s) and may contain confidential and privileged information of Bloodhound Software, Inc.. Any unauthorized review, use, disclosure is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.


Updated at: 2020-12-10 08:55 UTC