sitelogo
構文
MINERVA superseeded IF/Prolog. Please see http://www.ifcomputer.co.jp/MINERVA for details.

We discontinued to sell IF/Prolog Dec 31. 2003. For current customers, we continue to provide professional support for IF/Prolog until Dec 31, 2008.

PrologのISO標準をサポートするために、IF/Prologにいくつかの変更点が施されました。

演算子をアトムとして用いる場合には、カッコの中に入れなければなりません。

?- A = (+), B = 2, C = 5, Pred =.. A,B,C ,Result is Pred.

A = (+) B = 2 C = 5 P = 2 + 5 Result = 7 ?-

項の引数として`,'より高い優先順位を持つ演算子が使われる場合には、項はカッコの中に入れなければなりません。

[user]. test((Head :- Body)) :- call(Body),asserta(Head). end of file. consult: file stdin loaded in 30 sec

yes ?- test((a :- write(a),nl,flush)). a

yes ?-

数値は、「基数'数」という表記法を採ることができます。 基数として、1から16まで採ることができます。

?- 16'3F == 10'63.

yes ?-

文字定数は 0'char'として定義されます。

?- 0' ' == 32.

yes ?-

構文エラーの検索、表示が、4.0バージョンにて改良されました。エラーの行、コラム番号が表示されます。

?- qwert().

line 3, column 7, syntax error: start of term expected

1節の中で(`_'で始まる名前以外の)変数名が1度だけ使用されている場合には、警告がでます。また、節の定義がコラム1から始まっていない場合、また、節のボディがコラム1から始まっている場合には、`.'の使い方の誤りが検出されます。

?- [user] . a(B,C):- B. "stdin", line 11, syntax warning: single variable: 'C'

次のファイルをコンサルトすると...

a:- b. c. a:- d, f.

以下の警告が表示されます。

ifprolog -c tmp "tmp", line 2, syntax warning: clause doesn't start at first column "tmp", line 4, syntax warning: subterm starts at first column consult: file tmp loaded in 0 sec. IF/Prolog Version 4.0 ....


戻る 続く..
冒頭へ managed with ubiCMS