2

我正在尝试运行以下测试用例:

test :- assertz(abc : uvw(1)).

以上适用于 SWI-Prolog。但是我在使它在 ECLiPSe Prolog 中工作时遇到了问题。我收到以下错误:

trying to redefine an existing imported procedure in assertz(abc : uvw(1))

我没有导入 abc:uvw/1,它也不存在。周围的任何标志都允许在 ECLiPSe Prolog 中成功运行 test/0 吗?

最好的祝福

编辑: PS:以下措辞也不起作用:

test :- abc : assertz(uvw(1)).

然后一个只会收到以下错误消息:

lookup module does not exist in abc : assertz(uvw(1)) in module eclipse
4

1 回答 1

3

ECLiPSe 使用 @-annotation 为谓词指定上下文模块:

test :- assertz(uvw(1)) @ abc.

另见http://www.eclipseclp.org/doc/bips/kernel/control/A-2.html

于 2014-03-29T23:08:46.147 回答