I think John wrote: > > > (MAIN::object (is-a A) (OBJECT ?ab) (ID $?b "111" $?a)) > > However, when I use the variable $?a in the RHS, it gives me a error message > stating that, no such variable a.
You should be able to use it just fine; check your work, or show us the rule that's having the problem. > > I was stuck up with one more bug. Why does a slot-set in RHS of a rule > creates an infinite loop? This is a classic problem in rule-based systems. There are a number of solutions, although the better ones are specific to Jess 7. In Jess 6, the only thing you can do is modify the left-hand-side of the rule so that after you modify the fact, it won't match anymore. For example, if the right-hand-side modifies the "name" slot to be "John", then add to the pattern on the left-hand-side so it only matched is the "name" slot is not "John". In Jess 7, there is the no-loop declaration, which can be applied to rules to explicitly break this kind of loop; and there's the slot-specific declaration for templates, which breaks loops in which slots not matched on the left-hand-side are being modified on the right-hand-side. --------------------------------------------------------- Ernest Friedman-Hill Advanced Software Research 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] --------------------------------------------------------------------