收到错误 RULECSRT3 的先前变量绑定
getting error RULECSRT3 Previous variable bindings of
从clips官方文档中我看到如下
"The restriction string for a function requiring exactly six arguments (of which the first must be a string, the third an integer, and the remaining arguments floats) is:
"66fsui" "
有人可以让我明白这是什么意思以及上述说法是如何有效的吗?
实际上,我在尝试将第 3 个参数从整数更改为字符串时遇到错误。之前 is_configured 采用“33iiii”,现在我将其更改为“33iisi”
这是代码
我已经改变了,以前它工作正常..工作代码我在下面的行中评论了它
(object (is-a VEHICLE)
(NUMBER 1)
(IDX ?ID_X)
(IDY ?ID_Y)
;; not using ID_Z in the call below and using STRING_Z
(IDZ ?ID_Z)
(STRINGZ ?STRING_Z)
)
=>
(if (is_configured ?ID_X ?ID_Y ?STRING_Z) then
;;(if (is_configured ?ID_X ?ID_Y ?ID_Z) then
(assert (ELIGIBLE_FOR_CALCULATION ?ID_X ?ID_Y ?ID_Z))
)
而C++代码是这样的
bool clips_is_configured()
{
DATA_OBJECT doTemp;
long id_x= 0;
long id_y = 0;
std::string string_z;
//long id_z = 0;
if (ArgCountCheck("is_configured", EXACTLY, 3) == -1)
return -1;
if (ArgTypeCheck("is_configured", 1, INTEGER, &doTemp) == 0)
return -1;
id_x = (long) DOToLong(doTemp);
if (ArgTypeCheck("is_configured", 2, INTEGER, &doTemp) == 0)
return -1;
id_y = (long) DOToLong(doTemp);
// if (ArgTypeCheck("is_configured", 3, INTEGER, &doTemp) == 0)
if (ArgTypeCheck("is_configured", 3, STRING, &doTemp) == 0)
return -1;
string_z = DOToString(doTemp);
//id_z = (long) DOToLong(doTemp);
bool x;
...........
// do some calulations based on above values and return bool
...........
return x;
}
我收到以下错误
[RULECSTR3] Previous variable bindings of ?ID_Y caused the type restrictions for argument #2 of the expression (is_configured ?ID_X ?ID_Y ?STRING_Z) found in the rule's RHS to be violated.
其实我给错了格式...正确的格式是“33iiis”
如果没有给出,第一个 i 表示参数的默认类型
第二个i表示第一个参数的类型
第三个i表示第二个参数的类型
第一个s表示第三个参数的类型
谢谢
从clips官方文档中我看到如下
"The restriction string for a function requiring exactly six arguments (of which the first must be a string, the third an integer, and the remaining arguments floats) is:
"66fsui" "
有人可以让我明白这是什么意思以及上述说法是如何有效的吗?
实际上,我在尝试将第 3 个参数从整数更改为字符串时遇到错误。之前 is_configured 采用“33iiii”,现在我将其更改为“33iisi”
这是代码 我已经改变了,以前它工作正常..工作代码我在下面的行中评论了它
(object (is-a VEHICLE)
(NUMBER 1)
(IDX ?ID_X)
(IDY ?ID_Y)
;; not using ID_Z in the call below and using STRING_Z
(IDZ ?ID_Z)
(STRINGZ ?STRING_Z)
)
=>
(if (is_configured ?ID_X ?ID_Y ?STRING_Z) then
;;(if (is_configured ?ID_X ?ID_Y ?ID_Z) then
(assert (ELIGIBLE_FOR_CALCULATION ?ID_X ?ID_Y ?ID_Z))
)
而C++代码是这样的
bool clips_is_configured()
{
DATA_OBJECT doTemp;
long id_x= 0;
long id_y = 0;
std::string string_z;
//long id_z = 0;
if (ArgCountCheck("is_configured", EXACTLY, 3) == -1)
return -1;
if (ArgTypeCheck("is_configured", 1, INTEGER, &doTemp) == 0)
return -1;
id_x = (long) DOToLong(doTemp);
if (ArgTypeCheck("is_configured", 2, INTEGER, &doTemp) == 0)
return -1;
id_y = (long) DOToLong(doTemp);
// if (ArgTypeCheck("is_configured", 3, INTEGER, &doTemp) == 0)
if (ArgTypeCheck("is_configured", 3, STRING, &doTemp) == 0)
return -1;
string_z = DOToString(doTemp);
//id_z = (long) DOToLong(doTemp);
bool x;
...........
// do some calulations based on above values and return bool
...........
return x;
}
我收到以下错误
[RULECSTR3] Previous variable bindings of ?ID_Y caused the type restrictions for argument #2 of the expression (is_configured ?ID_X ?ID_Y ?STRING_Z) found in the rule's RHS to be violated.
其实我给错了格式...正确的格式是“33iiis” 如果没有给出,第一个 i 表示参数的默认类型
第二个i表示第一个参数的类型
第三个i表示第二个参数的类型
第一个s表示第三个参数的类型
谢谢