PrologのISO標準をサポートするために、IF/Prologにいくつかの変更点が施されました。...
Move to
Next Prev
Up Top
See also
構文
新しいIF/Prologコンパイラ
ガーベジ・コレクション
信号処理
ストリーム
モジュール
新しい述語
インタフェースの変更
OSF/Motifインタフェース
文法規則
バージョン3との互換モード
IF Computer > IF/Prolog > Manuals > IF/Prolog V4.1 マニュアル > イントロダクション > IF/Prolog 4.0のレリースノート > 構文

構文

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 ....

read on...
IF/Prolog by Siemens
Language
English
Japanese
German
Server
USA
Japan
Site Access
Local Index
Local Contents
Site Contents
Site Index
Printer Friendly
For imode
For PDA
Search
document: http://www.ifcomputer.co.jp/IFProlog/Manuals/v4.1/introduction/rel4.0/syntax/home_en.html
published 2008/5/12 update 1995/10/13 (c) 1996-2006 IF Computer Japan
IF Computer 5-28-2 Sendagi, Bunkyo-ku Tel +81-3-5814-3352 info@ifcomputer.com
Customer Support Tokyo 113-0022 Japan   http://www.ifcomputer.com
scroll to top managed with ubiCMS