Jess's language is Lisp-like, but it's not Lisp. Specifically, there is no notion of general nested lists. Jess's pattern-matching machinery is highly-tuned for specific kinds of patterns; you'll need to read the manual more closely to learn what kinds of structures are allowed.
To write an application like this, you'd need to choose a different representation for your expressions: strings, for instance, together with some regular expression functions (you could write Jess wrappers for the new java.regexp package.) I think TM Rao wrote: > As a learning exercise, I am trying to write a differentiation program > (on the > lines of LEIBNIZ in Tanimoto's AI book). > > I would like to assert: (differentiate x x) and receive an answer of 1. > Similarly, > (differentiate (power x 2) x) and receive (* 2 x) as the answer; etc. > > I try to write a rule such as > (defrule rule1 (differentiate ?X ?X) => (assert (answer 1)) > This seems to work OK. However, > (defrule rule2 (differentiate (power ?X ?N) ?X) => (assert (answer (* > ?N (power ?X (- ?N 1)))))) > doesn't work at all. > > I'd appreciate any help towards writing such rules. Thanks. > T.M. Rao > --------------------------------------------------------- Ernest Friedman-Hill Distributed Systems Research Phone: (925) 294-2154 Sandia National Labs FAX: (925) 294-2234 Org. 8920, MS 9012 [EMAIL PROTECTED] PO Box 969 http://herzberg.ca.sandia.gov Livermore, CA 94550 -------------------------------------------------------------------- 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] --------------------------------------------------------------------
