ERROR: source_sink `' /Users...'' does not exist (Cannot compile prolog file)

ERROR: source_sink `' /Users...'' does not exist (Cannot compile prolog file)

我进入了

?- [' /Users/Alexis/Desktop/A10.pl ']

在 SWI Prolog REPL 上,出现以下错误:

    ERROR: source_sink `' /Users/Alexis/Desktop/A10.pl '' does not exist
    ERROR: In:
    ERROR:   [20] throw(error(existence_error(source_sink,' /Users/Alex/Desktop/A10.pl '),_4920))
    ERROR:   [15] '$load_file'(' /Users/Alexis/Desktop/A10.pl ',user,[expand(false),...]) at /Applications/SWI-Prolog.app/Contents/swipl/boot/init.pl:1951
    ERROR:    [7] <user>
    ERROR: 
    ERROR: Note: some frames are missing due to last-call optimization.
    ERROR: Re-run your program in debug mode (:- debug.) to get more detail. 

而且,无论我输入什么.pl文件,都会出现上面同样的错误。 .pl文件的目录是对的,就是编译不出来。我该如何解决这个问题?

您的问题是路径周围的空格。

?- [' /Users/Alexis/Desktop/A10.pl '] 将因该错误而失败。

?- ['/Users/Alexis/Desktop/A10.pl']不应该。