当我想在ECLiPSe-CLP中运行此代码时,出现以下错误
Error:
string stream 27: syntax error: postfix/infix operator expected
| 4 $= X^2 + Y^2, (Error Mark is under '=')
|
代码:
circles(X, Y) :-
4 $= X^2 + Y^2,
4 $= (X - 1)^2 + (Y - 1)^2,
X $>= Y.
答案 0 :(得分:0)
$=/2
运算符/谓词是一个库谓词。您是否正在加载定义库?例如
[eclipse 12]: lib(ic).
...
Yes (0.12s cpu)
[eclipse 13]: [user].
circles(X, Y) :-
4 $= X^2 + Y^2,
4 $= (X - 1)^2 + (Y - 1)^2,
X $>= Y.
^Dtty compiled 4024 bytes in 0.00 seconds
Yes (0.00s cpu)
[eclipse 14]: circles(X, Y).
X = X{-1.0000000000000004 .. 2.0000000000000004}
Y = Y{-1.0000000000000004 .. 2.0000000000000004}
There are 13 delayed goals. Do you want to see them? (y/n)