w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
CLIPS Programming Language.Error removing clips.help me

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:

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

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

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

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.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.