Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Prolog でテキスト ファイルからデータを読み取るにはどうすればよいですか? SWI-prolog でファイルを読み込む例はありますか?
readfacts:- open('example.txt',read,In), repeat, read_line_to_codes(In,X),writef(" "), writef(X),nl, X=end_of_file,!, nl, close(In).
Prologには多くの入出力述語があり、2つのカテゴリーに分類されます。新しいISOのもの、またはエジンバラとDEC10バージョンと互換性のある古いものです。サンプルコードを含む完全な詳細については、上記のリンクに続くリファレンスマニュアルを参照してください。