CLIPS fails the test program "test.clp". (as RESULT below).
---- test.clp ----
(defclass FOO::DUMMY (is-a USER)
(import FOO ?ALL)
(defclass BAR::BAR (is-a USER)
(slot bar (allowed-classes DUMMY))
(make-instance b of BAR
(bar (make-instance f of DUMMY))
---- RESULT ----
CLIPS (6.30 8/15/11)
CLIPS> (load test.clp)
Defining defmodule: FOO
Defining defclass: DUMMY
Defining defmodule: BAR
Defining defclass: BAR
Defining deffunction: bar
[CSTRNCHK1] [FOO::f] for slot bar of instance [b] found in put-bar primary in class BAR
does not match the allowed classes.
[PRCCODE4] Execution halted during the actions of message-handler put-bar primary in class BAR
[PRCCODE4] Execution halted during the actions of deffunction bar.
I think this behaviour is curious, because the deffunction BAR::bar failed to find FOO::DUMMY,
nevertheless the defclass BAR::BAR can find it.
One solution is to modify cstrnchk.c.
444: cmpClass = (DEFCLASS ) LookupDefclassByMdlOrScope(theEnv,ValueToString(tmpPtr->value));
445:// cmpClass = (DEFCLASS ) EnvFindDefclass(theEnv,ValueToString(tmpPtr->value));
It is preferable for me the dynamic constraint checking can recognize the classes imported form other modules.
A fix has been checked into the repository.
I hava comfirmed it with r190.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.