我正在學習使用SWI-Prolog的Prolog。 這裏是文件fact.pl
我的實踐代碼:簡單的Prolog析因程序加載
factorial(N,F) :- N is 0, F is 1;
N > 0, M is N - 1, factorial(M,G), F is N*G.
當我試圖用[fact.pl]
加載該文件,解釋給我下面的錯誤:
?- [fact.pl].
ERROR: Syntax error: Operator expected
ERROR: [fact
ERROR: ** here **
ERROR: .pl] .
我不知道如何發生了,我很確定我所做的是標準程序加載命令。
任何人都見過這個請幫忙,謝謝。