-2
(defrule amphibian "" 
(water-aniaml yes)
(aquatic yes)
(eats-instencts no)
(not(guess ?))
=>
(assert (guess("guess not amphibian"))))

    (defrule skin-dddeceptionn "" 
(water-aniaml yes)
(aquatic yes)
(eats-instencts yes)
(has-four-legs yes)
(has-long-tongue yes)
(can-jump yes)
(has-poison no)
(skin-deception yes)
(not(guess ?))
=>
(assert (guess( "guess it's european common toad frog"))))

**I got this error
[PRNTUTIL2] Syntax Error: Check appropriate syntax for defrule. ERROR: (defrule MAIN::not-skin-ddeceptionn "" (or (water-aniaml yes) (aquatic yes) (eats-instencts yes) (has-four-legs yes) (has-long-tongue yes) (can-jump yes) (has-poison no) (skin-deception no) (not (guess ?)) => **


whats wrong , i tried to use or but it's still error with (or) and without(or) how can i solve this problem >>????? please help ?!!!

1 Answers1

0

If entire rule is not displayed in the error message, then the last token displayed is usually the cause of the error message:

CLIPS> 
(defrule amphibian "" 
   (water-aniaml yes)
   (aquatic yes)
   (eats-instencts no)
   (not(guess ?))
   =>
   (assert (guess("guess not amphibian"))))

[EXPRNPSR1] A function name must be a symbol

ERROR:
(defrule MAIN::amphibian ""
   (water-aniaml yes)
   (aquatic yes)
   (eats-instencts no)
   (not (guess ?))
   =>
   (assert (guess ("guess not amphibian"
CLIPS> 

In this case, the last token displayed is "guess not amphibian". Because you placed a left parenthesis before this token, CLIPS thinks it's a function call. Since function names are symbols rather than strings, the string "guess not amphibian" is an invalid function name and you get the error message "[EXPRNPSR1] A function name must be a symbol".

Removing the extraneous parentheses from your rule will correct the problem:

CLIPS> 
(defrule amphibian "" 
   (water-aniaml yes)
   (aquatic yes)
   (eats-instencts no)
   (not(guess ?))
   =>
   (assert (guess "guess not amphibian")))
CLIPS>
Gary Riley
  • 10,130
  • 2
  • 19
  • 34
  • Does it work for you when you enter the corrected rule at the command prompt? If so, then you need to provide more details about what you did to cause the error to occur. You've shown the code for two rules with errors, amphibian and skin-dddeceptionn, and the error message you reference is for a third: not-skin-ddeceptionn. That's confusing the issue. – Gary Riley May 12 '15 at 22:58