转载自:https://mp.weixin.qq.com/s/DgFxF1Rj4HN13LzRmMgeEw
?- ls. //列出当前目录的所有文件
//请体会下面的正确命令
?- ['kb2.pl'].
true.
?- ['kb2'].
true.
?- [kb2].
true.
?- edit(kb2).
% Waiting for editor ...
% Running make to reload modified files
% Updating index for library /usr/local/Cellar/swi-prolog/HEAD-f5d97ff_1/libexec/lib/swipl/library/
true.
?- edit('kb2').
% Waiting for editor ...
% Running make to reload modified files
% Updating index for library /usr/local/Cellar/swi-prolog/HEAD-f5d97ff_1/libexec/lib/swipl/library/
true.
?- edit('kb2.pl').
% Waiting for editor ...
% Running make to reload modified files
% Updating index for library /usr/local/Cellar/swi-prolog/HEAD-f5d97ff_1/libexec/lib/swipl/library/
true.
?- edit(printActors).
Warning: Cannot find anything to edit from "printActors"
Warning: Use edit(file(printActors)) to create a new file
false.
?- edit(file(printActors)).
% Waiting for editor ...
% Running make to reload m