0

次のコードは swi-prolog で機能します。

:- asserta(user:file_search_path(money, '/media/D/db')).
dataFile(F) :-
absolute_file_name(money('test.dat'), F, []).

gprolog にはモジュールがないようです。gprolog で動作させるにはどうすればよいですか?

心から!

4

1 に答える 1

0

あなたは十分な詳細を提供していませんが、問題は演算子であると推測します ' :- ' ' initialization/1 'で試してください

$ cat > file.pl

initialization(asserta(user:file_search_path(money, '/media/D/db'))).
dataFile(F) :- absolute_file_name(money('test.dat'), F, []).
^d

$ gprolog --init-goal "['file.pl']"
compiling /Users/user/file.pl for byte code...
/Users/user/file.pl compiled, 2 lines read - 763 bytes written, 8 ms
GNU Prolog 1.4.1
By Daniel Diaz
Copyright (C) 1999-2012 Daniel Diaz
| ?- 

これが機能することを願っています…</p>

于 2013-03-02T05:06:07.490 に答える