I think Jeremic Zoran wrote:

> (defrule check_concept_new
...
> (test   (and (and    (<= ?mKnLev ?sKnLev)  (neq  ?cID ?caipID) ) (not (and (concepts 
> (ID ?cID) (prerequisite $?first ?one $?rest)) (not (passed_concepts (ID ?one)))))))
...

> ERROR in addStudentData function, JessException.getmessage : Unimplemented function
> ERROR addStudentData function, JessException.getContext :
>  while executing (concepts (ID ?cID) (prerequisite ?first ?one ?rest))
>  while executing (and (concepts (ID ?cID) (prerequisite ?first ?one ?rest)) (not 
> (passed_concepts (ID ?one))))
>  while executing (not (and (concepts (ID ?cID) (prerequisite ?first ?one ?rest)) 
> (not (passed_concepts (ID ?one)))))
>  while executing (and (and (<= ?mKnLev ?sKnLev) (neq ?cID ?caipID)) (not (and 
> (concepts (ID ?cID) (prerequisite ?first ?one ?rest)) (not (passed_concepts (ID 
> ?one))))))
>  while executing 'test' CE


The "test" CE is a way of putting function calls on the LHS of a
rule. If you put instead patterns inside a test, then you get a stack trace
like the above, with Jess telling you "unimplemented function" and
showing that it was trying to invoke a pattern (here "(concepts)") as
if it were a function call.

The solution is simply not to put patterns inside "test" -- the whole
"(not (and (concepts ...)" tree should be outside the "test".

Note that there are two different "and"s, two different "not"s, and
two different "or"s in Jess; one of each pair groups patterns on the
LHS of a rule, and the other is a logical function that can group
boolean functions. Unfortunately they look exactly the same, and only
the context decides which is intended.  You've got some of both mixed
up together above, and that's obviously part of the confusion.



---------------------------------------------------------
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]
--------------------------------------------------------------------

Reply via email to