MINERVAの新しい算術関数は、内蔵関数と全く同じように使用することが...
移動
次へ 前へ
上へ 最上
参考
呼び出し
述語
指令
算術計算
関数
オブジェクト
エラーメッセージ
ファイル名
main
パッケージ
デバッガー
国際文字対応
GUIプログラミング
MINERVAからJavaへのインタフェース
JavaからMINERVAへのインタフェース
制限事項
イフコンピュータ > MINERVA > マニュアル > レファレンス > 算術計算

算術計算

MINERVAの新しい算術関数は、内蔵関数と全く同じように使用することが できます。

算術表現の関数表記と関係を示す表記の両方の表記が可能です。

MINERVAの数値を求める述語について、 例えば、is/2 を例に挙げて考えます。 "Result = f(A,...,N)" のような関数は、 "f(A,...,N,Result)" の述語の探索として行なわれます。

これにより、MINERVAによる数式は、 計算途中の値を保持するための変数の記述を省略することができ、 理解しやすくなっています。

% example: compute the cost for industrial urethane foam

% notation as relations a(Price) :- height(H), width(W), depth(D), unit_price_per_volume(U), Price is H * W * D * U.

% notation as functions

b(Price) :- Price is height * width * depth * unit_price_per_volume.

% uniform notation of functions resp. data base

height(6). depth(38). width(75). unit_price_per_volume(0.01).

上のプログラムの結果は以下の通りです。

?- a(Price).

Price = 171.0

yes

?- b(Price).

Price = 171.0

yes

?-

続く..
MINERVA
ifcomputer logo
f
Expert Services on the Web
言語
English
Japanese
サーバー
USA
Japan
サイトマップ
索引
目次
全体目次
全体索引
印刷向き
imode
PDA
探索
document: http://www.ifcomputer.co.jp/MINERVA/Manual/Reference/Arithmetic/home_jp.html
published 2008/5/12 update 2002/3/20 (c) 1996-2006 IF Computer Japan
IF Computer 〒113-0022 Tel 03-5814-3352 ifcj@ifcomputer.co.jp
Customer Support 東京都文京区千駄木5-28-2   http://www.ifcomputer.co.jp
冒頭へ managed with ubiCMS