Prolog gives error “undefined procedure” when trying to use :-

谁说我不能喝 提交于 2019-12-04 00:15:57

The FAQ says it all: http://www.swi-prolog.org/FAQ/ToplevelMode.html

You need to create a file and write your program with rules there. The top level command line will only allow you to issue queries.

You can try it this way

1 ?- assert(a(A,B):-A=B).
true.

2 ?- a(B,c).
B = c.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!