EDIT
Ich habe einige mehr Forschung. Anscheinend ist dies das, was SWI-Prolog tut, wenn Sie es nach einer uninstantiierten Variablen fragen.
$ prolog
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.6.64)
Copyright (c) 1990-2008 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).
?- X.
% ... 1,000,000 ............ 10,000,000 years later
%
% >> 42 << (last release gives the question)
?-
UPDATE
den Namen in Klein Werke ändern. Versalien ist für Variablen:
helloworld.prolog:
helloworld:-write('Hello World!'),nl,fail.
Dann:
$ prolog
Welcome to SWI-Prolog (Multi-threaded, 64 bits, Version 5.6.64)
Copyright (c) 1990-2008 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).
?- ['helloworld.prolog'].
% helloworld.prolog compiled 0.00 sec, 1,376 bytes
true.
?- helloworld.
Hello World!
false.
?-
Beachten Sie, dass Sie die Datei zuerst zu konsultieren. Ich habe es ausprobiert und es funktioniert mit Sicherheit.
Übrigens ist diese "Fehlermeldung" ein Verweis auf Per Anhalter durch die Galaxis. – tloflin
Ich weiß. Ich liebe diese Bücher, aber ich finde diese Botschaft ziemlich dumm. Es ist ein erzwungener und verschleiernder Witz. – andandandand
Lustig obwohl :) –