简单的prolog程序在运行时返回“ERROR:toplevel:Undefined procedure”

时间:2015-02-19 21:51:13

标签: prolog

以下是代码:

bigger(elephant, horse).
bigger(horse, donkey).

is_bigger(X, Y) :-
   bigger(X, Y).
is_bigger(X, Y) :-
   bigger(X, Z),
   is_bigger(Z, Y).

它编译但后来我得到了这个

57 ?- bigger(elephant, horse).
ERROR: toplevel: Undefined procedure: bigger/2 (DWIM could not correct goal)
58 ?- is_bigger(horse, donkey).
ERROR: toplevel: Undefined procedure: is_bigger/2 (DWIM could not correct goal)

我做错了什么?

0 个答案:

没有答案