$ cat junk.pl
test(ok).
$ prolog
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.8.0)
Copyright (c) 1990-2009 University of 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.
For help, use ?- help(Topic). or ?- apropos(Word).
?- [junk].
% junk compiled 0.00 sec, 24 bytes
true.
Кажется, у меня все хорошо. Конечно, я использую атом для моего имени файла, а не переменную. (KB5 - это имя переменной, а не атома.) Сначала попробуйте ['KB5']
и посмотрите, поможет ли это. Затем попробуйте [kb5]
и посмотрите, поможет ли это. Наконец, попробуйте абсолютно минимальный пример, подобный приведенному мною, и посмотрите, сможете ли вы загрузить его таким образом.
Отредактировано, чтобы добавить:
$ cp junk.pl JUNK.pl
$ prolog
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.8.0)
Copyright (c) 1990-2009 University of 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.
For help, use ?- help(Topic). or ?- apropos(Word).
?- [JUNK].
ERROR: load_files/2: Arguments are not sufficiently instantiated
?- ['JUNK'].
% JUNK compiled 0.00 sec, 1,656 bytes
true.
Похоже, проблема атома действительно. Используйте ['KB5']
, и ваша ошибка, вероятно, исчезнет.