I think Jeremic Zoran wrote:
>
> (defquery find-questions
> (declare (variables ?currConc ?group ?diffLev))
> (question (conceptID ?a&: (eq ?a ?currConc)) (group ?b&: (eq ?b ?group))
> (difficultyLevel ?c&: (eq ?c ?diffLev)) )
> )
> Could you help me to solve this problem?
First of all, Aaaaaargh! Why do people insist on writing code like
this? Never, ever write something like
(difficultyLevel ?c&: (eq ?c ?diffLev))
when the equivalent but much more efficient and much easier to read
form
(difficultyLevel ?diffLev)
would work just fine! Your very long, ugly query could be vastly
simplified by writing it this way. I don't understand why we're seeing
so much code like this on the list lately.
Now, you don't explain what you mean exactly, but I think you're
saying you want to query to match only questions for which there isn't
already a corresponding passed_question fact -- i.e., one where the
two ID slots match. To do this, just use a "not" CE and match the
passed_question fact that you want to not exist:
(defquery find-questions
(declare (variables ?currConc ?group ?diffLev))
(question (conceptID ?currConc) (group ?group)
(difficultyLevel ?diffLev) (ID ?id))
(not (passed_question (ID ?id))))
---------------------------------------------------------
Ernest Friedman-Hill
Science and Engineering PSEs Phone: (925) 294-2154
Sandia National Labs FAX: (925) 294-2234
PO Box 969, MS 9012 [EMAIL PROTECTED]
Livermore, CA 94550 http://herzberg.ca.sandia.gov
--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------