why this code cannot be run?what is "syntax error: postfix/infix operator expected" error in ECLiPSe-clp
why this code cannot be run?what is "syntax error: postfix/infix operator expected" error in ECLiPSe-clp
当我想在 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.
$=/2
operator/predicate 是库谓词。您是否正在加载定义它的库?例如
[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)
当我想在 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.
$=/2
operator/predicate 是库谓词。您是否正在加载定义它的库?例如
[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)