如果我在 Prolog 中尝试下一个查询,我会收到一个错误...
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 6.4.1)
Copyright (c) 1990-2013 University of Amsterdam, VU Amsterdam
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.
Please visit http://www.swi-prolog.org for details.
?- conc([a,b], [c,d], [a,b,c,d] ).
ERROR: toplevel: Undefined procedure: conc/3 (DWIM could not correct goal)
这是因为我没有将事实和规则加载到单独的文件中吗?因为这看起来很奇怪。例如,下一个查询确实有效:
?- member(apple, [apple, broccoli, crackers]).
true .