Question

What error problem?

ERROR-1: [ARGACCES5]function >= expected argument #2 to be of type integer or float. ERROR-2: [CSTRCPSR1] expected the begining of a contrust.

How to fix this error?

No correct solution

OTHER TIPS

For the first error, you're passing a non-numeric argument as the second argument into the >= function. When an error occurs within a construct, CLIPS will show you what's been parsed to help you locate the problem:

CLIPS> 
(defrule example
   (test (>= 3 a))
   =>)
[ARGACCES5] Function >= expected argument #2 to be of type integer or float

ERROR:
(defrule MAIN::example
   (test (>= 3 a)
CLIPS> 

Typically the second error occurs when you have an extra or missing parenthesis when loading constructs. For example, if you create a file named example.clp with the following contents:

(defrule example-1 =>)
(defrule example-2 =>)
) ; Extra parenthesis
(defrule example-3 =>)
(defrule example-4 =>) 

You'll get this error when you try to load it:

CLIPS> (watch compilations)
CLIPS> (load "example.clp")
Defining defrule: example-1 +j+j
Defining defrule: example-2 +j

[CSTRCPSR1] Expected the beginning of a construct.
Defining defrule: example-3 +j
Defining defrule: example-4 +j
FALSE
CLIPS> 

If you're watching compilations, you can get a better idea of where the error is occurring. In this case it's between the rules example-2 and example-3.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top