$ 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.
Wydaje się, że działa dobrze dla mnie. Oczywiście używam atomu dla mojej nazwy pliku, a nie zmiennej. (KB5 to nazwa zmiennej, nie atom.) Najpierw spróbuj ['KB5']
i sprawdź, czy to pomaga. Następnie spróbuj [kb5]
i sprawdź, czy to pomaga. Na koniec spróbuj bezwzględnie minimalnego przykładu, takiego jak ten, który dostarczyłem i zobacz, czy możesz załadować w ten sposób.
Edited by dodać:
$ 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.
Wygląda problemu atomu rzeczywiście. Użyj ['KB5']
, a Twój błąd prawdopodobnie zniknie.