% ISO Compliance : test additional predicates
% by N.T. Hashimoto, (C) SOFNEC, Co., Ltd.
% 2Dec2011, updated on 

AZ-Prolog ver.6.xxからの変更点

(1)仕様変更

atomic/1 : アトムか数値なら成功
floor/1 : 返却値を整数
(/)/yfx : 返却値を実数
mod/yfx : 優先順位番号を400。データ型を yfx。
          mod(X,Y) :- integer(X) - integer(Y)*floor(X/Y)
^/xfy (not ISO): 指数に実数も可
(\)/fy : データ型をfy。演算子登録(fy/200)。
-/fy : 優先順位番号を200。データ型をfy
:/xfy : 優先順位番号を550
@<, @>, compare/3などの項の比較 : 
                未代入の変数 < 実数 < 整数 < 複合項 


(2)新規追加

関数子、演算子
------------------------------------------------------------
\=/xfx, 700				項がユニファイできないとき成功
+/fy, 200 (not ISO)		+の符号を付加
**/xfx, 200				指数演算
rem/yfx, 400			整数の除算の余り
(//)/yfx, 400			整数の除算
truncate/1				切り捨て
ceiling/1				切り上げ
round/1					小数点以下を四捨五入
float_integer_part/1	整数部を実数値で取得
float_fractional_part/1	小数部を取得
abs/1					絶対値
sign/1					整数値の符号、または実数値そのもの

pi/0 (not ISO)			円周率
log/2 (not ISO)			対数の基底を実数値で指定
min/2 (not ISO)			より小さい値を取得
max/2 (not ISO)			より大きい値を取得
gcd/2 (not ISO)			最大公約数
random/0 (not ISO)		0より大きく1未満の乱数発生
random_seed/1 (not ISO)	乱数のシードを指定

組込述語
-----------------------------------------
abolish/1
once/1
retractall/1
ensure_loaded/1
atom_codes/2
atom_chars/2
number_chars/2
findall/3
get_char/1/2
current_input/1
current_output/1
set_input/1
set_output/1
open/3
close/1
current_predicate/1
set_prolog_flag/2 (only for unknown flag) 
current_prolog_flag/2 (only for unknown flag)
copy_term/2
sub_atom/5
member/2 (not ISO)
append/3 (not ISO)
uppercase_atom/2 (not ISO)
lowercase_atom/2 (not ISO)
downcase_atom/2 (for SWI-Prolog)
term_to_atom/2 (not ISO for SWI-Prolog)


(3)ISO準拠のため既存の組込述語の別名で対応

ISO predicates		AZ-Prolog Ver.7.xx
-----------------------------------------
number_codes/2		name/2
atom_concat/3		atom_append/3
get_code/1			get1/1
get_code/2			get1/2
put_code/1			put/1
put_code/2			put/2
put_char/1			write/1
put_char/2			write/2
write_canonical/1	display/1
flush_output/0		s_flush/0
close/1				told/1
current_char_conversion/2	current_char_conv/2
atom_length/2		atom/2
term_to_atom/2		term_atom/2


(4)例外およびエラー表示

\system\PL\ERORR.PLへの追加

    番号  メッセージ
--------------------------------------------
err( 22,'Evaluation error: zero_divisor').
err( 35,'Instantiation error').
err( 36,'Type error: integer expected').
err( 37,'Type error: float expected').
err( 38,'Type error: number expected').
err( 39,'Type error: not evaluable').
err( 40,'Evaluation error: float_overflow').
err( 41,'Evaluation error: int_overflow').
err( 42,'Evaluation error: undefined').
err( 43,'Evaluation error underflow').
err( 44,'Evaluation error: random seed not initialized').
err( 45,'Type error: predicate_indicator expected').
err( 46,'Type error: character expected').
err( 47,'Type error: atom expected').
err( 48,'Type error: list expected').
err( 49,'Type error: variable expected').
err( 50,'Type error: byte code expected').



